guix_mirror_bot pushed a commit to branch master
in repository guix.

commit b7510ecaf19ffed2ab78dadb2446afb33f213461
Author: Rutherther <[email protected]>
AuthorDate: Mon Jan 5 10:10:10 2026 +0100

    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 <[email protected]>
    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

Reply via email to