From 75bdf8e06a325b90bf387a03f88726d338acbbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 12 Oct 2023 17:16:49 +0200 Subject: [PATCH] shell: Take grafting into account when caching. Fixes . * guix/scripts/shell.scm (profile-file-cache-key) (profile-spec-cache-key): Take (%graft?) into account. Reported-by: Maxim Cournoyer --- guix/scripts/shell.scm | 3 +++ 1 file changed, 3 insertions(+) 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 @@ (define-module (guix scripts shell) #: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 @@ (define (profile-file-cache-key file system) ;; be insufficient: . (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 @@ (define (profile-spec-cache-key specs system) (bytevector->base32-string (sha256 (string->utf8 (string-append primary-key ":" system ":" + (if (%graft?) "" "ungrafted:") (object->string specs)))))))) (define (profile-cached-gc-root opts)