From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Tildesley Subject: bug#40039: 'wrap-script' introduces spurious argument Date: Sun, 22 Mar 2020 11:53:47 +1100 Message-ID: <2969f516-ca88-ffa6-dd65-f6a29682d42c@gmail.com> References: <87k13psl82.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43582) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFosN-0005wu-KB for bug-guix@gnu.org; Sat, 21 Mar 2020 20:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFosM-0000o3-H7 for bug-guix@gnu.org; Sat, 21 Mar 2020 20:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFosM-0000nt-E9 for bug-guix@gnu.org; Sat, 21 Mar 2020 20:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFosM-0002Zg-AL for bug-guix@gnu.org; Sat, 21 Mar 2020 20:54:02 -0400 In-Reply-To: <87k13psl82.fsf@inria.fr> Sender: "Debbugs-submit" Resent-Message-ID: Content-Language: en-US List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: 40039@debbugs.gnu.org It appears the repeated (car cl) results in the executable path getting sent to it's self as the first argument. I'm not sure how things managed to work up until now? I tested the following change and it fixed the one case I was using, but am not sure it is correct. why was the cons (car cl) there in the first place? diff --git a/guix/build/utils.scm b/guix/build/utils.scm index b8be73ead4..9610f39d71 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -946,7 +946,7 @@ FILE are kept unchanged."                                                    "patch-shebang: ~a: changing `~a' to `~a'~%"                                                    file (string-append interp " " arg1) bin)                                            (patch p bin rest)) -                                      (begin +                                      (begin                                          (format (current-error-port)                                                  "patch-shebang: ~a: changing `~a' to `~a'~%"                                                  file interp bin) @@ -1292,11 +1292,10 @@ not supported."                                                         (_ vars))))                                     `(let ((cl (command-line)))                                        (apply execl ,interpreter -                                             (car cl) -                                             (cons (car cl) -                                                   (append - ',(string-split args #\space) -                                                    cl)))))) +                                             (car cl) ;; The program. +                                             (append +                                              ',(string-tokenize args #\space) +                                              cl)))))                     (template (string-append prog ".XXXXXX"))                     (out      (mkstemp! template))                     (st       (stat prog))