diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-06-16 16:46:29 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-06-16 16:46:29 +0200 |
commit | db393b333f77ffbb573faf47b6df74dc65a0e85b (patch) | |
tree | cf549558a8dfc042319d27fb8e7b8313ea28f736 /guix/derivations.scm | |
parent | 9f55cf8d56bc10ebe54902a98942dc895ccd837c (diff) | |
download | gnu-guix-db393b333f77ffbb573faf47b6df74dc65a0e85b.tar gnu-guix-db393b333f77ffbb573faf47b6df74dc65a0e85b.tar.gz |
build-expression->derivation: Have the build fail when EXP returns #f.
* guix/derivations.scm (build-expression->derivation)[builder]: Pass the
result of EXP to `exit'.
* tests/derivations.scm ("build-expression->derivation with expression
returning #f"): New test.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r-- | guix/derivations.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm index ffdf570fc2..24ee06c399 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -446,7 +446,9 @@ derivation NAME. INPUTS must be a list of (NAME DRV-PATH SUB-DRV) tuples; when SUB-DRV is omitted, \"out\" is assumed. EXP is evaluated in an environment where %OUTPUT is bound to the main output path, %OUTPUTS is bound to a list of output/path pairs, and where %BUILD-INPUTS is bound to an alist -of string/output-path pairs made from INPUTS." +of string/output-path pairs made from INPUTS. The builder terminates by +passing the result of EXP to `exit'; thus, when EXP returns #f, the build is +considered to have failed." (define guile (string-append (derivation-path->output-path (%guile-for-build)) "/bin/guile")) @@ -472,7 +474,8 @@ of string/output-path pairs made from INPUTS." (builder (add-text-to-store store (string-append name "-guile-builder") (string-append (object->string prologue) - (object->string exp)) + (object->string + `(exit ,exp))) (map second inputs))) (mod-drv (if (null? modules) #f |