From e7dec01910cfcd1bf9f6735e20af12393f2128a9 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 2 May 2023 16:15:08 +0200 Subject: Support the ignore-if-build-required-by-another option For cancelling builds. --- scripts/guix-build-coordinator.in | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index f873b2c..bc94f53 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -286,13 +286,19 @@ (lambda (opt name _ result) (alist-cons 'skip-updating-derived-priorities #t + 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") result))))) (define %build-cancel-option-defaults `((tags . ()) (not-tags . ()) (systems . ()) - (not-systems . ()))) + (not-systems . ()) + (ignore-if-build-required-by-another . #t))) (define %build-update-priority-options (cons* (option '("new-priority") #t #f @@ -646,21 +652,28 @@ tags: count) (current-error-port)) (lambda (report) - (for-each (lambda (id) - (send-cancel-build-request - (assq-ref opts 'coordinator) - id - #:skip-updating-derived-priorities? - (assq-ref opts 'skip-updating-derived-priorities)) - (report)) - matching-builds))) + (for-each + (lambda (id) + (send-cancel-build-request + (assq-ref opts 'coordinator) + id + #:skip-updating-derived-priorities? + (assq-ref opts 'skip-updating-derived-priorities) + #:ignore-if-build-required-by-another? + (assq-ref + opts 'ignore-if-build-required-by-another)) + (report)) + matching-builds))) (loop (get-batch))))))) ((build-id) (send-cancel-build-request (assq-ref opts 'coordinator) build-id #:skip-updating-derived-priorities? - (assq-ref opts 'skip-updating-derived-priorities)))))) + (assq-ref opts 'skip-updating-derived-priorities) + #: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 -- cgit v1.2.3