GNU bug report logs - #73416
[PATCH core-updates] build: Set $0 to basename of command in `wrap-program'.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Keywords: patch; Done: Ludovic Courtès <ludo@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug unarchived. Request was from Liam Hupfer <liam@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 73416-done <at> debbugs.gnu.org:


Received: (at 73416-done) by debbugs.gnu.org; 22 Mar 2025 22:35:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 18:35:46 2025
Received: from localhost ([127.0.0.1]:46127 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tw7RS-0004I5-4n
	for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 18:35:46 -0400
Received: from hera.aquilenet.fr ([185.233.100.1]:48278)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>)
 id 1tw7RK-0004Ge-7E; Sat, 22 Mar 2025 18:35:38 -0400
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 34888D73;
 Sat, 22 Mar 2025 23:35:31 +0100 (CET)
Authentication-Results: hera.aquilenet.fr;
	none
X-Virus-Scanned: Debian amavis at hera.aquilenet.fr
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP
 id FmM2WQsno7ns; Sat, 22 Mar 2025 23:35:30 +0100 (CET)
Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id 2933FC8E;
 Sat, 22 Mar 2025 23:35:29 +0100 (CET)
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: bug#73416: [PATCH core-updates] build: Set $0 to basename of
 command in `wrap-program'.
In-Reply-To: <361b71e6f846c6748ff0ec9ecf6c1379ac00f809.1726985178.git.maxim.cournoyer@HIDDEN>
 (Maxim Cournoyer's message of "Sun, 22 Sep 2024 15:06:18 +0900")
References: <361b71e6f846c6748ff0ec9ecf6c1379ac00f809.1726985178.git.maxim.cournoyer@HIDDEN>
Date: Sat, 22 Mar 2025 23:35:28 +0100
Message-ID: <87tt7k4rtb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Rspamd-Queue-Id: 34888D73
X-Spamd-Result: default: False [-1.60 / 15.00]; BAYES_HAM(-3.00)[99.99%];
 NEURAL_HAM(-3.00)[-1.000];
 FORGED_RECIPIENTS(2.00)[m:andreas@HIDDEN,s:andreas.enge@HIDDEN];
 SUSPICIOUS_RECIPS(1.50)[]; SUBJECT_HAS_CURRENCY(1.00)[];
 MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+];
 FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com];
 RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[];
 RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[];
 FREEMAIL_ENVRCPT(0.00)[gmail.com];
 TO_MATCH_ENVRCPT_SOME(0.00)[]; TAGGED_RCPT(0.00)[];
 MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]
X-Rspamd-Action: no action
X-Spamd-Bar: -
X-Rspamd-Server: hera
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 73416-done
Cc: 73416-done <at> debbugs.gnu.org, Andreas Enge <andreas@HIDDEN>,
 73405-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:

