From patchwork Fri Jul 5 16:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 65946 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5F7B627BBEA; Fri, 5 Jul 2024 17:07:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DC90927BBE2 for ; Fri, 5 Jul 2024 17:07:47 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPlSh-0005eo-1F; Fri, 05 Jul 2024 12:07:03 -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-0005e5-5N 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 1sPlSe-00044T-TN for guix-patches@gnu.org; Fri, 05 Jul 2024 12:07:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPlSh-0003On-V7 for guix-patches@gnu.org; Fri, 05 Jul 2024 12:07:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH v2 4/6] build-system: meson: Use a more specific exception. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: 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 Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.172019560312998 (code B ref 70985); Fri, 05 Jul 2024 16:07:03 +0000 Received: (at 70985) by debbugs.gnu.org; 5 Jul 2024 16:06:43 +0000 Received: from localhost ([127.0.0.1]:44853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPlSM-0003NU-U5 for submit@debbugs.gnu.org; Fri, 05 Jul 2024 12:06:43 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPlSK-0003Mu-JC 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 C768A27BBEB for <70985@debbugs.gnu.org>; Fri, 5 Jul 2024 17:06:06 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 2b3c6a89 for <70985@debbugs.gnu.org>; Fri, 5 Jul 2024 16:06:05 +0000 (UTC) From: Christopher Baines Date: Fri, 5 Jul 2024 18:06:01 +0200 Message-ID: <24821cf4bf50dbe149edb9413bfb50219f8c5a0e.1720195563.git.mail@cbaines.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> References: <9f11c96f25ba0f8f0c63ad3d6f5d6295035e7cc7.1720195563.git.mail@cbaines.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is handled by (guix ui). * guix/build-system/meson.scm (make-machine-alist): Use a more specific exception. Change-Id: I842ba63739fdefe04460e938c7bc8aa54ea57b96 --- guix/build-system/meson.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index bf9ca15ecc..04d2241c79 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -30,6 +30,8 @@ (define-module (guix build-system meson) #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix packages) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:export (%meson-build-system-modules meson-build-system make-cross-file)) @@ -50,7 +52,12 @@ (define (make-machine-alist triplet) ((target-linux? triplet) "linux") ((target-mingw? triplet) "windows") ((target-avr? triplet) "none") - (#t (error "meson: unknown operating system")))) + (else + (raise + (condition + (&unsupported-cross-compilation-target-error + (build-system meson-build-system) + (target triplet))))))) (cpu_family . ,(cond ((target-x86-32? triplet) "x86") ((target-x86-64? triplet) "x86_64") ((target-arm32? triplet) "arm") @@ -62,7 +69,12 @@ (define (make-machine-alist triplet) "ppc64" "ppc")) ((target-riscv64? triplet) "riscv64") - (#t (error "meson: unknown architecture")))) + (else + (raise + (condition + (&unsupported-cross-compilation-target-error + (build-system meson-build-system) + (target triplet))))))) (cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686 (substring triplet 0 4)) ((target-x86-64? triplet) "x86_64")