Fixes a bug that prevents rebuilds for folks who use 'guix shell' repeatedly to refine a package declaration located in a 'guix.scm' file.
The mtime of 'guix.scm' is never evaluated because 'file' is #f here and the code path taken always returns 0 as the purported mtime. https://github.com/guix-mirror/guix/blob/71b92466430acb8c91841522dc0eb7d766af4388/guix/scripts/shell.scm#L390 In the consuming code, the 'timestamp' is always less than the mtime of the profile in the multi-line AND-ed conditional here: https://github.com/guix-mirror/guix/blob/71b92466430acb8c91841522dc0eb7d766af4388/guix/scripts/shell.scm#L250 As a result, outdated ad-hoc profiles are always reused unless they are expressly deleted via: rm ~/.cache/guix/profiles/* The bug was potentially introduced in commit c42b7baf when 'package was transformed to 'ad-hoc-package without also changing the line in this commit. A minimal reproducer can be found here: https://codeberg.org/lechner/shell-bug --- Hi Ludo' > ‘guix shell’ caches based on the mtime of ‘guix.scm’ That's how is should work, but it doesn't as explained above. Here is a patch. Please adjust the commit message to your liking. Thanks! Kind regards Felix guix/scripts/shell.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm index 10ea110fee..d29367c8ee 100644 --- a/guix/scripts/shell.scm +++ b/guix/scripts/shell.scm @@ -398,7 +398,7 @@ (define (key->file key) (values #f #f))) ((('nesting? . #t) . rest) (loop rest system file (append specs '("nested guix")))) - ((('load . ('package candidate)) . rest) + ((('load . ('ad-hoc-package candidate)) . rest) (if (and (not file) (null? specs)) (loop rest system candidate specs) (values #f #f))) base-commit: 71b92466430acb8c91841522dc0eb7d766af4388 -- 2.41.0