From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sJXDCkkaiGadGwAA62LTzQ:P1 (envelope-from ) for ; Fri, 05 Jul 2024 16:07:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sJXDCkkaiGadGwAA62LTzQ (envelope-from ) for ; Fri, 05 Jul 2024 18:07:37 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720195657; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=YU8JPU57KqPDDu5sUZeLUsFcGwQdainOcMFnvqmsmL4=; b=jW/CZQoLjSXb4qsptQt+QgPhwB2MGniJ2MGA0erw+gCP4UScJJI10ANpZuKU247pFVQ9P7 MZI8llM0uTeFkctepO4K0aXPqMm9WCgFjg1SCFgwt1qYdPd1uIIZNBlCVzv/SuxWicTSnw NbGtSXPtO5zTiwsjjYTHnoEP3KnuRGbKdbjKSLTujdtwf7+pPhqnc+vr2id+vTbNUUl3WG kNC51Hg8Mz7Xal3Wp80mLMfw1d8/nhSR/FjRmf5JgJ4nPYIasNdjkzt1pofr2jW++DdZnS crFVQxV1ppkCFo713axFRDz0pcKDJTxg4++OmJaKfh3UGQY+aV0jFa/Lc2cA9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720195657; a=rsa-sha256; cv=none; b=EjAgPrAZyPnD9MWGqBZJKZvA+mc+dKDS0YgIen3narz7izkJYSZHn/mxi33MDTurtEg13l Mf5P+vk9/w8v0hKtvhrYtyH88Xmlna5+AOZRaDPI0oJJditi2VR+sMnzUWdUE9PEIVfhXW kamaPHlj/2+R2k25iFDuY2WAUNv17P+VySMzQvRoYB3bbDbUn0gF8tDUOajIbrbEKnqFgB xOunXozlKa7J3tglcS0UOL/B6rN7dL65b+JZ1kdjeL25XE1bJWY1NCDH90QAo8lLc07E4q oXeZv7WcWC0ub1qg0/waEcbG0/rjvy50/MtBVwYzC9FP0BdATzHT/I58tHzflA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D73B1DEB7 for ; Fri, 05 Jul 2024 18:07:36 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPlSg-0005ej-UE; Fri, 05 Jul 2024 12:07:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPlSf-0005eJ-RK for guix-patches@gnu.org; Fri, 05 Jul 2024 12:07:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPlSf-00044b-IJ; Fri, 05 Jul 2024 12:07:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPlSh-0003OX-5E; Fri, 05 Jul 2024 12:07:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH v2 1/6] guix: packages: Add new &package-unsupported-target-error. References: <878r09ol8z.fsf@cbaines.net> In-Reply-To: <878r09ol8z.fsf@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 05 Jul 2024 16:07:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70985@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.172019560212984 (code B ref 70985); Fri, 05 Jul 2024 16:07:03 +0000 Received: (at 70985) by debbugs.gnu.org; 5 Jul 2024 16:06:42 +0000 Received: from localhost ([127.0.0.1]:44849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPlSM-0003NL-9d for submit@debbugs.gnu.org; Fri, 05 Jul 2024 12:06:42 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPlSK-0003Mv-MG for 70985@debbugs.gnu.org; Fri, 05 Jul 2024 12:06:41 -0400 Received: from localhost (nat-inria-guest-32-gw-01-bso.bordeaux.inria.fr [194.199.1.32]) by mira.cbaines.net (Postfix) with ESMTPSA id D12AD27BBE2 for <70985@debbugs.gnu.org>; Fri, 5 Jul 2024 17:06:05 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 35b46bd2 for <70985@debbugs.gnu.org>; Fri, 5 Jul 2024 16:06:04 +0000 (UTC) From: Christopher Baines Date: Fri, 5 Jul 2024 18:05:58 +0200 Message-ID: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.39 X-Spam-Score: -0.39 X-Migadu-Queue-Id: D73B1DEB7 X-Migadu-Scanner: mx11.migadu.com X-TUID: QqT9fDAMPIdW 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@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