Add comments about global memoization.

* guix/build-system/gnu.scm (standard-inputs): Add comment about
  misplaced memoization.
* guix/packages.scm (cache): Likewise.
This commit is contained in:
Ludovic Courtès 2014-07-21 22:06:36 +02:00
parent 1b09031f78
commit bce7526f9a
2 changed files with 5 additions and 0 deletions

View File

@ -250,6 +250,9 @@ derivations for SYSTEM. Include propagated inputs in the result."
inputs)))) inputs))))
(define standard-inputs (define standard-inputs
;; FIXME: Memoization should be associated with the open store (as for
;; 'add-text-to-store'), otherwise we get .drv that may not be valid when
;; switching to another store.
(memoize (memoize
(lambda (system) (lambda (system)
"Return the list of implicit standard inputs used with the GNU Build "Return the list of implicit standard inputs used with the GNU Build

View File

@ -527,6 +527,8 @@ recursively."
(define (cache package system thunk) (define (cache package system thunk)
"Memoize the return values of THUNK as the derivation of PACKAGE on "Memoize the return values of THUNK as the derivation of PACKAGE on
SYSTEM." SYSTEM."
;; FIXME: This memoization should be associated with the open store, because
;; otherwise it breaks when switching to a different store.
(let ((vals (call-with-values thunk list))) (let ((vals (call-with-values thunk list)))
;; Use `hashq-set!' instead of `hash-set!' because `hash' returns the ;; Use `hashq-set!' instead of `hash-set!' because `hash' returns the
;; same value for all structs (as of Guile 2.0.6), and because pointer ;; same value for all structs (as of Guile 2.0.6), and because pointer