summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRutherther <rutherther@ditigal.xyz>2026-01-05 10:10:10 +0100
committerRutherther <rutherther@ditigal.xyz>2026-02-07 17:00:12 +0100
commitb7510ecaf19ffed2ab78dadb2446afb33f213461 (patch)
tree6684a412fb48d9144f08eb1c028c41695d1d7c65
parentcebff095e94f158719659e7f6e86eab4e8c6be80 (diff)
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 <rutherther@ditigal.xyz> Merges: #3024
-rw-r--r--guix/inferior.scm19
1 files changed, 9 insertions, 10 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 76c2a767c67..362739623bb 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