aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-10-24 15:46:47 +0100
committerChristopher Baines <mail@cbaines.net>2020-10-24 15:46:47 +0100
commitf71901a96c6b971f2b92ad8e68447fe143ac552c (patch)
tree321cc062ccc8f86182de2c19bb6ceedb263624a6
parentc146e61ae6edcf0ae2d4eb11cf553e6500326c3a (diff)
downloadbuild-coordinator-f71901a96c6b971f2b92ad8e68447fe143ac552c.tar
build-coordinator-f71901a96c6b971f2b92ad8e68447fe143ac552c.tar.gz
Use valid-path? rather than file exists for testing store items
As the file might exist, but ignored because the daemon is treating it as invalid.
-rw-r--r--guix-build-coordinator/agent.scm6
-rw-r--r--guix-build-coordinator/client-communication.scm4
-rw-r--r--guix-build-coordinator/utils.scm3
3 files changed, 9 insertions, 4 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index 4951ba6..fa76999 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -186,7 +186,9 @@
#:delay 60)
;; Double check everything is actually present.
- (let ((missing-files (remove file-exists? output-paths)))
+ (let ((missing-files (remove (lambda (path)
+ (valid-path? store path))
+ output-paths)))
(if (null? missing-files)
'()
(begin
@@ -219,7 +221,7 @@
#t)))
(let ((derivation
- (if (file-exists? derivation-name)
+ (if (valid-path? store derivation-name)
(read-derivation-from-file derivation-name)
(begin (retry-on-error
(lambda ()
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index 5105e17..82aa333 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -30,6 +30,7 @@
#:use-module (web request)
#:use-module (web response)
#:use-module (system repl error-handling)
+ #:use-module (guix store)
#:use-module (guix derivations)
#:use-module (guix-build-coordinator utils)
#:use-module (guix-build-coordinator utils fibers)
@@ -166,7 +167,8 @@
(let ((derivation-database-entry
(datastore-find-derivation datastore derivation-file)))
(unless derivation-database-entry
- (unless (file-exists? derivation-file)
+ (unless (with-store store
+ (valid-path? store derivation-file))
(call-with-worker-thread
substitutes-channel
(lambda ()
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm
index f12cab0..ef26d3a 100644
--- a/guix-build-coordinator/utils.scm
+++ b/guix-build-coordinator/utils.scm
@@ -317,7 +317,8 @@ upcoming chunk."
(lambda (key . args)
;; This is a hack, to ignore errors relating to closing the store
;; connection.
- (if (file-exists? derivation-name)
+ (if (with-store store
+ (valid-path? store derivation-name))
#t
(error (simple-format #f "could not substitute ~A\n"
derivation-name))))))