From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cIsnGUFQkWCWCQEAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 15:46:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kNPDFEFQkWCgfgAAB5/wlQ (envelope-from ) for ; Tue, 04 May 2021 13:46:41 +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 D116A13643 for ; Tue, 4 May 2021 15:46:40 +0200 (CEST) Received: from localhost ([::1]:45424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvNn-0005SV-U9 for larch@yhetil.org; Tue, 04 May 2021 09:46:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldvIM-0003FM-3U for guix-patches@gnu.org; Tue, 04 May 2021 09:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldvIL-0006T3-TW for guix-patches@gnu.org; Tue, 04 May 2021 09:41:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldvIL-0007t7-RR for guix-patches@gnu.org; Tue, 04 May 2021 09:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48224] [PATCH 1/2] gnu: guix: Avoid Bash wrapper. References: <20210504132542.10540-1-ludo@gnu.org> In-Reply-To: <20210504132542.10540-1-ludo@gnu.org> Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 May 2021 13:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48224 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48224@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 48224-submit@debbugs.gnu.org id=B48224.162013561730296 (code B ref 48224); Tue, 04 May 2021 13:41:01 +0000 Received: (at 48224) by debbugs.gnu.org; 4 May 2021 13:40:17 +0000 Received: from localhost ([127.0.0.1]:53289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvHc-0007sa-WB for submit@debbugs.gnu.org; Tue, 04 May 2021 09:40:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvHa-0007sI-MA for 48224@debbugs.gnu.org; Tue, 04 May 2021 09:40:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51834) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvHV-0005ph-F0; Tue, 04 May 2021 09:40:09 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59102 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldvHU-0006JJ-Cg; Tue, 04 May 2021 09:40:09 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 4 May 2021 15:39:57 +0200 Message-Id: <20210504133958.11011-1-ludo@gnu.org> X-Mailer: git-send-email 2.31.1 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620136001; h=from:from:sender:sender: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; bh=EOrJM7OPb3u4qjGGXGnyerhjIQAVsibZSj6bWAD2vQY=; b=KIdTpA6htL7+64J5Af34GxO7U5j8AKHjtaJdjnYpcmX8MUWRoEQqJ1Vg0tRF+XVHc+DY1V xbr4GmSH0/z5Cb6bhcsMxxDo6sTsbd2HXrXRbog8N6IXm1XrWHkzuHRDHZZLuMWVONNmmA nJSLng0ne+j7vQtgNK5kKdpRgEMZ3/xS1taNaKv9fW7KCFiefkZR4NWsl5gZkwbyGzrSgP 6Hmsm98NpD6F6PYPQSf2Af6UMHeTj22RJ19L8UwoPwpGM5M9yNpkhzmYJGfwmxHA1XaAih ib/aZuHS7w5U9Gt2LiJCP1wozRz2ck7ypPHH4giYhuEgjRT+bFmJwWFDbcUl+Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620136001; a=rsa-sha256; cv=none; b=UPgN5tAwHkinXIckhM1+iLNincGEGnR46hhfspsHpU4OGTUttUvKesjbvHbD/97YHET+r6 Ygv+1IltmspsNo9vWPxW0rgAsydV1hqhkkZUldk11Lcncdmfuw565l4oOsTuigyjMTf9dp gHr9mj1JBDiGi8RCJ50Y10scaR15X9eJ2FrPKjg04tOoAuoztEc/cnh96rGFJez//xcnkn 6ZX1Xt7Sp2rbfEX1DeZYCeorSVykyalPOlmOrSVd/DshY3hcr6wItkLPEb+NrwTzvPbVIH L0GmEiIULLtXLAf8kdOc+evzRtsmhAOLb+zY8Ewly5EOg4mYkhjXg+iWPlCofw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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-Spam-Score: -1.96 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: D116A13643 X-Spam-Score: -1.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: x3S1iDmdf2E1 The Bash wrapper created by 'wrap-program' creates an extra indirection and may annoyingly emit locale warnings: /gnu/store/…-bash-minimal-5.0.16/bin/bash: warning: setlocale: LC_ALL: cannot change locale (wtf) This warning would typically show up when running Guix, as produced by 'guix pack guix', on a foreign distro, annihilating efforts made in 1d4ab335b22a93e01c2eb1eb3e93fc6534157040 and 8a973abc6f7eebfcd8a904bfbb99cb9f86f66ef0. * gnu/packages/package-management.scm (guix)[arguments]: In 'wrap-program' phase, remove 'string-join' call for PATH and GOPATH. Replace 'wrap-program' call with a 'substitute*' form. Remove (when target ...) form. [inputs]: Remove "bash-minimal" added in commit 38b9af7c92344a17b6680ebd2aeea14171f84a1c and no longer needed. --- gnu/packages/package-management.scm | 56 ++++++++++++++++------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 827166c938..1a637f9ec8 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -326,31 +326,38 @@ $(prefix)/etc/openrc\n"))) (open-pipe* OPEN_READ (string-append guile "/bin/guile") "-c" "(display (effective-version))"))) - (path (string-join - (map (cut string-append <> - "/share/guile/site/" - effective) - (delete #f deps*)) - ":")) - (gopath (string-join - (map (cut string-append <> - "/lib/guile/" effective - "/site-ccache") - (delete #f deps*)) - ":")) + (path (map (cut string-append <> + "/share/guile/site/" + effective) + (delete #f deps*))) + (gopath (map (cut string-append <> + "/lib/guile/" effective + "/site-ccache") + (delete #f deps*))) (locpath (string-append locales "/lib/locale"))) - (wrap-program (string-append out "/bin/guix") - `("GUILE_LOAD_PATH" ":" prefix (,path)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath)) - `("GUIX_LOCPATH" ":" suffix (,locpath))) - - (when target - ;; XXX Touching wrap-program rebuilds world - (let ((bash (assoc-ref inputs "bash"))) - (substitute* (string-append out "/bin/guix") - (("^#!.*/bash") (string-append "#! " bash "/bin/bash"))))) - #t))) + ;; Modify 'guix' directly instead of using + ;; 'wrap-command'. This avoids the indirection + ;; through Bash, which in turn avoids getting Bash's + ;; own locale warnings. + (substitute* (string-append out "/bin/guix") + (("!#") + (string-append + "!#\n\n" + (object->string + `(set! %load-path (append ',path %load-path))) + "\n" + (object->string + `(set! %load-compiled-path + (append ',gopath %load-compiled-path))) + "\n" + (object->string + `(let ((path (getenv "GUIX_LOCPATH"))) + (setenv "GUIX_LOCPATH" + (if path + (string-append path ":" ,locpath) + ,locpath)))) + "\n\n")))))) ;; The 'guix' executable has 'OUT/libexec/guix/guile' as ;; its shebang; that should remain unchanged, thus remove @@ -405,8 +412,7 @@ $(prefix)/etc/openrc\n"))) `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux"))) '()) ,@(if (%current-target-system) - `(("bash" ,bash-minimal) - ("xz" ,xz)) + `(("xz" ,xz)) '()) ;; Tests also rely on these bootstrap executables. -- 2.31.1