diff options
author | Christopher Baines <mail@cbaines.net> | 2020-12-23 13:15:07 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-12-23 13:15:07 +0000 |
commit | 0dda534fc69eaf51043d9e5ce3639986c6dc8ced (patch) | |
tree | 225a59d5d0d5876b8fffff37c9a9f65795937513 | |
parent | 18074e82b68190c67390bb266ba7d9b3b8f96053 (diff) | |
download | build-coordinator-0dda534fc69eaf51043d9e5ce3639986c6dc8ced.tar build-coordinator-0dda534fc69eaf51043d9e5ce3639986c6dc8ced.tar.gz |
Improve the guix-daemon claims a substitute is unavailable messages
Include the substitute servers that should be providing the substitute.
-rw-r--r-- | guix-build-coordinator/agent.scm | 42 | ||||
-rw-r--r-- | guix-build-coordinator/utils.scm | 11 |
2 files changed, 33 insertions, 20 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index 5c7ce38..9ace7d3 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -264,22 +264,32 @@ 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 ", -but the guix-daemon claims it's unavailable") - #f)))))) + (let ((substitute-urls-with-substitute + (if (list? non-derivation-substitute-urls) + (has-substiutes-no-cache? + non-derivation-substitute-urls + file) + #f))) + (and + (if (eq? substitute-urls-with-substitute #f) + #t ; keep going + (not (null? substitute-urls-with-substitute))) + (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" + (if substitute-urls-with-substitute + (string-append + ":\n" + (string-join substitute-urls-with-substitute "\n")) + "")) + #f))))))) missing-paths))))) (if (null? missing-paths) diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index 1eea5c7..0334811 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -316,18 +316,21 @@ upcoming chunk." #:unwind? #t))))) (or directories '()))) - (let ((narinfos + (let ((substitute-urls (append-map (lambda (substitute-url) (let ((log-port (open-output-string))) (with-throw-handler #t (lambda () - (parameterize ((current-error-port log-port)) - (lookup-narinfos substitute-url (list file)))) + (if (null? + (parameterize ((current-error-port log-port)) + (lookup-narinfos substitute-url (list file)))) + '() + (list substitute-url))) (lambda (key . args) (display (get-output-string log-port)) (close-output-port log-port))))) substitute-urls))) - (not (null? narinfos)))) + substitute-urls)) (define* (substitute-derivation derivation-name #:key substitute-urls) |