derivations: 'derivation' preserves pointer equality.
* guix/derivations.scm (derivation): Check if FILE is already in %DERIVATION-CACHE and return it if it is.
This commit is contained in:
parent
5cf4b26d52
commit
fd951cd543
|
@ -873,8 +873,12 @@ derivation. It is kept as-is, uninterpreted, in the derivation."
|
|||
(append (map derivation-input-path inputs)
|
||||
sources)))
|
||||
(drv* (set-field drv (derivation-file-name) file)))
|
||||
;; Preserve pointer equality. This improves the performance of
|
||||
;; 'eq?'-memoization on derivations.
|
||||
(or (hash-ref %derivation-cache file)
|
||||
(begin
|
||||
(hash-set! %derivation-cache file drv*)
|
||||
drv*)))
|
||||
drv*)))))
|
||||
|
||||
(define (invalidate-derivation-caches!)
|
||||
"Invalidate internal derivation caches. This is mostly useful for
|
||||
|
|
Loading…
Reference in New Issue