From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id iAeaOkwhRmaLYgAAqHPOHw:P1 (envelope-from ) for ; Thu, 16 May 2024 17:07:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iAeaOkwhRmaLYgAAqHPOHw (envelope-from ) for ; Thu, 16 May 2024 17:07:57 +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-Seal: i=1; s=key1; d=yhetil.org; t=1715872076; a=rsa-sha256; cv=none; b=oPI3k2J4WwmTzVHqbrKdarPHI7SjzOK79dECGdKyZZPVZHxHNHsEIfnfZwu+nE0271JQGi bxaMa2fIqGhSVk1pl81MxDZ8eX8554mMXEzksb1wm9m/yFr5ZjsuOZPhoPmdnD4nUQHkma dGX5kJI7Upzuo7Anb4Y0aMO9D4QPKfbBgsuLNMsbc1MJfRfB9q3zcP42p9+ivdH3itLvWs ZuNEvnaRxAFZho4MxJUgJNsismb79etICsXQEoTjuNfqQntRTJphXx9CAhSfvZj+7SBu00 qh7Vrawke/bw35yyuTPLJOitF9U5OYtSkd3np8OE9JMld1XMDSCKOWYevGnz6g== 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715872076; 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=ryPLKzAU8O78Fdrei9qUOD01xbNIhYbqBPNMFV1/lOY=; b=akv/77ZCC1C8mg1ObQip/VtDGvtki3pOBbhtnySPATo32KL8LPfWonMDJMOMOhXa9St6Op kdxMX3zk1sgOPmd51cJdGTuACUvwvlOIdFreKp+yHGczHyLwuzJXn8wLy6buUh2xlOsyRu Xy1R/En5cG9/8rkhy7YNWH6LVLESrcg1fliNhLmU56mMJ6t47Doeq4AZkJSlQKXz6qrhbp s/sItm4Y2GcXBlUeNGReFwHRqCnt+qQ0CayK8tlvs9+efW75e/4E4GXXgPsMOn5fHAMDmq agV73PZk1WvLtHjlEb/4uqYG+KDRkr+TeXKgy/3eVS/wFhSqoyXs35UodT1Xiw== 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 DE1221651C for ; Thu, 16 May 2024 17:07:56 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7chO-0002CB-3f; Thu, 16 May 2024 11:07:14 -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 1s7chE-0002Ax-9w for guix-patches@gnu.org; Thu, 16 May 2024 11:07:04 -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 1s7chC-0000Ey-2o; Thu, 16 May 2024 11:07:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7chC-0007m8-T8; Thu, 16 May 2024 11:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH 1/4] 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, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 16 May 2024 15:07:02 +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 , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.171587200629840 (code B ref 70985); Thu, 16 May 2024 15:07:02 +0000 Received: (at 70985) by debbugs.gnu.org; 16 May 2024 15:06:46 +0000 Received: from localhost ([127.0.0.1]:49221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7cgv-0007lD-SN for submit@debbugs.gnu.org; Thu, 16 May 2024 11:06:46 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7cgt-0007ku-FU for 70985@debbugs.gnu.org; Thu, 16 May 2024 11:06:43 -0400 Received: from localhost (unknown [45.67.83.153]) by mira.cbaines.net (Postfix) with ESMTPSA id 4B31E27BBE2 for <70985@debbugs.gnu.org>; Thu, 16 May 2024 16:06:10 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 23d91321 for <70985@debbugs.gnu.org>; Thu, 16 May 2024 15:06:08 +0000 (UTC) From: Christopher Baines Date: Thu, 16 May 2024 16:06:03 +0100 Message-ID: <3828bc238a8cc400f9686fe6856c665c31e927dd.1715871966.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: DE1221651C X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -3.37 X-Spam-Score: -3.37 X-TUID: 17OQkbnKJ3jK 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 abe89cdb07..7fbb8d126b 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: 5a624adfd7b14c3717237d137bd0766c77f0f570 -- 2.41.0