diff options
author | Christopher Baines <mail@cbaines.net> | 2020-11-30 19:07:04 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-11-30 19:14:13 +0000 |
commit | d5affc7addf66cb3115f60dad44faf49b067306b (patch) | |
tree | 6dc4e947cbfc6f091182dea110676316a433d31c /guix-build-coordinator/agent.scm | |
parent | b906bb74810d106f96a6975050773c47d8c4a5dc (diff) | |
download | build-coordinator-d5affc7addf66cb3115f60dad44faf49b067306b.tar build-coordinator-d5affc7addf66cb3115f60dad44faf49b067306b.tar.gz |
Improve handling of build failures
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r-- | guix-build-coordinator/agent.scm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index acb1572..b5180e2 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -90,7 +90,7 @@ derivation-name) (report-build-start coordinator-uri uuid password build-id) - (let* ((result (perform-build lgr store derivation-name)) + (let* ((result (perform-build lgr store build-id derivation-name)) ;; TODO Check this handles timezones right (end-time (localtime (current-time) "UTC"))) @@ -351,20 +351,23 @@ but the guix-daemon claims it's unavailable") '((result . failure) (failure_reason . error_fetching_derivation))))) -(define (perform-build lgr store derivation-name) +(define (perform-build lgr store build-id derivation-name) (set-build-options store #:use-substitutes? #f) (parameterize ((current-build-output-port (%make-void-port "w"))) - (catch #t + (with-exception-handler + (lambda (exn) + (if (and (store-protocol-error? exn) + (eq? (store-protocol-error-status exn) + 100)) + (log-msg lgr 'INFO build-id ": build failed") + (log-msg lgr 'ERROR build-id ": unknown exception " exn)) + #f) (lambda () (build-things store (list derivation-name)) #t) - (lambda (key . args) - (log-msg lgr 'ERROR - "build: " key " " args) - - #f)))) + #:unwind? #t))) (define (post-build-failure lgr uuid coordinator-uri password build-id derivation end-time) |