> * guix/build/utils.scm (wrap-program): Set the value of the -a option of
> `exec' in the wrapper to ${0##*/} instead of $0, to use its base name ins=
tead
> of the complete file name.
>
> Fixes: https://issues.guix.gnu.org/73405
> Change-Id: Iec5984d4d934c8df88a90ff653947f7d07413ae4

Applied to =E2=80=98core-packages-team=E2=80=99, thanks!

Ludo=E2=80=99.




Notification sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Ludovic Courtès <ludo@HIDDEN>:
You have taken responsibility. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Sep 2024 06:07:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 22 02:07:06 2024
Received: from localhost ([127.0.0.1]:40673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ssFkQ-0003ps-9b
	for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 02:07:06 -0400
Received: from lists.gnu.org ([209.51.188.17]:54716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1ssFkO-0003pi-DH
 for submit <at> debbugs.gnu.org; Sun, 22 Sep 2024 02:07:04 -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 <maxim.cournoyer@HIDDEN>)
 id 1ssFk2-0006OP-TT
 for guix-patches@HIDDEN; Sun, 22 Sep 2024 02:06:42 -0400
Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
 id 1ssFjz-0007ld-4a
 for guix-patches@HIDDEN; Sun, 22 Sep 2024 02:06:42 -0400
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-20551eeba95so29383845ad.2
 for <guix-patches@HIDDEN>; Sat, 21 Sep 2024 23:06:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1726985196; x=1727589996; darn=gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=P2Q2HxQsu6jegrtbXoqH9WFTbwjHYLujVby1Pg+Ot3s=;
 b=BzNYTbFzQf1HMue3NRLbYKFw6QlqDIqS0KLZrFKGgf24bG3Yqe4P6eHHH+vmxAUHWL
 vbaHkzQPwk2iH1Tup2WkVClevDTCb/axmUX1u17KX+UtsEaWDSkhbDN/6VcvT3aLRC33
 yfAgdHyLHtwRkMeBBcZe4gB5AZ0ESB6Hk9qvquaO+rDDjeAwykeBf8imUphgu5ELlpOK
 PcHvzanOOFz9Mu/N523di3Euu4avI7GF1JKl3LYkfQK9hs2M8jUDTla8PtvvQerxX8dn
 uYUl0fP1Tk78NTBlQFUiw+9l4oxmtVbo2QtPOLcY67a2kd0LGF+EOd/A+nwRfpZP6SD9
 axzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1726985196; x=1727589996;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=P2Q2HxQsu6jegrtbXoqH9WFTbwjHYLujVby1Pg+Ot3s=;
 b=DDs/uoeA6tXvy5uIm+3SC0LzrR6yBisDY8GfvrIFaOIFYYzozOvXjmSGIWePoVeHgQ
 e5HlN4CdX6/5Bs+GmbzVv8P0TWipfv/YN3mBejID2ipKkUcX0BGFIRXJH5khSgqDINnW
 Ozlxfe9ZFzxKp2hdFhhsw8qwVjzARfeU/K0b0U2Dr+KlN36K3k0B9u7Oa2Nl9W84Ou8Z
 Q3xU7Z0k2Ckx3jlMdxvv1Tvt6NKYvwhsEBrksM65ezBfyBaAPl6p0k33DFH1xX7siT0c
 XibG+CbBXZoapnA9A4MxoroBRCSSZYACi9H9JOWG6Bj+Q9HTJGt1svyIYd0/IpCEuOd7
 A8jQ==
X-Gm-Message-State: AOJu0YxB8lsC63FVuoq70BLdK2dDs0d26Xyvfujv/LaFTzqNzAdXIGuN
 19fxWIl6BSG3TtdkgmR6eWzllpBZhOpKfqScTMHPSlHVz7EP2A0wbmmMyA==
X-Google-Smtp-Source: AGHT+IHpVrITYXH+9kes1KdvxDONy3kvHNtk41Kkm+ipU0ibBljAlJjSBua6+8ni3PeNHSVM68S//A==
X-Received: by 2002:a17:902:fc50:b0:205:7b1f:cf6d with SMTP id
 d9443c01a7336-208d83ce35dmr135561265ad.30.1726985195894; 
 Sat, 21 Sep 2024 23:06:35 -0700 (PDT)
Received: from hurd.lan ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20794600fddsm116225365ad.82.2024.09.21.23.06.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 Sep 2024 23:06:34 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates] build: Set $0 to basename of command in
 `wrap-program'.
Date: Sun, 22 Sep 2024 15:06:18 +0900
Message-ID: <361b71e6f846c6748ff0ec9ecf6c1379ac00f809.1726985178.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
X-Debbugs-Cc: Andreas Enge <andreas@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::635;
 envelope-from=maxim.cournoyer@HIDDEN; helo=mail-pl1-x635.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

* guix/build/utils.scm (wrap-program): Set the value of the -a option of
`exec' in the wrapper to ${0##*/} instead of $0, to use its base name instead
of the complete file name.

Fixes: https://issues.guix.gnu.org/73405
Change-Id: Iec5984d4d934c8df88a90ff653947f7d07413ae4
---

 guix/build/utils.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 94714bf397..7003d8262f 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -1355,7 +1355,7 @@ (define* (wrap-program prog #:key (sh (which "bash")) #:rest vars)
   #!location/of/bin/bash
   export PATH=\"/gnu/.../bar/bin\"
   export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
-  exec -a $0 location/of/.foo-real \"$@\"
+  exec -a \"${0##*/}\" location/of/.foo-real \"$@\"
 
 This is useful for scripts that expect particular programs to be in $PATH, for
 programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
@@ -1432,7 +1432,7 @@ (define* (wrap-program prog #:key (sh (which "bash")) #:rest vars)
         (call-with-output-file prog-tmp
           (lambda (port)
             (format port
-                    "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
+                    "#!~a~%~a~%exec -a \"${0##*/}\" \"~a\" \"$@\"~%"
                     sh
                     (string-join (map export-variable vars/filtered) "\n")
                     (canonicalize-path wrapped-file))))

base-commit: 2c54c2db410ebdda8cd71716315e4ea4d31befbd
-- 
2.46.0





Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
New bug report received and forwarded. Copy sent to andreas@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to andreas@HIDDEN, ludo@HIDDEN, guix-patches@HIDDEN:
bug#73416; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 20 Jul 2025 02:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.