aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-06 19:56:20 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-06 19:56:20 +0000
commit79e28fbfd7298eecd754f75170c09c59c0943f67 (patch)
tree4bd76d5af5c4cf191525c6c9a0e02f975c5b0e19 /guix-build-coordinator/agent.scm
parent53d7d329d82b192d152a2ecc659c125f62cb1c2e (diff)
downloadbuild-coordinator-79e28fbfd7298eecd754f75170c09c59c0943f67.tar
build-coordinator-79e28fbfd7298eecd754f75170c09c59c0943f67.tar.gz
Avoid setting timeout options for the daemon for the build
The timeouts are useful when fetching substitutes, but I want to keep the previous behaviour of using the values set in the daemon for the build itself.
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r--guix-build-coordinator/agent.scm94
1 files changed, 49 insertions, 45 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index 2894dcb..d3b5b4a 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -205,36 +205,39 @@
output-paths))
(path-substitutes
(begin
- (apply set-build-options
- store
- `(,@(if non-derivation-substitute-urls
- (list #:substitute-urls
- non-derivation-substitute-urls)
- '())
- #:max-silent-time 60
- #:timeout ,(* 10 60)))
-
- (unless non-derivation-substitute-urls
- (log-msg lgr 'WARN
- "non-derivation-substitute-urls unset,
+ (with-store store
+ (apply set-build-options
+ store
+ `(,@(if non-derivation-substitute-urls
+ (list #:substitute-urls
+ non-derivation-substitute-urls)
+ '())
+ #:max-silent-time 60
+ #:timeout ,(* 10 60)))
+
+ (unless non-derivation-substitute-urls
+ (log-msg lgr 'WARN
+ "non-derivation-substitute-urls unset,
unable to query substitute servers without caching"))
- (map (lambda (file)
- (and
- (and (list? non-derivation-substitute-urls)
- (has-substiutes-no-cache? non-derivation-substitute-urls
- file))
- (let ((log-port (open-output-string)))
- ;; TODO Do something with the logged output
- (parameterize ((current-build-output-port log-port))
- (if (has-substitutes? store file)
- #t
- (begin
- (log-msg lgr 'WARN
- "a substitute should be available for " file ",
+ (map (lambda (file)
+ (and
+ (and (list? non-derivation-substitute-urls)
+ (has-substiutes-no-cache?
+ non-derivation-substitute-urls
+ file))
+ (let ((log-port (open-output-string)))
+ ;; TODO Do something with the logged output
+ (parameterize ((current-build-output-port log-port))
+ (if (has-substitutes? store file)
+ #t
+ (begin
+ (log-msg
+ lgr 'WARN
+ "a substitute should be available for " file ",
but the guix-daemon claims it's unavailable")
- #f))))))
- missing-paths))))
+ #f))))))
+ missing-paths)))))
(if (null? missing-paths)
'()
@@ -253,24 +256,25 @@ but the guix-daemon claims it's unavailable")
(raise-exception
(make-exception-with-message "timeout fetching inputs"))
(begin
- ;; Download the substitutes
- (apply set-build-options
- store
- `(,@(if non-derivation-substitute-urls
- (list #:substitute-urls
- non-derivation-substitute-urls)
- '())
- #:max-silent-time 60
- #:timeout ,(* 10 60)))
-
- (let ((log-port (open-output-string)))
- (with-throw-handler #t
- (lambda ()
- (parameterize ((current-build-output-port log-port))
- (build-things store missing-paths)))
- (lambda (key . args)
- (display (get-output-string log-port))
- (close-output-port log-port)))))))
+ (with-store store
+ ;; Download the substitutes
+ (apply set-build-options
+ store
+ `(,@(if non-derivation-substitute-urls
+ (list #:substitute-urls
+ non-derivation-substitute-urls)
+ '())
+ #:max-silent-time 60
+ #:timeout ,(* 10 60)))
+
+ (let ((log-port (open-output-string)))
+ (with-throw-handler #t
+ (lambda ()
+ (parameterize ((current-build-output-port log-port))
+ (build-things store missing-paths)))
+ (lambda (key . args)
+ (display (get-output-string log-port))
+ (close-output-port log-port))))))))
#:times 6
#:delay (+ 15 (random 30)))