From c3a308716bbed0206e3aa46b4377dea568219f6a Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 30 Apr 2020 20:08:32 +0100 Subject: Stop if the build command fails --- guix-build-coordinator/coordinator.scm | 2 +- ...rdinator-queue-builds-from-guix-data-service.in | 38 ++++++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm index a2c961e..fd11161 100644 --- a/guix-build-coordinator/coordinator.scm +++ b/guix-build-coordinator/coordinator.scm @@ -64,7 +64,7 @@ (let ((related-derivations (datastore-list-related-derivations-with-no-build datastore - (peek "DRV" (derivation-file-name derivation))))) + (derivation-file-name derivation)))) (for-each (lambda (related-derivation) (let ((related-uuid (random-v4-uuid))) diff --git a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in index 0899538..815f493 100644 --- a/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in +++ b/scripts/guix-build-coordinator-queue-builds-from-guix-data-service.in @@ -125,23 +125,27 @@ derivations)) (define* (submit-build derivation #:key (priority 0)) - (system* "guix-build-coordinator" "build" - ;; Currently submitting builds performs an allocation. Ideally this - ;; would just mark the plan as dirty to avoid repeatedly - ;; re-allocating builds. Until that point, pass this flag to skip - ;; allocating builds. - "--defer-allocation" - ;; For the use case of providing substitutes, just build each - ;; derivation once. - "--ignore-if-build-for-derivation-exists" - ;; The Guix Build Coordinator will automatically add builds for - ;; inputs if the required output isn't available, but to ensure - ;; this derivation, and all the related derivations have been built - ;; and the outputs stored, instruct the Guix Build Coordinator to - ;; add the builds upfront. - "--ensure-all-related-derivations-have-builds" - (simple-format #f "--priority=~A" priority) - derivation)) + (let ((exit-code + (system* "guix-build-coordinator" "build" + ;; Currently submitting builds performs an allocation. Ideally this + ;; would just mark the plan as dirty to avoid repeatedly + ;; re-allocating builds. Until that point, pass this flag to skip + ;; allocating builds. + "--defer-allocation" + ;; For the use case of providing substitutes, just build each + ;; output once. + "--ignore-if-build-for-derivation-exists" + "--ignore-if-build-for-outputs-exists" + ;; The Guix Build Coordinator will automatically add builds for + ;; inputs if the required output isn't available, but to ensure + ;; this derivation, and all the related derivations have been built + ;; and the outputs stored, instruct the Guix Build Coordinator to + ;; add the builds upfront. + "--ensure-all-related-derivations-have-builds" + (simple-format #f "--priority=~A" priority) + derivation))) + (unless (zero? exit-code) + (error "build command failed")))) (define (submit-builds-for-revision commit) (simple-format #t "looking at revision ~A\n" commit) -- cgit v1.2.3