diff options
author | Christopher Baines <mail@cbaines.net> | 2022-10-11 10:58:52 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-10-11 10:58:52 +0100 |
commit | 2cd06f2cf8a20f719aa3823eeffac8c39b768504 (patch) | |
tree | 4d3279047837e6eefefc517a9b9b250595b8a506 /scripts | |
parent | 05529c1757d0d5e2a81040b86b4a825c7d88fd9c (diff) | |
download | build-coordinator-2cd06f2cf8a20f719aa3823eeffac8c39b768504.tar build-coordinator-2cd06f2cf8a20f719aa3823eeffac8c39b768504.tar.gz |
Guard against canceling builds required by others
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/guix-build-coordinator.in | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 5b7a580..17c8385 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -269,13 +269,19 @@ (cons arg (or (assq-ref result 'not-systems) '())) + (alist-delete 'not-systems result)))) + (option '("ignore-if-build-required-by-another") #t #f + (lambda (opt name arg result) + (alist-cons 'ignore-if-build-required-by-another + (string=? arg "true") (alist-delete 'not-systems result)))))) (define %build-cancel-option-defaults - `((tags . ()) - (not-tags . ()) - (systems . ()) - (not-systems . ()))) + `((tags . ()) + (not-tags . ()) + (systems . ()) + (not-systems . ()) + (ignore-if-build-required-by-another . #t))) (define %build-update-priority-options (cons* (option '("new-priority") #t #f @@ -636,13 +642,19 @@ tags: (current-error-port)) (lambda (report) (for-each (lambda (id) - (send-cancel-build-request (assq-ref opts 'coordinator) - id) + (send-cancel-build-request + (assq-ref opts 'coordinator) + id + #:ignore-if-build-required-by-another? + (assq-ref opts 'ignore-if-build-required-by-another)) (report)) matching-builds))))) ((build-id) - (send-cancel-build-request (assq-ref opts 'coordinator) - build-id))))) + (send-cancel-build-request + (assq-ref opts 'coordinator) + build-id + #:ignore-if-build-required-by-another? + (assq-ref opts 'ignore-if-build-required-by-another)))))) (("build" "update-priority" rest ...) (let ((opts (parse-options (append %client-options %base-options |