From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 ICkbANAykWYbygAAe85BDQ:P1 (envelope-from ) for ; Fri, 12 Jul 2024 13:42:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id ICkbANAykWYbygAAe85BDQ (envelope-from ) for ; Fri, 12 Jul 2024 15:42:40 +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=1720791759; 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=rUs+6sxkabuYCIRFYyBYvdVftZX76QpOUGHvigThvWc=; b=ooifY/o24R8nCL7NEC/zePHEmfnclojM3pxfratWw3E6LYlfpNZHYxyJFbB5WOOnJaYIUX ImH5wIGNpGr0YI+c9il1pHgiDT3FHtk0ktcHPa5t+3EIiNdf0zpEzuy9ydcs6/AXHUq+KV VPX52K2jbo7S0wPz9FQgizC9I0kMxXQHuLzRICUqW09aCYnHpg0IJAbiA91HTYhTYPEKvT zhsnbRn6q+828aAtMC0oPceFJsB5RyJ/fMkq4JzWj2mZ0UJy3n95p6RnjB6uotYcvnCUpP egzhCHtDDemiUCmR3jn7zCxac3UHvW2zLSRfbnHq9LG2VBAKybbJ6Xh/9dpW3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720791759; a=rsa-sha256; cv=none; b=XuKm8raZwAwWKhJp45T1QxcQVn44Nw30sXzSo03rjG2n6MMT5RsGB7hpNt1LOKQRiMrzp6 E8kx8GvZM4NN72qUnMzf1yllZjQu9Xesu+EhWKwIK5/aiw312xcm2VvU2JZlzJnFw7BtsR xIB1Pj1kZ466L/VWkzPApkQ1kCrXbNLbGn5jtnhKVs7qjxcg/duzz982tpCx5bjl21aWgU PdQzrNdnFLs2fJNdMp0oAuoyh+7YgiTgNYcuuPFu9kkMkyJHB+h1d75jyIsLw553e53Rby BdXV4wBBYYvxU1Bbxv12ROk6ME0KKb3zk89SLFFX+odbeBA1kPx5I79cSkCa7Q== 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 B80B4628CB for ; Fri, 12 Jul 2024 15:42:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSGXH-00038N-3v; Fri, 12 Jul 2024 09:42:07 -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 1sSGXF-0002yx-Bd for guix-patches@gnu.org; Fri, 12 Jul 2024 09:42:05 -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 1sSGXE-0001OC-Cz; Fri, 12 Jul 2024 09:42:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSGXC-0001Dp-A2; Fri, 12 Jul 2024 09:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH v3 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, 12 Jul 2024 13:42: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 , 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.17207917134656 (code B ref 70985); Fri, 12 Jul 2024 13:42:02 +0000 Received: (at 70985) by debbugs.gnu.org; 12 Jul 2024 13:41:53 +0000 Received: from localhost ([127.0.0.1]:53510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSGX2-0001Cw-Qr for submit@debbugs.gnu.org; Fri, 12 Jul 2024 09:41:53 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSGWy-0001CL-MD for 70985@debbugs.gnu.org; Fri, 12 Jul 2024 09:41:50 -0400 Received: from localhost (unknown [213.31.211.195]) by mira.cbaines.net (Postfix) with ESMTPSA id D640D27BBE2 for <70985@debbugs.gnu.org>; Fri, 12 Jul 2024 14:41:46 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 324d8d01 for <70985@debbugs.gnu.org>; Fri, 12 Jul 2024 13:41:46 +0000 (UTC) From: Christopher Baines Date: Fri, 12 Jul 2024 14:41:40 +0100 Message-ID: <7783ce71e892ea74f025323e0a4d323ee8e720fc.1720791705.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.40 X-Spam-Score: -0.40 X-Migadu-Queue-Id: B80B4628CB X-Migadu-Scanner: mx11.migadu.com X-TUID: 3+spgQy3P5Fb 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: d11912ac254d1dd8f5d1f5d67c59d0f6d6b68006 -- 2.45.2