unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40039: 'wrap-script' introduces spurious argument
@ 2020-03-12 14:26 Ludovic Courtès
  2020-03-22  0:53 ` Brendan Tildesley
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ludovic Courtès @ 2020-03-12 14:26 UTC (permalink / raw)
  To: bug-Guix

[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]

Hello,

I have a script that starts with:

--8<---------------cut here---------------start------------->8---
#!/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash
# 
--8<---------------cut here---------------end--------------->8---

When I call ‘wrap-script’ on it, it leads to:

--8<---------------cut here---------------start------------->8---
#!/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/bin/guile --no-auto-compile
#!#; Guix wrapper
#\-(begin (setenv "PATH" "/gnu/store/9kzrrccpzl6i1sfwb0drb00gi2gwk0x0-coreutils-8.31/bin"))
#\-(let ((cl (command-line))) (apply execl "/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash" (car cl) (cons (car cl) (append (quote ("")) cl))))
#!/gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash
# 
--8<---------------cut here---------------end--------------->8---

The expression (append '("") cl) is incorrect: the empty string
shouldn’t be added here.

I think one way to fix it is:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 786 bytes --]

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index b8be73ead4..f9698773c3 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -1295,7 +1295,8 @@ not supported."
                                              (car cl)
                                              (cons (car cl)
                                                    (append
-                                                    ',(string-split args #\space)
+                                                    ',(string-tokenize args
+                                                                       char-set:graphic)
                                                     cl))))))
                    (template (string-append prog ".XXXXXX"))
                    (out      (mkstemp! template))

[-- Attachment #3: Type: text/plain, Size: 12 bytes --]


Ludo’.

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-09 19:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 14:26 bug#40039: 'wrap-script' introduces spurious argument Ludovic Courtès
2020-03-22  0:53 ` Brendan Tildesley
2020-03-22 10:27   ` Ricardo Wurmus
2020-03-22 11:42     ` Brendan Tildesley
2020-09-13  2:35     ` Brendan Tildesley
2020-09-13 12:23       ` Ricardo Wurmus
2021-04-29 15:23 ` Brendan Tildesley via Bug reports for GNU Guix
2021-09-09 19:02 ` bug#40039: (No Subject) Attila Lendvai

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).