GNU bug report logs - #70985
[PATCH 0/4] Use specific errors for unsupported targets

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Thu, 16 May 2024 15:01:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Christopher Baines <mail <at> cbaines.net>
To: 70985 <at> debbugs.gnu.org
Cc: Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Ludovic Courtès <ludo <at> gnu.org>, Mathieu Othacehe <othacehe <at> gnu.org>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#70985] [PATCH v2 1/6] guix: packages: Add new &package-unsupported-target-error.
Date: Fri,  5 Jul 2024 18:05:58 +0200
Some packages don't support cross building to specific targets, so add a error
type to signal this.

* guix/packages.scm (&package-unsupported-target-error): New condition type.
[package-unsupported-target-error? package-unsupported-target-error-target):
New procedures.
* guix/ui.scm (call-with-error-handling): Handle this new condition type.

Change-Id: Ib47813399e04b20d616a95f545b6aabe25736e92
---
 guix/packages.scm | 7 +++++++
 guix/ui.scm       | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/guix/packages.scm b/guix/packages.scm
index f3a9a61785..e793714f2e 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -173,6 +173,9 @@ (define-module (guix packages)
             package-error-invalid-input
             &package-cross-build-system-error
             package-cross-build-system-error?
+            &package-unsupported-target-error
+            package-unsupported-target-error?
+            package-unsupported-target-error-target
 
             package->bag
             bag->derivation
@@ -850,6 +853,10 @@ (define-condition-type &package-cyclic-dependency-error &package-error
 (define-condition-type &package-cross-build-system-error &package-error
   package-cross-build-system-error?)
 
+(define-condition-type &package-unsupported-target-error &package-error
+  package-unsupported-target-error?
+  (target package-unsupported-target-error-target))
+
 (define* (package-full-name package #:optional (delimiter "@"))
   "Return the full name of PACKAGE--i.e., `NAME <at> VERSION'.  By specifying
 DELIMITER (a string), you can customize what will appear between the name and
diff --git a/guix/ui.scm b/guix/ui.scm
index d82fa533cc..0bb1b3b3ba 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -756,6 +756,13 @@ (define (call-with-error-handling thunk)
                        (location->string loc)
                        (package-full-name package)
                        (build-system-name system))))
+             ((package-unsupported-target-error? c)
+              (let* ((package (package-error-package c))
+                     (loc     (package-location package)))
+                (leave (G_ "~a: ~a: does not support target `~a'~%")
+                       (location->string loc)
+                       (package-full-name package)
+                       (package-unsupported-target-error-target c))))
              ((gexp-input-error? c)
               (let ((input (gexp-error-invalid-input c)))
                 (leave (G_ "~s: invalid G-expression input~%")

base-commit: 5ee2799cabba4b2d462ac064a98789d7bca07923
-- 
2.45.2





This bug report was last modified 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.