aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-16 06:43:20 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-16 06:43:20 +0000
commit7bd76b74e0e57045b3af23683d3ca72803bfd7be (patch)
tree12b821fd88093825b7a45756f1b79c067a5613ca /scripts
parenta6c75d2053908b058c6c877efc0eaae5d43d5cb6 (diff)
downloadbuild-coordinator-7bd76b74e0e57045b3af23683d3ca72803bfd7be.tar
build-coordinator-7bd76b74e0e57045b3af23683d3ca72803bfd7be.tar.gz
Implement build cancelation
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix-build-coordinator.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index ae6e0d4..39c6dad 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -224,11 +224,15 @@
(simple-format #t "derivation name: ~A
priority: ~A
processed?: ~A
+canceled?: ~A
"
(assoc-ref build-details "derivation-name")
(assoc-ref build-details "priority")
(if (assoc-ref build-details "processed")
"yes"
+ "no")
+ (if (assoc-ref build-details "canceled")
+ "yes"
"no"))
(let ((derivation-inputs
@@ -310,6 +314,17 @@ processed?: ~A
(assoc-ref build "blocked_count")
(assoc-ref build "derivation_name")))
(vector->list (assoc-ref response "builds"))))))
+ (("build" "cancel" rest ...)
+ (let ((opts (parse-options (append %build-options
+ %base-options)
+ (append %build-option-defaults
+ %client-option-defaults
+ %base-option-defaults)
+ rest)))
+ (match (assq-ref opts 'arguments)
+ ((build-id)
+ (send-cancel-build-request (assq-ref opts 'coordinator)
+ build-id)))))
(("build" rest ...)
(let ((opts (parse-options (append %build-options
%base-options)