From bce7526f9a7d4e26242d3128157e30c2fa7ecb0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 21 Jul 2014 22:06:36 +0200 Subject: [PATCH] Add comments about global memoization. * guix/build-system/gnu.scm (standard-inputs): Add comment about misplaced memoization. * guix/packages.scm (cache): Likewise. --- guix/build-system/gnu.scm | 3 +++ guix/packages.scm | 2 ++ 2 files changed, 5 insertions(+) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 4fa1d1683d..b2b184db34 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -250,6 +250,9 @@ (define input-package->derivation 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 (lambda (system) "Return the list of implicit standard inputs used with the GNU Build diff --git a/guix/packages.scm b/guix/packages.scm index 5c3da9f2ff..1939373f35 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -527,6 +527,8 @@ (define %derivation-cache (define (cache package system thunk) "Memoize the return values of THUNK as the derivation of PACKAGE on 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))) ;; 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