aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-09-07 19:31:54 +0100
committerChristopher Baines <mail@cbaines.net>2024-09-07 19:31:54 +0100
commit6ce7f05fca1a45f6ee217bc925b8448c8bdd8c34 (patch)
treed7dd7a3ec1b54c78d8bb8d4daa209f49cfca6109
parent0fc06c7dad2904989fc8c48f5a20c46a60254e9b (diff)
downloadbffe-6ce7f05fca1a45f6ee217bc925b8448c8bdd8c34.tar
bffe-6ce7f05fca1a45f6ee217bc925b8448c8bdd8c34.tar.gz
Generalise build options
This is a breaking change replacing the single priority option to allow changing that and other options.
-rw-r--r--bffe/manage-builds.scm109
1 files changed, 58 insertions, 51 deletions
diff --git a/bffe/manage-builds.scm b/bffe/manage-builds.scm
index 80d79e2..16d986d 100644
--- a/bffe/manage-builds.scm
+++ b/bffe/manage-builds.scm
@@ -40,7 +40,7 @@
build-from-guix-data-service-systems
build-from-guix-data-service-systems-and-targets
build-from-guix-data-service-submit-builds-for-channel-instances?
- build-from-guix-data-service-build-priority
+ build-from-guix-data-service-build-keyword-arguments
build-from-guix-data-service-data-service-build-server-id
start-submit-builds-fibers))
@@ -57,8 +57,8 @@
(submit-builds-for-channel-instances?
build-from-guix-data-service-submit-builds-for-channel-instances?
(default #f))
- (build-priority build-from-guix-data-service-build-priority
- (default #f))
+ (build-keyword-arguments build-from-guix-data-service-build-keyword-arguments
+ (default #f))
(data-service-build-server-id
build-from-guix-data-service-data-service-build-server-id
(default #f))
@@ -299,7 +299,7 @@
guix-data-service
commit
systems
- priority-for-derivation
+ keyword-arguments-for-derivation
#:key
guix-data-service-build-server-id
branch)
@@ -336,26 +336,28 @@
(assoc-ref channel-instance-derivation "derivation"))
(system
(assoc-ref channel-instance-derivation "system")))
- (submit-build/fiberized
- coordinator
- guix-data-service
- derivation
- #:priority
- (priority-for-derivation 'channel-instance
- system
- "none")
- #:log-prefix
- (simple-format #f "channel instance (~A): ~A: "
- system
- derivation)
- #:tags `(((key . category)
- (value . channel-instance))
- ((key . revision)
- (value . ,commit))
- ,@(if branch
- `(((key . branch)
- (value . ,branch)))
- '())))))
+ (apply
+ submit-build/fiberized
+ (append!
+ (list
+ coordinator
+ guix-data-service
+ derivation
+ #:log-prefix
+ (simple-format #f "channel instance (~A): ~A: "
+ system
+ derivation)
+ #:tags `(((key . category)
+ (value . channel-instance))
+ ((key . revision)
+ (value . ,commit))
+ ,@(if branch
+ `(((key . branch)
+ (value . ,branch)))
+ '())))
+ (keyword-arguments-for-derivation 'channel-instance
+ system
+ "none")))))
channel-instance-derivations-to-submit))))
(define* (submit-package-builds-for-revision
@@ -365,7 +367,7 @@
commit
system
target
- priority-for-derivation
+ keyword-arguments-for-derivation
#:key
guix-data-service-build-server-id
branch)
@@ -390,28 +392,30 @@
" package builds for " log-suffix)
(fibers-for-each
(lambda (derivation)
- (submit-build/fiberized
- coordinator
- guix-data-service
- derivation
- #:priority
- (priority-for-derivation 'package
- system
- target)
- #:log-prefix
- (if (string=? target "none")
- (simple-format #f "package (~A): ~A: "
- system derivation)
- (simple-format #f "package (~A=>~A): ~A: "
- system target derivation))
- #:tags `(((key . category)
- (value . package))
- ((key . revision)
- (value . ,commit))
- ,@(if branch
- `(((key . branch)
- (value . ,branch)))
- '()))))
+ (apply
+ submit-build/fiberized
+ (append!
+ (list
+ coordinator
+ guix-data-service
+ derivation
+ #:log-prefix
+ (if (string=? target "none")
+ (simple-format #f "package (~A): ~A: "
+ system derivation)
+ (simple-format #f "package (~A=>~A): ~A: "
+ system target derivation))
+ #:tags `(((key . category)
+ (value . package))
+ ((key . revision)
+ (value . ,commit))
+ ,@(if branch
+ `(((key . branch)
+ (value . ,branch)))
+ '())))
+ (keyword-arguments-for-derivation 'package
+ system
+ target))))
unprocessed-package-derivations)
(log-msg 'INFO "finished submitting " (length unprocessed-package-derivations)
" package builds for " log-suffix))))
@@ -471,7 +475,7 @@
guix-data-service
commit
(map car systems-and-targets)
- (build-from-guix-data-service-build-priority
+ (build-from-guix-data-service-build-keyword-arguments
specification)
#:guix-data-service-build-server-id
(build-from-guix-data-service-data-service-build-server-id
@@ -490,7 +494,7 @@
commit
system
target
- (build-from-guix-data-service-build-priority
+ (build-from-guix-data-service-build-keyword-arguments
specification)
#:guix-data-service-build-server-id
(build-from-guix-data-service-data-service-build-server-id
@@ -536,7 +540,8 @@
(define* (submit-build coordinator guix-data-service derivation
#:key (priority 0) (log-prefix "")
- (tags '()))
+ (tags '())
+ skip-updating-derived-priorities?)
(retry-on-error
(lambda ()
(let ((response
@@ -549,7 +554,9 @@
#t
#t
#t
- tags)))
+ tags
+ #:skip-updating-derived-priorities?
+ skip-updating-derived-priorities?)))
(let ((no-build-submitted-response
(assoc-ref response "no-build-submitted")))
(if no-build-submitted-response