guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: shell: Really take system into account in the cache key.


From: guix-commits
Subject: 02/04: shell: Really take system into account in the cache key.
Date: Thu, 13 Jul 2023 12:00:50 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 9c513303156b418567b9d2cde9f8df66190051ac
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jul 13 16:50:27 2023 +0200

    shell: Really take system into account in the cache key.
    
    Fixes <https://issues.guix.gnu.org/63230>.
    
    Previously, when running "guix shell -s X ...", OPTS would contain
    something like '((system . "X") ... (system . "DEFAULT")).  Thus, since
    'profile-cached-gc-root' would iterate over it in this order, "DEFAULT"
    would be passed to 'profile-file-cache-key' and 'profile-spec-cache-key'
    instead of "X".
    
    * guix/scripts/shell.scm (profile-cached-gc-root): Reverse OPTS before
    entering 'loop'.
---
 guix/scripts/shell.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 1b42cc2af0..d67152cef7 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -374,7 +374,9 @@ return #f and #f."
   (define (key->file key)
     (string-append (%profile-cache-directory) "/" key))
 
-  (let loop ((opts opts)
+  ;; A given key such as 'system might appear more than once in OPTS, so
+  ;; process it backwards so the last occurrence "wins".
+  (let loop ((opts (reverse opts))
              (system (%current-system))
              (file #f)
              (specs '()))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]