summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-10-12 17:16:49 +0200
committerLudovic Courtès <ludo@gnu.org>2023-10-12 18:53:07 +0200
commit75bdf8e06a325b90bf387a03f88726d338acbbf6 (patch)
tree5b59cf559af334aadb478d8bace81a64d2b8af7b /guix/scripts
parent2812eb2e1b7ec3409cf823c95da1b676259d8698 (diff)
shell: Take grafting into account when caching.
Fixes <https://issues.guix.gnu.org/64856>. * guix/scripts/shell.scm (profile-file-cache-key) (profile-spec-cache-key): Take (%graft?) into account. Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/shell.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 83888eee1d..898c355316 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -26,6 +26,7 @@
#:autoload (guix transformations) (options->transformation
transformation-option-key?
show-transformation-options-help)
+ #:autoload (guix grafts) (%graft?)
#:use-module (guix scripts)
#:use-module (guix packages)
#:use-module (guix profiles)
@@ -354,6 +355,7 @@ performed--e.g., because the package cache is not authoritative."
;; be insufficient: <https://lwn.net/Articles/866582/>.
(sha256 (string->utf8
(string-append primary-key ":" system ":"
+ (if (%graft?) "" "ungrafted:")
(number->string (stat:dev stat)) ":"
(number->string (stat:ino stat))))))))))
@@ -366,6 +368,7 @@ is a list of package specs. Return #f if caching is not possible."
(bytevector->base32-string
(sha256 (string->utf8
(string-append primary-key ":" system ":"
+ (if (%graft?) "" "ungrafted:")
(object->string specs))))))))
(define (profile-cached-gc-root opts)