From 83c6d94de3c23c6971868cf04a30a9a4b03261d5 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 11 May 2025 22:21:07 +0000 Subject: [PATCH] (zilch magic): re-raise the first CA error Change-Id: I6a6a6964a748b10ec12aa5cbc1cd736bffe077ff --- core/src/magic.sld | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/magic.sld b/core/src/magic.sld index a4092d0..f25f8a3 100644 --- a/core/src/magic.sld +++ b/core/src/magic.sld @@ -339,6 +339,7 @@ (define pending-mutex (make-mutex)) (define pending-count 0) + (define build-error #f) (define build-mutex (make-mutex)) (define build-condvar (make-condition-variable)) (define to-build '()) @@ -450,6 +451,7 @@ (lambda (e) (mutex-lock! pending-mutex) (set! pending-count 'error) + (set! build-error e) (mutex-unlock! pending-mutex) (condition-variable-broadcast! build-condvar) (when (error-object? e) @@ -487,7 +489,9 @@ (for-each (lambda (t) (thread-join! t)) builder-threads) (when (eq? pending-count 'error) - (error "CA build failed")) + (if build-error + (raise build-error) + (error "CA build failed"))) root-pend) (define (drv-resolve-ca drv outputs) (if (drv-is-ca drv)