From b7510ecaf19ffed2ab78dadb2446afb33f213461 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Mon, 5 Jan 2026 10:10:10 +0100 Subject: [PATCH] inferior: Allow caching of unauthenticated channels. * guix/inferior.scm (cached-channel-instance): Distinguish keys for authenticated and unauthenticated channel instances. Allow caching unauthenticated channels. Change-Id: I25cec6bff99579e8859fdb474514bcd4d41c6d95 Signed-off-by: Rutherther Merges: #3024 --- guix/inferior.scm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/guix/inferior.scm b/guix/inferior.scm index 76c2a767c6..362739623b 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -918,7 +918,9 @@ X.509 host certificate; otherwise, warn about the problem and keep going." (define (key commits) (bytevector->base32-string (sha256 - (string->utf8 (string-concatenate commits))))) + (string->utf8 (string-append + (if authenticate? "" "unauthenticated:") + (string-concatenate commits)))))) (define (cached commits) (string-append cache-directory "/" (key commits))) @@ -990,15 +992,12 @@ X.509 host certificate; otherwise, warn about the problem and keep going." ;; what's going to be built. (built-derivations (list profile)) - ;; Cache if and only if AUTHENTICATE? is true. - (if authenticate? - (mbegin %store-monad - (symlink* (derivation->output-path profile) (cached commits)) - (add-indirect-root* (cached commits)) - (return (cached commits))) - (mbegin %store-monad - (add-temp-root* (derivation->output-path profile)) - (return (derivation->output-path profile))))))))))) + ;; This is safe, since we are using a different key for + ;; unauthenticated commits. + (mbegin %store-monad + (symlink* (derivation->output-path profile) (cached commits)) + (add-indirect-root* (cached commits)) + (return (cached commits)))))))))) (define* (inferior-for-channels channels #:key