aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-27 10:33:33 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-27 10:33:33 +0000
commit528f0871541c2bbd74a11d873fa0b74b40a1b74f (patch)
tree25c6e66194fb9be274a1f65a59fd15ab54ffdb73
parentc76821f570cfb8702e345859f827b06b28fc9b43 (diff)
downloadbuild-coordinator-528f0871541c2bbd74a11d873fa0b74b40a1b74f.tar
build-coordinator-528f0871541c2bbd74a11d873fa0b74b40a1b74f.tar.gz
Fix issues around datastore-count-builds-for-derivation
My refactoring went quite wrong.
-rw-r--r--guix-build-coordinator/coordinator.scm10
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm4
-rw-r--r--guix-build-coordinator/hooks.scm10
3 files changed, 12 insertions, 12 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index dfa00ca..ba5960e 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -261,11 +261,11 @@
(define datastore (build-coordinator-datastore build-coordinator))
(define (build-for-derivation-exists?)
- (not
- (null? (datastore-count-builds-for-derivation
- datastore
- derivation-file
- #:include-canceled? #f))))
+ (> (datastore-count-builds-for-derivation
+ datastore
+ derivation-file
+ #:include-canceled? #f)
+ 0))
(define (build-for-output-already-exists?)
(let ((system (datastore-find-derivation-system datastore
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index fac7bbf..a20f6ed 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -1537,7 +1537,9 @@ WHERE derivation_name = :derivation"
statement
#:derivation derivation)
- (let ((result (sqlite-step statement)))
+ (let ((result
+ (match (sqlite-step statement)
+ (#(x) x))))
(sqlite-reset statement)
result)))))
diff --git a/guix-build-coordinator/hooks.scm b/guix-build-coordinator/hooks.scm
index 5790384..22c1650 100644
--- a/guix-build-coordinator/hooks.scm
+++ b/guix-build-coordinator/hooks.scm
@@ -237,12 +237,10 @@
(let* ((build-details (datastore-find-build datastore build-id))
(derivation-name (assq-ref build-details 'derivation-name))
- (all-builds-for-derivation (datastore-count-builds-for-derivation
- datastore
- derivation-name
- #:include-canceled? #f))
- (all-builds-for-derivation-count (length all-builds-for-derivation)))
-
+ (all-builds-for-derivation-count (datastore-count-builds-for-derivation
+ datastore
+ derivation-name
+ #:include-canceled? #f)))
(when (= 1 all-builds-for-derivation-count)
(display
(simple-format #f "~A: submitting ~A retries for\n ~A\n"