From 9b222abe0349701280d48e4830f98aa07c947517 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 27 May 2013 23:41:35 +0200 Subject: 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. --- guix/packages.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'guix/packages.scm') diff --git a/guix/packages.scm b/guix/packages.scm index 9d11b468fb..4f8d87e53a 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -83,7 +83,9 @@ package-error-package &package-input-error package-input-error? - package-error-invalid-input)) + package-error-invalid-input + &package-cross-build-system-error + package-cross-build-system-error?)) ;;; Commentary: ;;; @@ -234,6 +236,9 @@ corresponds to the arguments expected by `set-path-environment-variable'." package-input-error? (input package-error-invalid-input)) +(define-condition-type &package-cross-build-system-error &package-error + package-cross-build-system-error?) + (define (package-full-name package) "Return the full name of PACKAGE--i.e., `NAME-VERSION'." @@ -412,6 +417,11 @@ system identifying string)." (= build-system-cross-builder builder) args inputs propagated-inputs native-inputs self-native-input? outputs) + (unless builder + (raise (condition + (&package-cross-build-system-error + (package package))))) + (let* ((inputs (package-transitive-target-inputs package)) (input-drvs (map (cut expand-input store package <> -- cgit v1.2.3