diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-17 11:48:07 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-04-17 11:48:07 +0100 |
commit | a43c537109766d6403dbb0f03e551aa7020d1150 (patch) | |
tree | 1a48614fb33fb9d96dd9cfd7121d49542be0be50 /scripts | |
parent | 1f46168cc9005aa5ec3114a0d2745031c8bc3a47 (diff) | |
download | build-coordinator-a43c537109766d6403dbb0f03e551aa7020d1150.tar build-coordinator-a43c537109766d6403dbb0f03e551aa7020d1150.tar.gz |
Add a hook to handle missing inputs
That submits new build jobs to build these missing inputs if appropriate.
This means that you can tell the coordinator to build something, and it will
automatically attempt to build the dependencies if they're missing.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/guix-build-coordinator.in | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 458b693..50dda71 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -89,14 +89,20 @@ (lambda (opt name arg result) (alist-cons 'build-failure-hook (read/eval arg) - (alist-delete 'build-failure-hook result)))))) + (alist-delete 'build-failure-hook result)))) + (option '("build-missing-inputs-hook") #t #f + (lambda (opt name arg result) + (alist-cons 'build-missing-inputs-hook + (read/eval arg) + (alist-delete 'build-missing-inputs-hook result)))))) (define %service-option-defaults ;; Alist of default option values `((port . 8745) (host . "0.0.0.0") (build-success-hook . ,default-build-success-hook) - (build-failure-hook . ,default-build-failure-hook))) + (build-failure-hook . ,default-build-failure-hook) + (build-missing-inputs-hook . ,default-build-missing-inputs-hook))) (define %agent-options (list (option '("uuid") #t #f @@ -178,8 +184,9 @@ (datastore (database-uri->datastore (assq-ref opts 'database))) (hooks - `((build-success . ,(assq-ref opts 'build-success-hook)) - (build-failure . ,(assq-ref opts 'build-failure-hook))))) + `((build-success . ,(assq-ref opts 'build-success-hook)) + (build-failure . ,(assq-ref opts 'build-failure-hook)) + (build-missing-inputs . ,(assq-ref opts 'build-missing-inputs-hook))))) (when (assoc-ref opts 'update-database) (datastore-update datastore)) |