diff --git a/guix/inferior.scm b/guix/inferior.scm index 81958baaa5..febac29766 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -785,6 +785,9 @@ (define symlink* (define add-indirect-root* (store-lift add-indirect-root)) + (define add-temp-root* + (store-lift add-temp-root)) + (mkdir-p cache-directory) (maybe-remove-expired-cache-entries cache-directory cache-entries @@ -805,11 +808,15 @@ (define add-indirect-root* ;; what's going to be built. (built-derivations (list profile)) - ;; Note: Caching is fine even when AUTHENTICATE? is false because - ;; we always call 'latest-channel-instances?'. - (symlink* (derivation->output-path profile) cached) - (add-indirect-root* cached) - (return cached)))))) + ;; Cache if and only if AUTHENTICATE? is true. + (if authenticate? + (mbegin %store-monad + (symlink* (derivation->output-path profile) cached) + (add-indirect-root* cached) + (return cached)) + (mbegin %store-monad + (add-temp-root* profile) + (return profile)))))))) (define* (inferior-for-channels channels #:key