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