This is an automated email from the git hooks/post-receive script.
guix_mirror_bot pushed a commit to branch master
in repository guix.
The following commit(s) were added to refs/heads/master by this push:
new ee07d1664d9 shell: Fix a regression leading to incorrect caching for
‘-f’ and ‘-m’.
ee07d1664d9 is described below
commit ee07d1664d9ca1fe3cd20030aa970feb4b59043d
Author: Ludovic Courtès <[email protected]>
AuthorDate: Wed Nov 4 17:25:24 2026 +0100
shell: Fix a regression leading to incorrect caching for ‘-f’ and ‘-m’.
Fixes a regression introduced in 90f7702c22aedfb9cf01017222345a43c8a124ea,
whereby the cache key for ‘guix shell -m manifest.scm’ would always be the
same, even for two different ‘manifest.scm’ files (and likewise for ‘-f’).
* guix/scripts/shell.scm (profile-cached-gc-root): In the ‘load’ and
‘manifest’ cases, use ‘stat:ino’ and ‘stat:dev’ as the cache key instead of
the file name.
Reported-by: Tomas Volf <[email protected]>
Fixes: guix/guix#12306
Signed-off-by: Noé Lopez <[email protected]>
---
guix/scripts/shell.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 81f04537365..c0def29450b 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2021-2025 Ludovic Courtès <[email protected]>
+;;; Copyright © 2021-2026 Ludovic Courtès <[email protected]>
;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
;;;
;;; This file is part of GNU Guix.
@@ -389,9 +389,10 @@ return #f and #f."
(loop rest system mtime (append specs '("nested guix"))))
((('load . ('package candidate)) . rest)
;; This is 'guix shell -D -f guix.scm'.
- (loop rest system
- (max mtime (stat:mtime (stat candidate)))
- (cons `(file ,candidate) specs)))
+ (let ((stat (stat candidate)))
+ (loop rest system
+ (max mtime (stat:mtime stat))
+ (cons `(file ,(stat:ino stat) ,(stat:dev stat)) specs))))
((('load . ('ad-hoc-package candidate)) . rest)
;; When running 'guix shell -f guix.scm', one typically expects
;; 'guix.scm' to be evaluated every time because it may contain
@@ -399,9 +400,10 @@ return #f and #f."
;; caching.
(values #f #f))
((('manifest . candidate) . rest)
- (loop rest system
- (max mtime (stat:mtime (stat candidate)))
- (cons `(manifest ,candidate) specs)))
+ (let ((stat (stat candidate)))
+ (loop rest system
+ (max mtime (stat:mtime stat))
+ (cons `(manifest ,(stat:ino stat) ,(stat:dev stat)) specs))))
((('expression . exp) . rest)
;; Assume that EXP is deterministic and that the result can be cached.
;; In practice EXP typically refers to a package variable in a module.