From patchwork Wed Jul 21 01:00:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 31542 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 8C07427BC78; Wed, 21 Jul 2021 02:02:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1160827BC6B for ; Wed, 21 Jul 2021 02:02:29 +0100 (BST) Received: from localhost ([::1]:39936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m60d2-0008Jm-4Q for patchwork@mira.cbaines.net; Tue, 20 Jul 2021 21:02:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m60cf-0007Rp-24 for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m60ce-0007j8-Qm for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m60ce-00009e-Pk for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49672] [PATCH 7/9] bootloader: grub: Fix mix of GNU triplet and Nix system identifier Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 01:02:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49672 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49672@debbugs.gnu.org Cc: Thiago Jung Bauermann Received: via spool by 49672-submit@debbugs.gnu.org id=B49672.1626829307503 (code B ref 49672); Wed, 21 Jul 2021 01:02:04 +0000 Received: (at 49672) by debbugs.gnu.org; 21 Jul 2021 01:01:47 +0000 Received: from localhost ([127.0.0.1]:35769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60cN-000082-9r for submit@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:47 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:49216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60cL-00007g-Nf for 49672@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:46 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 46518AF6 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1626829297; x=1628643698; bh=Vlj4F3reKETdde84MigstZ0dzVqKIDtClIB xGUO8mv8=; b=entsooVP29i7zsnDU6yfk7hn53mzt7D9tqMOH6I14y1F3+Ohh0Q c6HvqcZQO2/xAq2ZFYRzULewaLBcFcJNdliEf1kIPtd3eJV2a1ndEfj3w6miBRG8 jcVwGG7uG2J4t029AdwL5UkWH23TdN5jTZMY/6v/zUV06CJiIYhCOxOIot5m8WOo xqEOxdmEt/2SSY6aDGxDHFyfs7BZVKu8DImiznBkA5vIzWrQpea8Zu+l/vDGl7XX ygj7bzdE53B2bZd6VGe/CETMv92pIi+8aPxo4uenQlDqZhPoQb78u18ffSYTQkKc 9+4KCiJgVjEqe8hk+9Qhe3qB//TN80sk2JQfGSgeQIJFpO+2l3KZEGDlt7M8T2NM tBjrnDpyobpCDrxVbU9VhlTsk/bJ+pCk14yfSuHHQCNzxDya6M1vwfSKiSUed+CO k5SehsrvXP8N/vv1dQb/bgL3a2D77tGCvtJQ9zdST3hM6Pn1z0ZtbJ71MkGeQ/Wb 4DrpJSG6m6ShFtsw0E6kv26TsuwanMh42ZTTd6nQswnds/p2yHor4pZzNGaCJNeI WgTW25w1u6VBsipvRRtybCUBRAH0FkupO4zHfQIP/BU20Z5Zpc72XaDofsrzgIXr kCwJzVD4JiI78KCuZz17wDBzIfSmV5NOZQNNisguvRgYnXe4S+Rsn/Hw= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P0Zg-1L48HuQ for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:37 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 6D0EDAB6 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:37 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 95AE7323; Wed, 21 Jul 2021 03:01:36 +0200 (CEST) Date: Tue, 20 Jul 2021 22:00:41 -0300 Message-Id: <20210721010043.632012-7-bauermann@kolabnow.com> In-Reply-To: <20210721010043.632012-1-bauermann@kolabnow.com> References: <20210721010043.632012-1-bauermann@kolabnow.com> 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" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches X-Patchwork-Original-From: Thiago Jung Bauermann via Guix-patches via From: Thiago Jung Bauermann X-getmail-retrieved-from-mailbox: Patches ‘install-grub-efi-netboot’ calls ‘nix-system->gnu-triplet’ on ‘%current-target-system’, but that parameter already contains a GNU triplet identifier. There’s no bug in practice because ‘install-grub-efi-netboot’ only uses the arch part of the identifier, which is the same for both. Nevertheless, it’s best to fix the confusion. Therefore, define a ‘current-target-gnu-triplet’ procedure which returns the GNU triplet identifier for the current target – whether we are cross-building or not – and use it in ‘install-grub-efi-netboot’. Also take the opportunity to use the new procedure in packages ‘gcc-4.7’, ‘rust-1.19’ and ‘mplayer’, which have the same logic as the new procedure. * gnu/bootloader/grub.scm (install-grub-efi-netboot): Use ‘current-target-gnu-triplet’. * gnu/packages/gcc.scm (gcc-4.7)[configure-flags]: Likewise. * gnu/packages/rust.scm (rust-1.19)[arguments]<#:phases>: Likewise. * gnu/packages/video.scm (mplayer)[arguments]<#:phases>: Likewise. * guix/utils.scm (current-target-gnu-triplet): Define new procedure. --- gnu/bootloader/grub.scm | 5 +---- gnu/packages/gcc.scm | 5 +---- gnu/packages/rust.scm | 4 +--- gnu/packages/video.scm | 4 +--- guix/utils.scm | 7 +++++++ 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index ce146aba3c60..fe82a3c1e9ed 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -610,10 +610,7 @@ fi~%")))) (define (install-grub-efi-netboot subdir) "Define a grub-efi-netboot bootloader installer for installation in SUBDIR, which is usually efi/Guix or efi/boot." - (let* ((system (string-split (nix-system->gnu-triplet - (or (%current-target-system) - (%current-system))) - #\-)) + (let* ((system (string-split (current-target-gnu-triplet) #\-)) (arch (first system)) (boot-efi-link (match system ;; These are the supportend systems and the names diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 2fe30b13210e..4adcb5fc0d69 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -138,10 +138,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC "--without-headers"))) ;; Pass the right options for the target triplet. - (let ((triplet - (or (%current-target-system) - (nix-system->gnu-triplet (%current-system))))) - (gcc-configure-flags-for-triplet triplet)) + (gcc-configure-flags-for-triplet (current-target-gnu-triplet)) (maybe-target-tools)))))) (hidden-package diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 73f94a3929bd..c8bb4d158711 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -402,9 +402,7 @@ test = { path = \"../libtest\" } (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) - (target-system ,(or (%current-target-system) - (nix-system->gnu-triplet - (%current-system)))) + (target-system ,(current-target-gnu-triplet)) (out-libs (string-append out "/lib/rustlib/" target-system "/lib"))) ;(setenv "CFG_PREFIX" out) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 6cf8b90ffa95..375e2297b889 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -2032,9 +2032,7 @@ streaming protocols.") '("--target=mips3-linux")) (_ (list (string-append "--target=" - (or (%current-target-system) - (nix-system->gnu-triplet - (%current-system))))))) + (current-target-gnu-triplet))))) "--disable-iwmmxt"))))))) (home-page "https://www.mplayerhq.hu") (synopsis "Audio and video player") diff --git a/guix/utils.scm b/guix/utils.scm index 4072dea89051..61da05137186 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -78,6 +78,7 @@ %current-system %current-target-system current-target-nix-system + current-target-gnu-triplet package-name->name+version target-mingw? target-arm32? @@ -527,6 +528,12 @@ cross-building or not." (or (and=> (%current-target-system) gnu-triplet->nix-system) (%current-system))) +(define (current-target-gnu-triplet) + "Return the GNU triplet identifier for the current target, whether we are +cross-building or not." + (or (%current-target-system) + (nix-system->gnu-triplet (%current-system)))) + (define* (package-name->name+version spec #:optional (delimiter #\@)) "Given SPEC, a package name like \"foo@0.9.1b\", return two values: \"foo\"