Subject: bug#19742: 'wrap-program' should really preserve argv[0]

From: [email-masked] (Ludovic Courtès)
Date: Sun, 01 Feb 2015 22:39:53 +0100

It should be enough, and more appropriate, to simply preserve argv[0] in
wrappers.

Ludo’.

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)