summaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-27 23:41:35 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-27 23:43:00 +0200
commit9b222abe0349701280d48e4830f98aa07c947517 (patch)
treeb76c83e97f1c232fae4621ee288ef6ea2016744b /guix/ui.scm
parentea84ec7711a9935f28af3b392d43fe340c7919d0 (diff)
packages: Raise an error condition a cross builder is needed but unavailable.
* guix/packages.scm (&package-cross-build-system-error): New condition type. (package-cross-derivation): Raise &package-cross-build-system-error when the build system doesn't support cross builds. * guix/ui.scm (call-with-error-handling): Add package-cross-build-system-error? case. * tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index cf94aa0818..cd47989ca6 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -23,6 +23,7 @@
#:use-module (guix store)
#:use-module (guix config)
#:use-module (guix packages)
+ #:use-module (guix build-system)
#:use-module (guix derivations)
#:use-module ((guix licenses) #:select (license? license-name))
#:use-module (srfi srfi-1)
@@ -152,6 +153,14 @@ General help using GNU software: <http://www.gnu.org/gethelp/>"))
(leave (_ "~a:~a:~a: package `~a' has an invalid input: ~s~%")
file line column
(package-full-name package) input)))
+ ((package-cross-build-system-error? c)
+ (let* ((package (package-error-package c))
+ (loc (package-location package))
+ (system (package-build-system package)))
+ (leave (_ "~a: ~a: build system `~a' does not support cross builds~%")
+ (location->string loc)
+ (package-full-name package)
+ (build-system-name system))))
((nix-connection-error? c)
(leave (_ "failed to connect to `~a': ~a~%")
(nix-connection-error-file c)