From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KJyCIiZy92B/AQEAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 03:02:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6DooHiZy92CjPgAAB5/wlQ (envelope-from ) for ; Wed, 21 Jul 2021 01:02:30 +0000 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 15D741BD7F for ; Wed, 21 Jul 2021 03:02:30 +0200 (CEST) Received: from localhost ([::1]:39936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m60d3-0008Jm-32 for larch@yhetil.org; Tue, 20 Jul 2021 21:02:29 -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 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" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626829350; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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:dkim-signature; bh=Vlj4F3reKETdde84MigstZ0dzVqKIDtClIBxGUO8mv8=; b=cNstdHTdZ0gFxb/5//b3guDC3zAludIKru19/Nk2i+ppYCkGyAuL9nCbAQOnZ7dMXgiQ3q BEUK8CDUT2x6fxEBuLBCpeDre8u+Op35I4VYxj4bOaDDmcNsNeSdxU1Tovyzabp/X3ubIa G2exfA8z/LBEN/6wViFnNfFCvLbPXrDZH5idwrbhs2LLyOJGcAA0IexD2aCYiK8fgjlrWI 3kGwaD0XsQfxxgNI7UADHGMJj4rTUnnAXG2+fnLR8T0NW07xzovDGEibF2+sKs7NBSgMUO xkX3EnczPpn6IJlZQt3v2mlQD4BLEHssLdTx05IctGBKACIsSB+BFf2otDzdBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626829350; a=rsa-sha256; cv=none; b=URjitDLYrdAO/KrIFmJuvEaO+eUxz/3C4y7/AS+NBLB8Lr0SGRig77Kf92hNCxNmfe0QL+ Hu1kuhF1rJIzAzGfZMY5ML6FlMpIJlpH8QBWOfKCvmfcJw247/ATAjZZCByPpG0H0utfn5 i8vV56I851PcSeTu1brkjU2XR7J+wk5zJPmR+e1JthGz+6CNcnhNUWMlC/kdg/AtUtsiwn 57nP0mwElD+gA+P8qI0rX896XEoVt/Wiqw8zeYicyPyn6prJVp3pCCLlFsF+yQhL46M5DM QgSjMjWS2U/pzWEVYz9fOeiX+xco62IO+k/y79duVSo5WdsLxdlbyqmx+a0iMw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=entsooVP; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=entsooVP; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 15D741BD7F X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: k7glnEv2yMkH ‘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\"