diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-01-24 22:50:40 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-01-24 22:57:49 +0100 |
commit | f304c9c237aca7e9007d6e0cefd6ed858c5a9e47 (patch) | |
tree | ba6720f7db2bd14590d2aa89fa28245ff7ee40a0 /tests | |
parent | da74bc7886cba77192260d84b2dd57466e4b5354 (diff) | |
download | patches-f304c9c237aca7e9007d6e0cefd6ed858c5a9e47.tar patches-f304c9c237aca7e9007d6e0cefd6ed858c5a9e47.tar.gz |
derivations: Raise an error for references to non-existent outputs.
Fixes <http://bugs.gnu.org/19630>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.
* guix/derivations.scm (&derivation-error,
&derivation-missing-output-error): New error conditions.
(derivation->output-path): Raise a '&derivation-missing-output-error'
if OUTPUT is not an output of DRV.
* guix/ui.scm (call-with-error-handling): Add case for
'derivation-missing-output-error?'.
(show-what-to-build): Check whether (derivation-outputs drv) is
empty.
* tests/packages.scm ("reference to non-existent output"): Add test.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/packages.scm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index ef34e76380..65e5cc3cdd 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -268,6 +268,17 @@ (package-derivation %store p) #f))) +(test-assert "reference to non-existent output" + ;; See <http://bugs.gnu.org/19630>. + (let* ((dep (dummy-package "dep")) + (p (dummy-package "p" + (inputs `(("dep" ,dep "non-existent")))))) + (guard (c ((derivation-missing-output-error? c) + (and (string=? (derivation-missing-output c) "non-existent") + (equal? (package-derivation %store dep) + (derivation-error-derivation c))))) + (package-derivation %store p)))) + (test-assert "trivial" (let* ((p (package (inherit (dummy-package "trivial")) (build-system trivial-build-system) |