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 SCeyFUghRmb6QgEAqHPOHw:P1 (envelope-from ) for ; Thu, 16 May 2024 17:07:52 +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 SCeyFUghRmb6QgEAqHPOHw (envelope-from ) for ; Thu, 16 May 2024 17:07:52 +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=1715872072; a=rsa-sha256; cv=none; b=aj2xsBmnqd3klzlguxkP5STeZCo0Q9KbqMH8uvIT6U7LxXER9kXrpC0Eeefm3TU3wBjnVT RgP32L+oQLqK9+3bxJDrs+Z9XuwWUenYjS+v0AwhyOp8AR8+o45fa2plE4+h8H2pUBSkQy lWLSNRTpnnNTtCmq7RBNeDcVwQThew19Ie6qLpN1DAOxzEBaoT2/hi4JJKgKSJMw+58wR8 twEAg2m+nCM0Rcq1CJsr0+dMXDU273ln1RPZjAFsg3YaAvBz1imLG7eR0nfh6VEKFEko2b EG/qf7RBKzuJKQm4/8HtDpNbtwBrJTwVqwr/9eJ6wwu9rIKOpkXEnl1x9wxiQA== 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=1715872072; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: 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=7mpUwhsccOdlwVPqGboXOH3H/5Li6FVsqMRH7lrqKgo=; b=ZquDJ89aH+DLWczqRFUldFdpXQodB1O5GKY3iiSMSrFX6jpRyySz2coe2CefYm3/bseOEZ 1WtHPf+1gifJ3o9FVoRv7qQn0hh3U2DiiLAtTcfuydgJEhuFdoQt2FyLewqs5Gxqy+mL7J B5Q+eTQk96IzmKAMe/2TQgSb5kss+khYWYjjR/zUepSkC4KpCXYGsNhInq++9z1gu0l4SZ PJkcd8cqQ+dPg0rqLkwVp/M+WthKc056FyqYWSyqdtAXwbdBjd9G/xo1DxNLvtn1uwRavZ ceg8In/oANbZaqk322hqba6xb3YAd3AurwtxRGoLk0uIxTjA0GqsVXBcUzxz8g== 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 297B016688 for ; Thu, 16 May 2024 17:07:52 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7chM-0002Bw-5w; Thu, 16 May 2024 11:07:13 -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-0002Au-9K 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 1s7chB-0000Dy-FW for guix-patches@gnu.org; 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 1s7chD-0007mL-O8 for guix-patches@gnu.org; Thu, 16 May 2024 11:07:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH 4/4] guix: build-system: meson: Don't error on unsupported targets. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 May 2024 15: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.171587201229859 (code B ref 70985); Thu, 16 May 2024 15:07:03 +0000 Received: (at 70985) by debbugs.gnu.org; 16 May 2024 15:06:52 +0000 Received: from localhost ([127.0.0.1]:49227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7ch1-0007lW-Sl for submit@debbugs.gnu.org; Thu, 16 May 2024 11:06:52 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7cgu-0007l6-UL for 70985@debbugs.gnu.org; Thu, 16 May 2024 11:06:45 -0400 Received: from localhost (unknown [45.67.83.153]) by mira.cbaines.net (Postfix) with ESMTPSA id D948A27BBEB for <70985@debbugs.gnu.org>; Thu, 16 May 2024 16:06:11 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id c8131ea3 for <70985@debbugs.gnu.org>; Thu, 16 May 2024 15:06:08 +0000 (UTC) From: Christopher Baines Date: Thu, 16 May 2024 16:06:06 +0100 Message-ID: <1f217c47d4494a29035dd136c2672771990c0eb0.1715871966.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3828bc238a8cc400f9686fe6856c665c31e927dd.1715871966.git.mail@cbaines.net> References: <3828bc238a8cc400f9686fe6856c665c31e927dd.1715871966.git.mail@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: 297B016688 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.37 X-Spam-Score: -5.37 X-TUID: MAYZgk2adM9x Rather than raising generic errors. * guix/build-system/meson.scm (make-machine-alist): Return #f if the triplet is unsupported. (lower): Return #f if the machine alist is #f. Change-Id: If6a1f8d1c2073e43107406ac186aa9c845005a95 --- guix/build-system/meson.scm | 115 +++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 53 deletions(-) diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm index bf9ca15ecc..b321417773 100644 --- a/guix/build-system/meson.scm +++ b/guix/build-system/meson.scm @@ -46,39 +46,46 @@ (define (make-machine-alist triplet) "Make an association list describing what should go into the ‘host_machine’ section of the cross file when cross-compiling for TRIPLET." - `((system . ,(cond ((target-hurd? triplet) "gnu") - ((target-linux? triplet) "linux") - ((target-mingw? triplet) "windows") - ((target-avr? triplet) "none") - (#t (error "meson: unknown operating system")))) - (cpu_family . ,(cond ((target-x86-32? triplet) "x86") + (let ((system + (cond + ((target-hurd? triplet) "gnu") + ((target-linux? triplet) "linux") + ((target-mingw? triplet) "windows") + ((target-avr? triplet) "none") + (else #f))) + (cpu-family + (cond ((target-x86-32? triplet) "x86") + ((target-x86-64? triplet) "x86_64") + ((target-arm32? triplet) "arm") + ((target-aarch64? triplet) "aarch64") + ((target-avr? triplet) "avr") + ((target-mips64el? triplet) "mips64") + ((target-powerpc? triplet) + (if (target-64bit? triplet) + "ppc64" + "ppc")) + ((target-riscv64? triplet) "riscv64") + (else #f)))) + (and system + cpu-family + `((system . ,system) + (cpu_family . ,cpu-family) + (cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686 + (substring triplet 0 4)) ((target-x86-64? triplet) "x86_64") - ((target-arm32? triplet) "arm") - ((target-aarch64? triplet) "aarch64") + ((target-aarch64? triplet) "armv8-a") + ((target-arm32? triplet) "armv7") ((target-avr? triplet) "avr") - ((target-mips64el? triplet) "mips64") - ((target-powerpc? triplet) - (if (target-64bit? triplet) - "ppc64" - "ppc")) - ((target-riscv64? triplet) "riscv64") - (#t (error "meson: unknown architecture")))) - (cpu . ,(cond ((target-x86-32? triplet) ; i386, ..., i686 - (substring triplet 0 4)) - ((target-x86-64? triplet) "x86_64") - ((target-aarch64? triplet) "armv8-a") - ((target-arm32? triplet) "armv7") - ((target-avr? triplet) "avr") - ;; According to #mesonbuild on OFTC, there does not appear - ;; to be an official-ish list of CPU types recognised by - ;; Meson, the "cpu" field is not used by Meson itself and - ;; most software doesn't look at this field, except perhaps - ;; for selecting optimisations, so set it to something - ;; arbitrary. - (#t "strawberries"))) - (endian . ,(if (target-little-endian? triplet) - "little" - "big")))) + ;; According to #mesonbuild on OFTC, there does not appear + ;; to be an official-ish list of CPU types recognised by + ;; Meson, the "cpu" field is not used by Meson itself and + ;; most software doesn't look at this field, except perhaps + ;; for selecting optimisations, so set it to something + ;; arbitrary. + (#t "strawberries"))) + (endian . ,(if (target-little-endian? triplet) + "little" + "big")))))) (define (make-binaries-alist triplet) "Make an associatoin list describing what should go into @@ -146,29 +153,31 @@ (define* (lower name '() '(#:target)))) - (bag - (name name) - (system system) (target target) - (build-inputs `(("meson" ,meson) - ("ninja" ,ninja) - ,@native-inputs - ,@(if target '() inputs) - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(if target - (standard-cross-packages target 'host) + (and + (make-machine-alist target) + (bag + (name name) + (system system) (target target) + (build-inputs `(("meson" ,meson) + ("ninja" ,ninja) + ,@native-inputs + ,@(if target '() inputs) + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(if target + (standard-cross-packages target 'host) + '()) + ,@(standard-packages))) + (host-inputs `(,@(if source + `(("source" ,source)) '()) - ,@(standard-packages))) - (host-inputs `(,@(if source - `(("source" ,source)) - '()) - ,@(if target inputs '()))) - ;; Keep the standard inputs of 'gnu-buid-system'. - (target-inputs (if target - (standard-cross-packages target 'target) - '())) - (outputs outputs) - (build (if target meson-cross-build meson-build)) - (arguments (strip-keyword-arguments private-keywords arguments)))) + ,@(if target inputs '()))) + ;; Keep the standard inputs of 'gnu-buid-system'. + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs outputs) + (build (if target meson-cross-build meson-build)) + (arguments (strip-keyword-arguments private-keywords arguments))))) (define* (meson-build name inputs #:key -- 2.41.0