From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 01 18:31:56 2015 Received: (at submit) by debbugs.gnu.org; 1 Feb 2015 23:31:56 +0000 Received: from localhost ([127.0.0.1]:59886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YI3zg-0001O5-BF for submit@debbugs.gnu.org; Sun, 01 Feb 2015 18:31:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56022) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YI3ze-0001Nq-HL for submit@debbugs.gnu.org; Sun, 01 Feb 2015 18:31:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI3zQ-0006BP-9b for submit@debbugs.gnu.org; Sun, 01 Feb 2015 18:31:49 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zQ-0006BL-7h for submit@debbugs.gnu.org; Sun, 01 Feb 2015 18:31:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zJ-0006Y9-SN for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI3zJ-000671-6F for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:33 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zJ-00066x-2g for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:33 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:44743 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YI3zI-0000PC-KY for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:32 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: bug-guix@gnu.org Subject: 'wrap-program' should really preserve argv[0] Date: Sun, 01 Feb 2015 22:39:53 +0100 Message-ID: <877fw1e2fq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Pluvi=C3=B4se?= an 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It should be enough, and more appropriate, to simply preserve argv[0] in wrappers. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 4407f9a..ebe70a3 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -870,8 +870,7 @@ the previous wrapper." (with-output-to-file prog-tmp (lambda () (format #t - "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%" - (which "bash") + "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%" (string-join (map export-variable vars) "\n") (canonicalize-path prog) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 16 09:26:40 2015 Received: (at 19742-done) by debbugs.gnu.org; 16 Feb 2015 14:26:40 +0000 Received: from localhost ([127.0.0.1]:45243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNMdD-0001RG-9M for submit@debbugs.gnu.org; Mon, 16 Feb 2015 09:26:39 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:56639) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNMdA-0001R1-6H for 19742-done@debbugs.gnu.org; Mon, 16 Feb 2015 09:26:37 -0500 Received: from debian.math.u-bordeaux1.fr ([147.210.21.57]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MaaYD-1Y7c8C3bib-00K4rW; Mon, 16 Feb 2015 15:26:29 +0100 Date: Mon, 16 Feb 2015 15:26:28 +0100 From: Andreas Enge To: 19742-done@debbugs.gnu.org Subject: Close Message-ID: <20150216142628.GA21619@debian.math.u-bordeaux1.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:AqDJ2es5SnRI2RHG9Ze1q/seS5FL0QIA1Nqm29fidCnlNFvcKSf 3m+YKiy20LxePxlNhH+XiOycMjJ8UyQJmCCFg3pTdNmUO0bCV2TyALVOv2vOWyueuSKdMf8 V5xxV80J/AkjbmRQCWjOLJ11dGfobj25L2ST+PDto6RcON97nxLyfqBb9/CYyCvh5SxGcFm SlIBfaiCfwzUDiJBzot0w== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19742-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Applied in commit b01f89675d03202851a00c38d4995424bbb1879f. Andreas From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 23 14:43:18 2015 Received: (at 19742) by debbugs.gnu.org; 23 Feb 2015 19:43:18 +0000 Received: from localhost ([127.0.0.1]:55850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPyuT-0005me-Kr for submit@debbugs.gnu.org; Mon, 23 Feb 2015 14:43:17 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:46733 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YPyuQ-0005mU-QV for 19742@debbugs.gnu.org; Mon, 23 Feb 2015 14:43:15 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:34751 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YPyuP-0005Ew-OU; Mon, 23 Feb 2015 14:43:14 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Andreas Enge Subject: Re: bug#19742: 'wrap-program' should really preserve argv[0] In-Reply-To: <20150215163907.GA6404@debian> (Andreas Enge's message of "Sun, 15 Feb 2015 17:39:07 +0100") References: <877fw1e2fq.fsf@gnu.org> <20150215163907.GA6404@debian> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 =?utf-8?Q?Vent=C3=B4se?= an 223 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 23 Feb 2015 20:42:58 +0100 Message-ID: <878ufo5s8t.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19742 Cc: 19742@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Andreas Enge skribis: > * guix/build/utils.scm (wrap-program): Create scripts that use $0 (which = is > usually just the base name) instead of the absolute path to the origi= nal > program. Alternative implementation of 2ed11b3. > > Co-authored-by: Ludovic Court=C3=A8s > > Closes . > --- > guix/build/utils.scm | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/guix/build/utils.scm b/guix/build/utils.scm > index c7fdd1d..a3446cb 100644 > --- a/guix/build/utils.scm > +++ b/guix/build/utils.scm > @@ -816,7 +816,7 @@ contents: > #!location/of/bin/bash > export PATH=3D\"/gnu/.../bar/bin\" > export CERT_PATH=3D\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/= certs\" > - exec -a location/of/foo location/of/.foo-real \"$@\" > + exec -a $0 location/of/.foo-real \"$@\" >=20=20 > This is useful for scripts that expect particular programs to be in $PAT= H, for > programs that expect particular shared libraries to be in $LD_LIBRARY_PA= TH, or > @@ -870,11 +870,10 @@ the previous wrapper." > (with-output-to-file prog-tmp > (lambda () > (format #t > - "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%" > + "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%" > (which "bash") > (string-join (map export-variable vars) > "\n") > - (canonicalize-path prog) Indeed, it=E2=80=99s better this way. Please apply to =E2=80=98core-update= s=E2=80=99 if not already done. Thanks, Ludo=E2=80=99. From unknown Sun Aug 17 01:00:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 24 Mar 2015 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator