shell: Disable caching when '-p' is passed.

Fixes <https://issues.guix.gnu.org/53658>.
Reported by Guillaume Le Vaillant <glv@posteo.net>.

Previously we would wrongfully cache things, by adding a
new (profile . _) pair to the option alist, when the user runs:

  guix shell -p /path/to/profile -q

* guix/scripts/shell.scm (profile-cached-gc-root): Add ('profile . _) case.
This commit is contained in:
Ludovic Courtès 2022-03-02 11:58:51 +01:00
parent 209a3274f8
commit ee6275c974
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -372,6 +372,10 @@ (define (key->file key)
;; least depending on external state (with-source, with-commit, etc.),
;; so do not cache anything when they're used.
(values #f #f))
((('profile . _) . _)
;; If the user already specified a profile, there's nothing more to
;; cache.
(values #f #f))
((('system . system) . rest)
(loop rest system file specs))
((_ . rest) (loop rest system file specs)))))