diff options
author | Christopher Baines <mail@cbaines.net> | 2020-10-24 17:43:19 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-10-24 17:43:19 +0100 |
commit | abacaf6db0f165740117d421b9957a8663d6bb02 (patch) | |
tree | dda1d374ee80dbbacba18f80281de0b059977f09 | |
parent | 142258216c851f316c3854f146f3302c373b23c9 (diff) | |
download | build-coordinator-abacaf6db0f165740117d421b9957a8663d6bb02.tar build-coordinator-abacaf6db0f165740117d421b9957a8663d6bb02.tar.gz |
WIP
-rw-r--r-- | guix-build-coordinator/agent.scm | 1 | ||||
-rw-r--r-- | guix-build-coordinator/utils.scm | 54 |
2 files changed, 29 insertions, 26 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index 850d378..9fbd882 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -202,6 +202,7 @@ (append-map (lambda (missing-output) (find-missing-substitutes-for-output + store non-derivation-substitute-urls missing-output)) missing-files)))) diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index 3fbb349..d9ce9d1 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -257,13 +257,13 @@ upcoming chunk." (values response body)))))))) -(define (find-missing-substitutes-for-output substitute-urls output) - (define %narinfo-cache-directory - (if (zero? (getuid)) - (or (and=> (getenv "XDG_CACHE_HOME") - (cut string-append <> "/guix/substitute")) - (string-append %state-directory "/substitute/cache")) - (string-append (cache-directory #:ensure? #f) "/substitute"))) +(define (find-missing-substitutes-for-output store substitute-urls output) + ;; (define %narinfo-cache-directory + ;; (if (zero? (getuid)) + ;; (or (and=> (getenv "XDG_CACHE_HOME") + ;; (cut string-append <> "/guix/substitute")) + ;; (string-append %state-directory "/substitute/cache")) + ;; (string-append (cache-directory #:ensure? #f) "/substitute"))) ;; Because there's no control over the caching of 404 lookups, and I'd ;; rather not reach inside and monkey patch the Guix code, just delete any @@ -290,25 +290,27 @@ upcoming chunk." ;; #:unwind? #t)))) ;; (or directories '()))) - (let ((narinfo - (any (lambda (substitute-url) - (let ((result (lookup-narinfos substitute-url (list output)))) - (if (null? result) - #f - (first result)))) - substitute-urls))) - (if narinfo - (append-map - (lambda (reference) - (let ((referenced-output - (string-append (%store-prefix) "/" reference))) - (peek "REF" referenced-output) - (if (string=? referenced-output output) - '() - (find-missing-substitutes-for-output substitute-urls - referenced-output)))) - (narinfo-references narinfo)) - (list output)))) + (if (valid-path? store output) + '() + (let ((narinfo + (any (lambda (substitute-url) + (let ((result (lookup-narinfos substitute-url (list output)))) + (if (null? result) + #f + (first result)))) + substitute-urls))) + (if narinfo + (append-map + (lambda (reference) + (let ((referenced-output + (string-append (%store-prefix) "/" reference))) + (peek "REF" referenced-output) + (if (string=? referenced-output output) + '() + (find-missing-substitutes-for-output substitute-urls + referenced-output)))) + (narinfo-references narinfo)) + (list output))))) (define (has-substiutes-no-cache? substitute-urls file) (define %narinfo-cache-directory |