aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-05-01 18:30:24 +0100
committerChristopher Baines <mail@cbaines.net>2020-05-01 18:31:37 +0100
commit1567fb18fc43e10855f53919a839e4be6deae13c (patch)
tree214175a4eefceb8bfcb2c2cbd909447e398ebd5a /guix-build-coordinator/agent.scm
parent58812c13b03085ad320195887a114bca9520856a (diff)
downloadbuild-coordinator-1567fb18fc43e10855f53919a839e4be6deae13c.tar
build-coordinator-1567fb18fc43e10855f53919a839e4be6deae13c.tar.gz
Avoid using has-substitutes? if one isn't available
Because 404's for substitutes are cached for 3 hours (I think this is the current behaviour in Guix), this can mean that even though a substitute might become available, you migth have to wait up to 3 hours to be able to use it. To try and avoid this circumstance, check if a substitute is available without using the daemon, and only ask it if there should be one available.
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r--guix-build-coordinator/agent.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index 518b02c..9db7e10 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -90,12 +90,19 @@
(remove file-exists? output-paths))
(path-substitutes
(with-store store
- (set-build-options store
- #:substitute-urls substitute-urls)
-
- (map (lambda (file)
- (has-substitutes? store file))
- missing-paths))))
+ (set-build-options store #:substitute-urls substitute-urls)
+
+ (map (lambda (file)
+ (and
+ (has-substiutes-no-cache? substitute-urls file)
+ (if (has-substitutes? store file)
+ #t
+ (begin
+ (simple-format
+ #t "warning: a substitute should be available for ~A, but the daemon claims it's not\n"
+ file)
+ #f))))
+ missing-paths))))
(if (member #f path-substitutes)
(fold (lambda (file substitute-available? result)