From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 02 15:45:08 2018 Received: (at submit) by debbugs.gnu.org; 2 Jan 2018 20:45:09 +0000 Received: from localhost ([127.0.0.1]:33515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWTQl-00078p-G6 for submit@debbugs.gnu.org; Tue, 02 Jan 2018 15:45:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWTQj-000784-4K for submit@debbugs.gnu.org; Tue, 02 Jan 2018 15:45:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWTQc-0005FN-RE for submit@debbugs.gnu.org; Tue, 02 Jan 2018 15:44:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWTQc-0005FF-NW for submit@debbugs.gnu.org; Tue, 02 Jan 2018 15:44:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWTQZ-0001FO-FZ for guix-patches@gnu.org; Tue, 02 Jan 2018 15:44:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWTQV-0005C7-Cl for guix-patches@gnu.org; Tue, 02 Jan 2018 15:44:51 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWTQV-0005Bl-4D for guix-patches@gnu.org; Tue, 02 Jan 2018 15:44:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1514925879; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Cc:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; l=3895; bh=C58YzEZHqqwJSFrk+d/9KKnYxnbCpcUNkAI/Ful/EJU=; b=LOBB+d6dUtOUIDqYwrKgZpYfVneWjsd0pxwYb/PoRu9/qp26+3/yQjrNd+X1g9Qm gq3kiJ4OpyxOsrkzaVaipCiue8uOmPO6ntf/qQ9QYzxLMhb7UXxA+86ZHAAkHET3Pj5 puo2gBP5q1l/WzjXXh7Ld9D0dVnW4VZrspEvOcC4= Received: from localhost (port-92-200-194-49.dynamic.qsc.de [92.200.194.49]) by mx.zohomail.com with SMTPS id 1514925879695415.46803452792415; Tue, 2 Jan 2018 12:44:39 -0800 (PST) From: Ricardo Wurmus To: guix-patches@gnu.org Subject: [PATCH] WIP guix: Add wrap-script. Date: Tue, 2 Jan 2018 21:44:34 +0100 X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID: <20180102204434.2716-1-rekado@elephly.net> X-ZohoMailClient: External X-ZohoMail: Z_26063301 SPT_1 Z_26062608 SPT_0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Ricardo Wurmus , h.goebel@crazy-compilers.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -4.0 (----) * guix/build/utils.scm (wrap-script): New procedure. --- guix/build/utils.scm | 101 +++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 101 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 7391307c8..a2efcb31c 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -3,6 +3,7 @@ ;;; Copyright =C2=A9 2013 Andreas Enge ;;; Copyright =C2=A9 2013 Nikita Karetnikov ;;; Copyright =C2=A9 2015 Mark H Weaver +;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -84,6 +85,7 @@ fold-port-matches remove-store-references wrap-program + wrap-script invoke =20 locale-category->string)) @@ -1068,6 +1070,105 @@ with definitions for VARS." (chmod prog-tmp #o755) (rename-file prog-tmp prog)))) =20 +(define wrap-script + (let ((interpreter-regex + (make-regexp + (string-append "^#! ?(/bin/sh|/gnu/store/[^/]+/bin/(" + (string-join '("python[^ ]*" + "Rscript" + "perl" + "ruby" + "bash" + "sh") "|") + ") ?.*)"))) + (coding-line-regex + (make-regexp + ".*#.*coding[=3D:][[:space:]]*([-[a-zA-Z_0-9].]+)"))) + (lambda* (prog #:rest vars) + "Wrap the script PROG such that VARS are set first. The format of V= ARS +is the same as in the WRAP-PROGRAM procedure. This procedure differs from +WRAP-PROGRAM in that it does not create a separate shell script. Instead, +PROG is modified directly by prepending a Guile script, which is interpret= ed +as a comment in the script's language. + +Special encoding comments as supported by Python are recreated on the seco= nd +line. + +Note that this procedure can only be used once per file as Guile scripts a= re +not supported." + (define update-env + (match-lambda + ((var sep '=3D rest) + `(setenv ,var ,(string-join rest sep))) + ((var sep 'prefix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append ,(string-join rest sep) + ,sep current) + ,(string-join rest sep))))) + ((var sep 'suffix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append current ,sep + ,(string-join rest sep)) + ,(string-join rest sep))))) + ((var '=3D rest) + `(setenv ,var ,(string-join rest ":"))) + ((var 'prefix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append ,(string-join rest ":") + ":" current) + ,(string-join rest ":"))))) + ((var 'suffix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append current ":" + ,(string-join rest ":")) + ,(string-join rest ":"))))))) + (let-values (((interpreter coding-line) + (call-with-ascii-input-file prog + (lambda (p) + (values (false-if-exception + (and=3D> (regexp-exec interpreter-regex (= read-line p)) + (lambda (m) (match:substring m 1))= )) + (false-if-exception + (and=3D> (regexp-exec coding-line-regex (= read-line p)) + (lambda (m) (match:substring m 0))= ))))))) + (when interpreter + (let* ((header (format #f "\ +#!~a --no-auto-compile +#!#; ~a +#\\-~s +#\\-~s +" + (which "guile") + (or coding-line "Guix wrapper") + (cons 'begin (map update-env vars)) + `(apply execl ,interpreter + (car (command-line)) + (command-line)))) + (template (string-append prog ".XXXXXX")) + (out (mkstemp! template)) + (st (stat prog)) + (mode (stat:mode st))) + (with-throw-handler #t + (lambda () + (call-with-ascii-input-file prog + (lambda (p) + (format out header) + (dump-port p out) + (close out) + (chmod template mode) + (rename-file template prog) + (set-file-time prog st)))) + (lambda (key . args) + (format (current-error-port) + "wrap-script: ~a: error: ~a ~s~%" + prog key args) + (false-if-exception (delete-file template)) + #f)))))))) + =0C ;;; ;;; Locales. --=20 2.15.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 03 08:59:44 2018 Received: (at submit) by debbugs.gnu.org; 3 Jan 2018 13:59:44 +0000 Received: from localhost ([127.0.0.1]:33883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWja3-0007SO-QU for submit@debbugs.gnu.org; Wed, 03 Jan 2018 08:59:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWja2-0007SC-6y for submit@debbugs.gnu.org; Wed, 03 Jan 2018 08:59:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWjZw-0001tb-0K for submit@debbugs.gnu.org; Wed, 03 Jan 2018 08:59:36 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWjZv-0001tV-Sf for submit@debbugs.gnu.org; Wed, 03 Jan 2018 08:59:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWjZu-0002AZ-Rh for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWjZr-0001rB-QM for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:34 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:56446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWjZr-0001qO-JZ for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:31 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zBXc10SnVz1qrjS; Wed, 3 Jan 2018 14:59:28 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zBXc05v2Vz26T2W; Wed, 3 Jan 2018 14:59:28 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id TvadCGkKtVLA; Wed, 3 Jan 2018 14:59:28 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-212-114-230-52.dynamic.mnet-online.de [212.114.230.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 3 Jan 2018 14:59:28 +0100 (CET) Received: from [192.168.110.2] (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 8C9F8602E0; Wed, 3 Jan 2018 14:59:27 +0100 (CET) Subject: Re: [PATCH] WIP guix: Add wrap-script. To: Ricardo Wurmus , guix-patches@gnu.org References: <20180102204434.2716-1-rekado@elephly.net> From: Hartmut Goebel Organization: crazy-compilers.com Message-ID: <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> Date: Wed, 3 Jan 2018 14:59:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180102204434.2716-1-rekado@elephly.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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.18 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 (-----) This code is over-changeling my scheme knowledge :-) Thus just a few comments: > + (false-if-exception > + (and=> (regexp-exec coding-line-regex (read-line p)) > + (lambda (m) (match:substring m 0))))))))) When using emacs, this line can also contain other local variable definitions. What about keeping the whole line? > + (when interpreter > + (let* ((header (format #f "\ > +#!~a --no-auto-compile > +#!#; ~a > +#\\-~s > +#\\-~s > +" > + (which "guile") > + (or coding-line "Guix wrapper") > + (cons 'begin (map update-env vars)) > + `(apply execl ,interpreter > + (car (command-line)) > + (command-line)))) Does this take care of proper quoting the string-values? > + (call-with-ascii-input-file prog Does this work if the file contains non-ascii characters, e.g. \xf0 (assuming "ascii" means 0-127 only)? -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 05 03:19:29 2018 Received: (at 29951) by debbugs.gnu.org; 5 Jan 2018 08:19:30 +0000 Received: from localhost ([127.0.0.1]:36314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXNDt-0007gi-Ko for submit@debbugs.gnu.org; Fri, 05 Jan 2018 03:19:29 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21099) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXNDr-0007gX-KH for 29951@debbugs.gnu.org; Fri, 05 Jan 2018 03:19:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1515140343; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; l=3864; bh=f5/D8RMsnJBqHbEL0yVntI1DoG9wqFchd5ueDwOa+C4=; b=X9gmhJiXFhFluqhUWHoIKZorsinwz14nTp8VU8PV81mk//hl3clAqXl8gjaahjtP bB/4M7vAYZaxFmVt5FVDCJXsxBELOpkmRWHSBwqUuuLJHv2qAP0YtesQe/Fi8Prd4oz 82/Dh6B/m40ID1C/8IlnBRJy6mFuuIPKBsVoSZYs= Received: from localhost (port-92-200-114-22.dynamic.qsc.de [92.200.114.22]) by mx.zohomail.com with SMTPS id 1515140343614140.34013010982653; Fri, 5 Jan 2018 00:19:03 -0800 (PST) References: <20180102204434.2716-1-rekado@elephly.net> <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> User-agent: mu4e 1.0-alpha3; emacs 25.3.1 From: Ricardo Wurmus To: Hartmut Goebel Subject: Re: [PATCH] WIP guix: Add wrap-script. In-reply-to: <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Fri, 05 Jan 2018 09:19:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <87o9m84t2n.fsf@elephly.net> X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Hi Hartmut, >> + (false-if-exception >> + (and=3D> (regexp-exec coding-line-rege= x (read-line p)) >> + (lambda (m) (match:substring m = 0))))))))) > > When using emacs, this line can also contain other local variable > definitions. What about keeping the whole line? The purpose here was just to retain the coding comment, because it is interpreted by Python itself to set the file encoding. Other values are not used by Python to make any such decisions. Since these modified files are only generated in a build phase to modify the *execution* environment (and the unchanged files are available via =E2=80=9Cguix build -S=E2=80=9D), I think that it is reasonable to assume t= hat users won=E2=80=99t be interested in editing these files directly, so hints to th= e editor don=E2=80=99t need to be preserved. I find it a little cleaner to keep this coding-line preservation as restricted as possible, but maybe you are right and it would be safer to just copy the whole line when the coding regex matches. >> + (when interpreter >> + (let* ((header (format #f "\ >> +#!~a --no-auto-compile >> +#!#; ~a >> +#\\-~s >> +#\\-~s >> +" >> + (which "guile") >> + (or coding-line "Guix wrapper") >> + (cons 'begin (map update-env vars)) >> + `(apply execl ,interpreter >> + (car (command-line)) >> + (command-line)))) > > Does this take care of proper quoting the string-values? What string values do you refer to? We first generate an S-expression (where we don=E2=80=99t need to take care of escaping things anyway) and th= en format it as a string (with =E2=80=9Cformat=E2=80=9D and the =E2=80=9C~s=E2= =80=9D format string), and then we print that S-expression-as-a-string into a file. I ran this on an actual Python file in the store. This is the original file, which I copied to =E2=80=9C/tmp/test-python=E2=80=9D: --8<---------------cut here---------------start------------->8--- #!/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3/bin/python3.5 import sys from lib2to3.main import main sys.exit(main("lib2to3.fixes")) --8<---------------cut here---------------end--------------->8--- This is the code in the REPL: --8<---------------cut here---------------start------------->8--- ,use (guix build utils) scheme@(guile-user)> (wrap-script "/tmp/test-python" '("PYTHONPATH" ":" prefix ("/foo/bar:what= ever")) '("FOOBAR" ":" suffix ("/to/me"))) scheme@(guile-user)> --8<---------------cut here---------------end--------------->8--- This is the result in =E2=80=9C/tmp/test-python=E2=80=9D: --8<---------------cut here---------------start------------->8--- #!/home/rekado/.guix-profile/bin/guile --no-auto-compile #!#; Guix wrapper #\-(begin (let ((current (getenv "PYTHONPATH"))) (setenv "PYTHONPATH" (if c= urrent (string-append "/foo/bar:whatever" ":" current) "/foo/bar:whatever")= )) (let ((current (getenv "FOOBAR"))) (setenv "FOOBAR" (if current (string-= append current ":" "/to/me") "/to/me")))) #\-(apply execl "/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3/b= in/python3.5" (car (command-line)) (command-line)) #!/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3/bin/python3.5 import sys from lib2to3.main import main sys.exit(main("lib2to3.fixes")) --8<---------------cut here---------------end--------------->8--- > >> + (call-with-ascii-input-file prog > > Does this work if the file contains non-ascii characters, e.g. \xf0 > (assuming "ascii" means 0-127 only)? =E2=80=9Ccall-with-ascii-input-file=E2=80=9D opens the file as a binary, so= it reads the file as a series of bytes. This seems fine when reading only the shebang (which is ASCII only) and when trying to match the coding regex on the second line. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 05 05:06:40 2018 Received: (at 29951) by debbugs.gnu.org; 5 Jan 2018 10:06:40 +0000 Received: from localhost ([127.0.0.1]:36360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXOtc-0001zM-6O for submit@debbugs.gnu.org; Fri, 05 Jan 2018 05:06:40 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:47853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXOta-0001zE-Jc for 29951@debbugs.gnu.org; Fri, 05 Jan 2018 05:06:39 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zCgLP33R6z1qtGF; Fri, 5 Jan 2018 11:06:37 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zCgLP21tLz1qsvp; Fri, 5 Jan 2018 11:06:37 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id doRVi3L7z0f1; Fri, 5 Jan 2018 11:06:36 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-83-171-156-105.dynamic.mnet-online.de [83.171.156.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Fri, 5 Jan 2018 11:06:36 +0100 (CET) Received: from [192.168.110.2] (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 497856002B; Fri, 5 Jan 2018 11:06:36 +0100 (CET) Subject: Re: [PATCH] WIP guix: Add wrap-script. To: Ricardo Wurmus References: <20180102204434.2716-1-rekado@elephly.net> <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> <87o9m84t2n.fsf@elephly.net> From: Hartmut Goebel Organization: crazy-compilers.com Message-ID: <0b4f18c5-ff7d-f03f-e6c7-1866e28099e3@crazy-compilers.com> Date: Fri, 5 Jan 2018 11:06:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <87o9m84t2n.fsf@elephly.net> Content-Type: multipart/alternative; boundary="------------37E86838AE7EDC0F9EB64E90" Content-Language: en-US X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 29951 Cc: 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.7 (/) This is a multi-part message in MIME format. --------------37E86838AE7EDC0F9EB64E90 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Am 05.01.2018 um 09:19 schrieb Ricardo Wurmus: Thanks for your reply. >> Does this take care of proper quoting the string-values? > What string values do you refer to? We first generate an S-expression > (where we don’t need to take care of escaping things anyway) and then > format it as a string (with “format” and the “~s” format string), and > then we print that S-expression-as-a-string into a file. I mean the values of the environment variables to be set, whcih might contain double-quotes or backslashes. But I understand that these values are calculated within guile anyway and ~s takes care of proper quoting. So this is fine. Thanks for elaborating. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | --------------37E86838AE7EDC0F9EB64E90 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Am 05.01.2018 um 09:19 schrieb Ricardo Wurmus:

Thanks for your reply.

Does this take care of proper quoting the string-values?
What string values do you refer to?  We first generate an S-expression
(where we don’t need to take care of escaping things anyway) and then
format it as a string (with “format” and the “~s” format string), and
then we print that S-expression-as-a-string into a file.

I mean the values of the environment variables to be set, whcih might contain double-quotes or backslashes.

But I understand that these values are calculated within guile anyway and ~s takes care of proper quoting. So this is fine. Thanks for elaborating.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
--------------37E86838AE7EDC0F9EB64E90-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 12 17:52:20 2018 Received: (at 29951) by debbugs.gnu.org; 12 Jan 2018 22:52:20 +0000 Received: from localhost ([127.0.0.1]:54278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea8BP-0006eG-Qy for submit@debbugs.gnu.org; Fri, 12 Jan 2018 17:52:20 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:44964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ea8BO-0006e8-4C for 29951@debbugs.gnu.org; Fri, 12 Jan 2018 17:52:18 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 1809B10A22; Fri, 12 Jan 2018 23:52:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDjc6FMHiQ5Z; Fri, 12 Jan 2018 23:52:16 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A40A610880; Fri, 12 Jan 2018 23:52:15 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Ricardo Wurmus Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. References: <20180102204434.2716-1-rekado@elephly.net> Date: Fri, 12 Jan 2018 23:52:14 +0100 In-Reply-To: <20180102204434.2716-1-rekado@elephly.net> (Ricardo Wurmus's message of "Tue, 2 Jan 2018 21:44:34 +0100") Message-ID: <87373ar8pt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29951 Cc: h.goebel@crazy-compilers.com, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: 1.0 (+) Hi! Ricardo Wurmus skribis: > * guix/build/utils.scm (wrap-script): New procedure. [...] > +(define wrap-script > + (let ((interpreter-regex > + (make-regexp > + (string-append "^#! ?(/bin/sh|/gnu/store/[^/]+/bin/(" > + (string-join '("python[^ ]*" > + "Rscript" > + "perl" > + "ruby" > + "bash" > + "sh") "|") > + ") ?.*)"))) > + (coding-line-regex > + (make-regexp > + ".*#.*coding[=3D:][[:space:]]*([-[a-zA-Z_0-9].]+)"))) > + (lambda* (prog #:rest vars) > + "Wrap the script PROG such that VARS are set first. The format of= VARS > +is the same as in the WRAP-PROGRAM procedure. This procedure differs fr= om > +WRAP-PROGRAM in that it does not create a separate shell script. Instea= d, > +PROG is modified directly by prepending a Guile script, which is interpr= eted > +as a comment in the script's language. > + > +Special encoding comments as supported by Python are recreated on the se= cond > +line. > + > +Note that this procedure can only be used once per file as Guile scripts= are > +not supported." Nice! > + (let-values (((interpreter coding-line) > + (call-with-ascii-input-file prog > + (lambda (p) > + (values (false-if-exception > + (and=3D> (regexp-exec interpreter-regex= (read-line p)) > + (lambda (m) (match:substring m 1= )))) > + (false-if-exception > + (and=3D> (regexp-exec coding-line-regex= (read-line p)) > + (lambda (m) (match:substring m 0= ))))))))) =E2=80=98false-if-exception=E2=80=99 is problematic because it can hide err= ors. Could you narrow that down to the exception type of interest? Or is there a risk of random decoding errors and the likes when passed a binary file? > + (when interpreter Should it return #t on success and #f on failure? Or just thrown an exception on failure? > + (which "guile") Let=E2=80=99s add #:guile defaulting to (which "guile"). I wonder if =E2=80=98wrap-program=E2=80=99 could automatically call =E2=80= =98wrap-script=E2=80=99 when appropriate so that users don=E2=80=99t have to choose by themselves. WDYT? Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 14 16:59:28 2018 Received: (at control) by debbugs.gnu.org; 14 Jan 2018 21:59:28 +0000 Received: from localhost ([127.0.0.1]:56397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaqJM-0000Sv-9u for submit@debbugs.gnu.org; Sun, 14 Jan 2018 16:59:28 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:33920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaqJK-0000Si-Me for control@debbugs.gnu.org; Sun, 14 Jan 2018 16:59:26 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 2E55E10234 for ; Sun, 14 Jan 2018 22:59:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BVsSksxehMSp for ; Sun, 14 Jan 2018 22:59:25 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7935AFB5E for ; Sun, 14 Jan 2018 22:59:25 +0100 (CET) Date: Sun, 14 Jan 2018 22:59:24 +0100 Message-Id: <87d12cje4j.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #29951 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: 1.0 (+) severity 29951 important From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 02:26:42 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 06:26:43 +0000 Received: from localhost ([127.0.0.1]:38144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl74M-0004Ui-NP for submit@debbugs.gnu.org; Thu, 02 Aug 2018 02:26:42 -0400 Received: from mail-pl0-f48.google.com ([209.85.160.48]:37874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl74K-0004UT-Vc for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 02:26:41 -0400 Received: by mail-pl0-f48.google.com with SMTP id d5-v6so551956pll.4 for <29951@debbugs.gnu.org>; Wed, 01 Aug 2018 23:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6UxHOUb/xt70cuLL/EY0r8qk0fKDSCO06R7NxXtdruQ=; b=o6SQmt1fUeo0j9xa8/3+He/ra4pYKz3MFQIPLsJhajmSYstM1FsH99vWRQL5AyEz28 7mvl9TrwYZNx5OhILXsUnMPjqt3vIh8Ftgz4Qe+pPqx36ybGo58xJLZfVug5IgX1YyKp luN6VgKMWfkhzB/0JW84c3N8GnkDnxpXAI8ia7ZXIDNJydXBVxTH8jGiFrv7JZiWFpez UvnvaWrWFQFMbfOgTzKvG2p+Hba9POfwGKCGun3tNpJOrf0fH9xthd34HNMD/PDqZwrb mfGJgky1h8TBvuoyMwZc7SD4ZfEiK21HEDe750TzEmdmonOFSf3Dr/9hsRlE4pI+yCrf urJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6UxHOUb/xt70cuLL/EY0r8qk0fKDSCO06R7NxXtdruQ=; b=XUYJcv/ORwZsAQz0P6Rj73gABUF1JIdy7N2UDvl7qgzOqzrvnGBDlQiFiBT6x4BEJ9 XzvYmpT3wX6fqGCYdxW7meirWX2oF15PX1t8VZq7c+Lzf4jOZj8QhXXaZyXQNFduk6Kx EIRXI1+rZk60WBvzz5nrdZ/7rLThq+xRWzJU+kAwrzelS1OUxo4PbDWpxgROJzIQ+CFD w6oSW5HGQjguNnQV27mpnPhydtmBy5LDpBAgMXgfq4oG1eK3GyXMft8EwuxZwcSgwdtl WIy6KcpciEQRlYiSMjgcmqayb+G1hh++tF4OyiyyJdKbeacJ222G6foIoEB21xCyVzww MrFw== X-Gm-Message-State: AOUpUlGfb4axugHsp8yaRBWYe69OXhyA6HCEfyZAGJ4ZwN0v4Uw4FVsX r+0GZH/rUd8iTpDT1oMR48fJapUY X-Google-Smtp-Source: AAOMgpdvil6iDSbe40Yvoefg6HgYCYr35xAVqNyYoswOtxQ0ndQS/J0GdIzGV1g6yPt0DpzrgJ6/UA== X-Received: by 2002:a17:902:e18d:: with SMTP id cd13-v6mr1173513plb.305.1533191194193; Wed, 01 Aug 2018 23:26:34 -0700 (PDT) Received: from garuda.local (c-24-18-253-84.hsd1.wa.comcast.net. [24.18.253.84]) by smtp.gmail.com with ESMTPSA id c142-v6sm1210401pfb.62.2018.08.01.23.26.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 23:26:32 -0700 (PDT) From: Chris Marusich To: Ricardo Wurmus Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. References: <20180102204434.2716-1-rekado@elephly.net> <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> <87o9m84t2n.fsf@elephly.net> Date: Wed, 01 Aug 2018 23:26:20 -0700 In-Reply-To: <87o9m84t2n.fsf@elephly.net> (Ricardo Wurmus's message of "Fri, 05 Jan 2018 09:19:00 +0100") Message-ID: <87sh3xcmib.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: Hartmut Goebel , 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ricardo Wurmus writes: > This is the result in =E2=80=9C/tmp/test-python=E2=80=9D: > > #!/home/rekado/.guix-profile/bin/guile --no-auto-compile > #!#; Guix wrapper > #\-(begin (let ((current (getenv "PYTHONPATH"))) (setenv "PYTHONPATH" (if= current (string-append "/foo/bar:whatever" ":" current) "/foo/bar:whatever= "))) (let ((current (getenv "FOOBAR"))) (setenv "FOOBAR" (if current (strin= g-append current ":" "/to/me") "/to/me")))) > #\-(apply execl "/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3= /bin/python3.5" (car (command-line)) (command-line)) > #!/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3/bin/python3.5 > import sys > from lib2to3.main import main > > sys.exit(main("lib2to3.fixes")) I understand that the part beginning with #! and ending with !# are a block comment in scheme, so they will be ignored by Guile, and that "Guix wrapper" shows up after a ;, so it will also be considered a comment by Guile, but I don't understand why the lines following that need to begin with #\-. I also don't understand why Guile doesn't complain about it. Why do the lines begin with #\-? =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAltipAwACgkQ3UCaFdgi Rp2ruxAArb+xtJfkF5amVlQQCwGGkwgJOrZWSNL7KSkXISrDWNWQ6+JEIQJWYnj8 SBVArYEGwW9uk1Psw6UxEJ9grAwMpTCPbjTMSuNb5YdVczqVakTsD0zAskqpdGtr m7Ig+SF6t8sqCwfDF9yY1pM+quYlU49kwj/KnEaMakJczM1CvD8CHhV9YA9QvBfe ERCAYzam2xItlUHOWG7lTtpSCv7KCvFxYMEtiVDTKLeW3Gv3EM1vzBtLRmjqIJLS lvH4/MJy9VttiPfx+zm+Dlt6dfXscZj78e5sm9U8PtbfAhHAYmhmSRmTo3Gm4gGr CCgeMhEXaETHVkpDi4A7D5mD/3oj7ar749o8OWN5an2+VlL21k7Yy4+qoatO1Z6v M0l0bwDsrUKCYXB4bI/gdCkccs19gn7Hub/pP6LozXyyIcYkacTvrhO24QHOrQsz AwI1bPlj916jVyXWxAuvg3WGqiuO0XwCi3orxWRGsycMvEkJrrFfsvrvm3Xvni+H sMSu6KmDKirEH+QZCuROWXP2Bz229L9yHebODLRXzeiYtRJsciOglLEIvAg9h2s/ GsVrfkt17J77UDlo+V7bfIlTpzJBrFFe0tONW+Lch+PPCoVymJnjgPNY9lpJCddC a34wwxtNxI/2dJYGKjbHH0HWvyd8M2AWMAPC8d/fqDVj1UTBDEs= =eN44 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 03:23:50 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 07:23:50 +0000 Received: from localhost ([127.0.0.1]:38208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl7xa-0005va-Pm for submit@debbugs.gnu.org; Thu, 02 Aug 2018 03:23:47 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl7xX-0005vQ-U3 for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 03:23:44 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1533194602; cv=none; d=zoho.com; s=zohoarc; b=KD5SPjzI8igyoF2hK1XqodU301+ektoYtwKRIj3LHDLvEDRNLmJVmSsgUA5gVp/p8OZsj3BzQ1+8rW/5Ui4JtmiwIx3742ZODaV06es2yfwAtJ1+R+GXDFUtOQdLmqbYwmG2wvznvEbRqDbNwdb9V95i6jxRoaV49l38PhXfjlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1533194602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=G6iEXbQyBDnHAPcIuN51+/cC+/qrZtNLkkFH2TKWbjg=; b=iDPZMERVLlXblc1NqebyvCeKA6G6XpAZED9X2VpZxg9BsjHz2mxQtqUcLiDR9gugJ8GAaRCLWKQ+mv89oRZKIzOovIVUnBoEMgl4tNspEQC2+S6aef4VO8CneUnZfmv7p/zoiy7VhevcyZGl/uPhQA2IHIjAicEhpLoM48eVK2I= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1533194602; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=3044; bh=G6iEXbQyBDnHAPcIuN51+/cC+/qrZtNLkkFH2TKWbjg=; b=BqfDRtjQd+esJel+hanEC1nz1UhT3jrAxXKjovqmXkxXNsB4gHYyfLhFJfIII1Er anp4SG1GoLpquLVDBanWD3yGSJoWZGwl1QVMT3I+P0RvOzF1ivWV/XkbrskXAtijPWu AGjJzfRg+1rJG+5XYonSokvMii0RsmPwMjAS8jt8= ARC-Seal: i=1; a=rsa-sha256; t=1533194599; cv=none; d=zoho.com; s=zohoarc; b=PIiIKPykxSm8Ac/RyPwrC9oEe7Ygom/QrTEEwJXd3f579c5bJD9/Qo5C4Fm6rWoiMJapVKeAqR9nMK+6p0YV+xD8NEOZR3M4MJhzoZ3p+QG5HFBk6Sy/2u2oMRzqZ66fA1x8UnEGrpWwzC0KWI7U2Tfc9w6LdPgJXRxQHs7dnqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1533194599; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=G6iEXbQyBDnHAPcIuN51+/cC+/qrZtNLkkFH2TKWbjg=; b=bShYN+zANw4L/pq6IwRQEMaxLljVdqI02D1bfYpCFm4vXZ/b0ck06THUADxyq9TXDO17VwRXiFROuOy5tcqhZYhoRIM6J4xSOe9LhwD2cHpxfZWsqHeh9JrrTrMchUfeLe2hggf664FnDdu+/o2hidYVsWtL3XuIYN7ntURjk0E= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1533194599; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=3044; bh=G6iEXbQyBDnHAPcIuN51+/cC+/qrZtNLkkFH2TKWbjg=; b=N67Q33nejxNIK/P5TkXctrdpMF9rt8XCnglx/5fqBgU8H0WvIRu/TX2SvmUfulVf QUPbg9GvGDMoD6HZTZKgCkDzyUzedofjLHnOuN0XQcXjZS4Bj8r/MkYaNeuA+NaaaB5 vFJiE7lAhoJquYfPt6FYUK73RA+XuF6vwOLMn3E4= Received: from localhost (port-92-200-1-34.dynamic.qsc.de [92.200.1.34]) by mx.zohomail.com with SMTPS id 1533194599676782.0032143253128; Thu, 2 Aug 2018 00:23:19 -0700 (PDT) References: <20180102204434.2716-1-rekado@elephly.net> <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> <87o9m84t2n.fsf@elephly.net> <87sh3xcmib.fsf@gmail.com> User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: Chris Marusich Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. In-reply-to: <87sh3xcmib.fsf@gmail.com> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 02 Aug 2018 09:23:16 +0200 Message-ID: <87600ts04b.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: Hartmut Goebel , 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Hi Chris, > Ricardo Wurmus writes: > >> This is the result in =E2=80=9C/tmp/test-python=E2=80=9D: >> >> #!/home/rekado/.guix-profile/bin/guile --no-auto-compile >> #!#; Guix wrapper >> #\-(begin (let ((current (getenv "PYTHONPATH"))) (setenv "PYTHONPATH" (i= f current (string-append "/foo/bar:whatever" ":" current) "/foo/bar:whateve= r"))) (let ((current (getenv "FOOBAR"))) (setenv "FOOBAR" (if current (stri= ng-append current ":" "/to/me") "/to/me")))) >> #\-(apply execl "/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.= 3/bin/python3.5" (car (command-line)) (command-line)) >> #!/gnu/store/iyy9w0hcxv4dg9q92d4g023vvz50r5bq-python-3.5.3/bin/python3.5 >> import sys >> from lib2to3.main import main >> >> sys.exit(main("lib2to3.fixes")) > > I understand that the part beginning with #! and ending with !# are a > block comment in scheme, so they will be ignored by Guile, and that > "Guix wrapper" shows up after a ;, so it will also be considered a > comment by Guile, but I don't understand why the lines following that > need to begin with #\-. I also don't understand why Guile doesn't > complain about it. Why do the lines begin with #\-? #\- is Guile syntax for the character =E2=80=9C-=E2=80=9D. To ensure that = the target language ignores these lines they must start with =E2=80=9C#=E2=80=9D. In = Guile, however, we cannot just use =E2=80=9C#=E2=80=9D on its own. The =E2=80=9C#= =E2=80=9D in Guile is the start of a reader macro. We don=E2=80=99t really want a reader macro at the beginning of each line, though =E2=80=93 we just want to move on and get to= the expression. So we use =E2=80=9C#\-=E2=80=9D, which evaluates to the character =E2=80=9C= -=E2=80=9D. It is valid in Scheme to write code that evaluates to something and then ignore that value. Here=E2=80=99s an example: 10 23 #\a #\b 5 (display "hello") Guile would evaluate the numbers and characters one after the other, and none of them would have any effect on the final expression that displays =E2=80=9Chello=E2=80=9D. In the wrapper we do the same kind of thing. This line: #\-(begin (let =E2=80=A6) =E2=80=A6) is really just two Scheme values: a single arbitrary character and the S-expression that we care about. We only care about the side-effects of evaluating the S-expression. A language that uses =E2=80=9C#=E2=80=9D to mark comments, on the other han= d, would simply ignore the whole line. The result is that we can use Guile to set environment variables and then hand over execution to the target language interpreter, which would run in the new environment. The advantage of this approach is: we don=E2=80=99t have to rename wrapped scripts any more (=E2=80=9C.foo-real=E2=80=9D), which makes for prettier us= age messages (=E2=80=9CUsage: foo -v=E2=80=9D instead of =E2=80=9CUsage: .foo-real -v=E2= =80=9D) and avoids problems when an application checks its own name to determine what actions it should take. -- Ricardo From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 04:18:20 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 08:18:20 +0000 Received: from localhost ([127.0.0.1]:38227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl8oO-0007Mv-75 for submit@debbugs.gnu.org; Thu, 02 Aug 2018 04:18:20 -0400 Received: from mail1.fsfe.org ([217.69.89.151]:42128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl8oL-0007Mm-Lp for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 04:18:18 -0400 Received: by mail-oi0-f52.google.com with SMTP id m11-v6so2482487oic.2 for <29951@debbugs.gnu.org>; Thu, 02 Aug 2018 01:18:15 -0700 (PDT) X-Gm-Message-State: AOUpUlEYC5egVlE28EzCDMt+yuy9Bs3pC7SINmMVQoICwpkdno851Rhm 3TmIQg9ZyEDzqUM7/elEI1hrvM94MYUfqcrDd5Y= X-Google-Smtp-Source: AAOMgpeMp/D/0WhSn1wtkuaWrPyoSQVATphSpbjeB+i4QF8AMr/fpN1Rh6WX6+GM/5fw2e/mRD5Ugbj19ADaztp9mEg= X-Received: by 2002:aca:d5cd:: with SMTP id m196-v6mr1654487oig.160.1533197893809; Thu, 02 Aug 2018 01:18:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:5ec1:0:0:0:0:0 with HTTP; Thu, 2 Aug 2018 01:18:13 -0700 (PDT) In-Reply-To: <20180102204434.2716-1-rekado@elephly.net> References: <20180102204434.2716-1-rekado@elephly.net> From: Jelle Licht Date: Thu, 2 Aug 2018 10:18:13 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. To: Ricardo Wurmus Content-Type: multipart/alternative; boundary="000000000000d4c6a105726f733d" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 29951 Cc: h.goebel@crazy-compilers.com, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.7 (-) --000000000000d4c6a105726f733d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2018-01-02 21:44 GMT+01:00 Ricardo Wurmus : > * guix/build/utils.scm (wrap-script): New procedure. > --- > guix/build/utils.scm | 101 ++++++++++++++++++++++++++++++ > +++++++++++++++++++++ > 1 file changed, 101 insertions(+) > > diff --git a/guix/build/utils.scm b/guix/build/utils.scm > index 7391307c8..a2efcb31c 100644 > --- a/guix/build/utils.scm > +++ b/guix/build/utils.scm > @@ -3,6 +3,7 @@ > ;;; Copyright =C2=A9 2013 Andreas Enge > ;;; Copyright =C2=A9 2013 Nikita Karetnikov > ;;; Copyright =C2=A9 2015 Mark H Weaver > +;;; Copyright =C2=A9 2018 Ricardo Wurmus > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -84,6 +85,7 @@ > fold-port-matches > remove-store-references > wrap-program > + wrap-script > invoke > > locale-category->string)) > @@ -1068,6 +1070,105 @@ with definitions for VARS." > (chmod prog-tmp #o755) > [...] > (rename-file prog-tmp prog)))) > > +(define wrap-script > + (let ((interpreter-regex > + (make-regexp > + (string-append "^#! ?(/bin/sh|/gnu/store/[^/]+/bin/(" > Won't this be an issue for people using a customized store location? [snipped] > --000000000000d4c6a105726f733d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2018-01-02 21:44 GMT+01:00 Ricardo Wurmus <rekado@elephly.net>= :
* guix/build/utils.scm (wrap-scr= ipt): New procedure.
---
=C2=A0guix/build/utils.scm | 101 +++++++++++++++++++++++++++++++++++++= ++++++++++++++
=C2=A01 file changed, 101 insertions(+)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 7391307c8..a2efcb31c 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -3,6 +3,7 @@
=C2=A0;;; Copyright =C2=A9 2013 Andreas Enge <andreas@enge.fr>
=C2=A0;;; Copyright =C2=A9 2013 Nikita Karetnikov <nikita@karetnikov.org>
=C2=A0;;; Copyright =C2=A9 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright =C2=A9 2018 Ricardo Wurmus <rekado@elephly.net>
=C2=A0;;;
=C2=A0;;; This file is part of GNU Guix.
=C2=A0;;;
@@ -84,6 +85,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fold-port-matches
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0remove-store-references
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wrap-program
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 wrap-script
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0invoke

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0locale-category->string)= )
@@ -1068,6 +1070,105 @@ with definitions for VARS."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(chmod prog-tmp #o755)
=C2=A0 =C2=A0
[...]
=C2=A0 =C2=A0 =C2=A0(rename-file prog-tmp prog))))

+(define wrap-script
+=C2=A0 (let ((interpreter-regex
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(make-regexp
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-append "^#! ?(/bin/sh|/gnu= /store/[^/]+/bin/("
=C2=A0
Won'= ;t this be an issue for people using a customized store location?

<= /div>
[snipped]

=C2=A0
--000000000000d4c6a105726f733d-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 04:38:02 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 08:38:02 +0000 Received: from localhost ([127.0.0.1]:38236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl97S-0007pw-8e for submit@debbugs.gnu.org; Thu, 02 Aug 2018 04:38:02 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:36963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl97P-0007pS-Vt for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 04:38:00 -0400 Received: by mail-pf1-f181.google.com with SMTP id a26-v6so896524pfo.4 for <29951@debbugs.gnu.org>; Thu, 02 Aug 2018 01:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zLeBjRFUf+LZRclCfRrb26AknTHc6cPnCI1aL6unrgw=; b=tZPj9RVvS8G/GYEcheETNkXgMk9o8XxgT7ms24znFm7eizRHgXfMADGiD75OsqeCul kj0uVf0PIQh7hpQo7E/O+V0bKtAsF3jGV4nPWGhZxLp8Z49bRfS5wujwBMLVCw5RzDYM t6ustycKKCKKFswq13bJssKFQRt0iv/ZB89otr65P2/3QUviUJYXx7CczTPUrbuh5hNf tXlQdUKb314eNHJyO8DMvEs/vndtjrIsuhR5pSKskV890aCKW3fgFHX/WtM4HBYmy5do A32i3lo/q1UGGmfE33l3ly2p0EFb2OlKo96OlKK+PXM533SpUfEh5NLtdJQGyTTrxLLe 1fGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zLeBjRFUf+LZRclCfRrb26AknTHc6cPnCI1aL6unrgw=; b=Oeu3QSDCFKL5FHW7zH9DMZtqi9tC4786jqjyr/IHhsov1hfirowbkBg2gWLwSR8EAb 6oPAVBRRIT5CAuEvlng5Myb5j1sp8yP5GaMRAzZko9rNRGG5ihDTQdXJ4AQr8Lk+Lu32 KHmP22Lvy+FqfTWtRKaf3PFcxWgLyQ6edatxxXz2pdm0aHoxDBmenweWAxOText+2Sd6 YJm3Ddw53rcmEKR9xACjnNGM0Tun07GEESrQGYZ5RbJC3B02715Ld1ZiP+8dDCbevQ74 epVzzNUwBEYFqhRiwa8D0ETy+QsASQgSVAiex+pobCyiwSAG7etEh2b51m6aDiD2WrtP ZKJA== X-Gm-Message-State: AOUpUlHC8grAGUry4+3GeSjJX+zq+Y128MWiX/6f32oFxcWucEDJGc5B 05CT13ivAgwtYtDGjI/Y/1+FwbezkVg= X-Google-Smtp-Source: AAOMgpdk/94NmqsTdTl7BIF2Le/aDW9nQQ1pmewk9mMIZ4ptPr/Vm3O9+CmVbYaX9ok5z2e55g0S4A== X-Received: by 2002:a62:5290:: with SMTP id g138-v6mr1983084pfb.46.1533199073828; Thu, 02 Aug 2018 01:37:53 -0700 (PDT) Received: from garuda.local (c-24-18-253-84.hsd1.wa.comcast.net. [24.18.253.84]) by smtp.gmail.com with ESMTPSA id g28-v6sm2241346pfe.41.2018.08.02.01.37.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Aug 2018 01:37:52 -0700 (PDT) From: Chris Marusich To: Ricardo Wurmus Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. References: <20180102204434.2716-1-rekado@elephly.net> <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> <87o9m84t2n.fsf@elephly.net> <87sh3xcmib.fsf@gmail.com> <87600ts04b.fsf@elephly.net> Date: Thu, 02 Aug 2018 01:37:51 -0700 In-Reply-To: <87600ts04b.fsf@elephly.net> (Ricardo Wurmus's message of "Thu, 02 Aug 2018 09:23:16 +0200") Message-ID: <87y3dpb1uo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: Hartmut Goebel , 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ricardo, Thank you for taking the time to explain it! Ricardo Wurmus writes: > [...] This line: > > #\-(begin (let =E2=80=A6) =E2=80=A6) > > is really just two Scheme values: a single arbitrary character and the > S-expression that we care about. We only care about the side-effects of > evaluating the S-expression. I understand now. We're reading the hyphen symbol, and not doing anything with it. Got it! > The advantage of this approach is: we don=E2=80=99t have to rename wrapped > scripts any more (=E2=80=9C.foo-real=E2=80=9D), which makes for prettier = usage messages > (=E2=80=9CUsage: foo -v=E2=80=9D instead of =E2=80=9CUsage: .foo-real -v= =E2=80=9D) and avoids problems > when an application checks its own name to determine what actions it > should take. Sounds great! =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAltiwt8ACgkQ3UCaFdgi Rp1tRg//evUOIouFt5oLR9joAfp953f/PZv4GovdueN4Hq6BoVFAH52ggSJw9G0O u0g9IKcrtWqiYa5ao1RqROPLqTqca3i1TgBUY0tsc67AammqCg9ntC4Kuku4Lb+4 B9bczuVOiVSJBQuNMejaefC4Nc1skkkPtZFQqN8nkPvfVXzcYK+4ei0vMUb1U8hz zR2TNQNI9zSjoym/psfKjqpKAyDBw7ZhbsIqJ6Zltd1qKd7deGthrE8GKySW+ze1 4G4E4HF8pkQ/owtKIHxwhcC84YjekoaanFK2DC06AGJ1mZBtHBs6vkRZay1ldggV lr/U/+VzeuugB0yLgV33mtL+cjHdUyZmetTHqr7iBxYZDiIcQx70/pAUWUjZqe3I KobgZfz6HKGke6CLiaVqdOvtQjVfDGfmwgmsFcSfMuT11Gzy/XxcMVPpxdzpomw3 QCMKC+Xy9rtnIyqXo9/lPEBOFUFCs2Ant+b/xC35YvK9aHbSTdGgqXu7baWJMxkm cC4J60zp4I6ybT5RBwD/HlF6BMIVCrbUW78fh0mCjJKNNIoeL5XA0Zwtequ3a92r nLhqAZ4PNncqaonu81/iyJKz9a6u+wJBlrFvEa7qv83Xv8/1OZyg0BEi4+D/Opp+ sgxx90H9PAvCk7gANylyRiC9yvcj28BsvwZTZ0hW+D9j2eYWfAs= =lswz -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 05:22:16 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 09:22:16 +0000 Received: from localhost ([127.0.0.1]:38247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl9oF-0000Tl-3H for submit@debbugs.gnu.org; Thu, 02 Aug 2018 05:22:16 -0400 Received: from static.195.114.201.195.clients.your-server.de ([195.201.114.195]:33206 helo=conspiracy.of.n0.is) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl9oC-0000Tc-9w for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 05:22:13 -0400 Received: by conspiracy.of.n0.is (OpenSMTPD) with ESMTPSA id 208690f1 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 2 Aug 2018 09:22:10 +0000 (UTC) Date: Thu, 2 Aug 2018 09:22:55 +0000 From: Nils Gillmann To: Jelle Licht Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. Message-ID: <20180802092255.hmdu5p3a5y7wbm37@abyayala> References: <20180102204434.2716-1-rekado@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: Ricardo Wurmus , h.goebel@crazy-compilers.com, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Jelle Licht transcribed 4.1K bytes: > 2018-01-02 21:44 GMT+01:00 Ricardo Wurmus : > > > * guix/build/utils.scm (wrap-script): New procedure. > > --- > > guix/build/utils.scm | 101 ++++++++++++++++++++++++++++++ > > +++++++++++++++++++++ > > 1 file changed, 101 insertions(+) > > > > diff --git a/guix/build/utils.scm b/guix/build/utils.scm > > index 7391307c8..a2efcb31c 100644 > > --- a/guix/build/utils.scm > > +++ b/guix/build/utils.scm > > @@ -3,6 +3,7 @@ > > ;;; Copyright © 2013 Andreas Enge > > ;;; Copyright © 2013 Nikita Karetnikov > > ;;; Copyright © 2015 Mark H Weaver > > +;;; Copyright © 2018 Ricardo Wurmus > > ;;; > > ;;; This file is part of GNU Guix. > > ;;; > > @@ -84,6 +85,7 @@ > > fold-port-matches > > remove-store-references > > wrap-program > > + wrap-script > > invoke > > > > locale-category->string)) > > @@ -1068,6 +1070,105 @@ with definitions for VARS." > > (chmod prog-tmp #o755) > > > > [...] > > > (rename-file prog-tmp prog)))) > > > > +(define wrap-script > > + (let ((interpreter-regex > > + (make-regexp > > + (string-append "^#! ?(/bin/sh|/gnu/store/[^/]+/bin/(" > > > > Won't this be an issue for people using a customized store location? Can't we make this substitutable at configure time? > [snipped] > > From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 05:23:10 2018 Received: (at 29951) by debbugs.gnu.org; 2 Aug 2018 09:23:10 +0000 Received: from localhost ([127.0.0.1]:38251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl9p8-0000VV-KP for submit@debbugs.gnu.org; Thu, 02 Aug 2018 05:23:10 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fl9p6-0000VM-OW for 29951@debbugs.gnu.org; Thu, 02 Aug 2018 05:23:09 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1533199051; cv=none; d=zoho.com; s=zohoarc; b=Bbo0VeETP4JGJWRe9J31ztjxQC07GvJQqhFWQ8HnrDAFmXeEIQrTGcD0COuekRbKDzqRSC4TSq5xErAREA9WpCE3jJ+c+k6P9PeAb/wIJ0EjGKfKUYsvOmWrxscSoJ4hXwEjl2Yas55bdeRZMI7CbwkP9XkWFfDkwEV21qKg3WY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1533199051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=AsSVM6MZ9PaQLqTCYt0qgkAr28WcldfcglcGw0xhk6U=; b=BgckEEE/83mVnKsFjmwluy71Q2MTy3PV0gZJcTkM3j/83Gv92rxsobps8O9+YHZ046aNao7J70Fv5C59JAtIYH3Q7rTT52cXgZV9yBnyOPT4U5rtr5TCg5rfUSX5GSOEjC+XiOry9Z8R6QTpQr3tOQcfOqD9+hJEXVMAoZL+77A= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1533199051; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=495; bh=AsSVM6MZ9PaQLqTCYt0qgkAr28WcldfcglcGw0xhk6U=; b=dQsU5ot0RsVkcbMFKcNJt7s+9Ysd/2aE0GjDyIAYPD51V5IZIsCzCYly7z3sWxDU R0QAuqKM743+rBZEnfbu51VpFkAEQm6zb4azVmAN9jupeCHZZrFWgqGh1tHoZ8z6S/O LH/vDM3kH+s0domYGzyeXXEc4BGHecR16nGZggg0= ARC-Seal: i=1; a=rsa-sha256; t=1533199049; cv=none; d=zoho.com; s=zohoarc; b=YJ8PeIjnNyxu/pwaQu9/yQRV3zYOBy/0iz+BYljsU8Z8OiIP8ndo0pFO1onaT/LDYJNv68wR+5vmoAsUisNnJok4TWnowck1j0K5ooE82UtQ4pW3CfhD3ei0+W8E7+TAf8w8T3wBrWQaYLlCpiJnpqvUHfCLS2U6uw4we69QRqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1533199049; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=AsSVM6MZ9PaQLqTCYt0qgkAr28WcldfcglcGw0xhk6U=; b=OOGHpxQ2Z5TSKZIwuQGGzmsn8WxtznuNJyN4pU/1xCgCqjPM0CUYmVIFNdrWTNi1pfF0wXTw3ldQHlwOX8Z9KZthsSHXnuR5Dh8NQFpRoXEXMdA8JK/fPnk6TFdldqTn4ih9gYxTqDofU5RXqTRv5UvIMxMYxqi9ABvO5sZ3jsU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1533199049; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=495; bh=AsSVM6MZ9PaQLqTCYt0qgkAr28WcldfcglcGw0xhk6U=; b=XoBmlozeBh9FWJ3gDB89mg2CWCVjHvUIil5KA6W8oMfm/8XI1On+7Mylma0XhXBM VAQdYbxe5eBTCtWU8Y1WbXjr4yBZ+Yf1UxNGPq6jWKAc/nglRIPs4HUtmWcmJnZibOU mtTrgi0U0C+c0BAPDeSWIsOO0sfPEbaNKl8Gllxs= Received: from localhost (port-92-200-1-34.dynamic.qsc.de [92.200.1.34]) by mx.zohomail.com with SMTPS id 1533199049758847.7731787576512; Thu, 2 Aug 2018 01:37:29 -0700 (PDT) References: <20180102204434.2716-1-rekado@elephly.net> User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: Jelle Licht Subject: Re: [bug#29951] [PATCH] WIP guix: Add wrap-script. In-reply-to: X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 02 Aug 2018 10:37:26 +0200 Message-ID: <87o9elp3jt.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: h.goebel@crazy-compilers.com, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Jelle Licht writes: > 2018-01-02 21:44 GMT+01:00 Ricardo Wurmus : > >> * guix/build/utils.scm (wrap-script): New procedure. >> --- [=E2=80=A6] >> >> +(define wrap-script >> + (let ((interpreter-regex >> + (make-regexp >> + (string-append "^#! ?(/bin/sh|/gnu/store/[^/]+/bin/(" >> > > Won't this be an issue for people using a customized store location? Yes. I suppose we could change this to use the actual store prefix. -- Ricardo From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 02:50:31 2019 Received: (at 29951) by debbugs.gnu.org; 4 Feb 2019 07:50:32 +0000 Received: from localhost ([127.0.0.1]:58027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZ1T-0008KI-K3 for submit@debbugs.gnu.org; Mon, 04 Feb 2019 02:50:31 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZ1S-0008K7-F7 for 29951@debbugs.gnu.org; Mon, 04 Feb 2019 02:50:30 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549266618; cv=none; d=zoho.com; s=zohoarc; b=YzkmkbE7KcuvyYRolC9iTR5pDyvfzQZMzetDN1pIKh7HKwsRvsrg6dDVqiIZHP8Jb38ZRLkn7sfZeFOj3quIHv8SL+/Erw4rw04JdICVIZL4nLRpcfB1dC0U+UGqGqA9hhzTqbqw7LpRz3jy9jj/a5e90nw6FVW6W2x+3ZWV5VU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549266618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=ecF9GUUiJ8Adlg3Yxg9ozjW7shVEpFSB0GopsWkmqR0=; b=Ra+N2jXKlC/FyRhEmy5R6XSVaHv4dvQFr2K69EIrTGf+aGWiKL7tH26mSTrSN363yFe72upsD4GFbJj/t0yRFHMpl7gobK1H+vy/SDqy7HxgroXyciRUct6jT5DXl2QW5JykXDGCyylFCfkRbmIztg6TSLBqyc+85lELgbbDACs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549266618; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=744; bh=ecF9GUUiJ8Adlg3Yxg9ozjW7shVEpFSB0GopsWkmqR0=; b=FXlrG+EJyJMCro/yjkhJyxBpgQLIL2pKNcQ1oBLFOsnrg45cIFCNaOASZS3nBMby f6zgoK77+KwNrfGILa5gQINRUmZKQeVdswPPAgMw7KMkVxIlXWcbhcLDyUlCHKzOd2x IIhfeCyES8gwtIjMoFkXuVq/cm0HunIb6L+DNtj4= Received: from localhost (252.139-78-194.adsl-static.isp.belgacom.be [194.78.139.252]) by mx.zohomail.com with SMTPS id 1549266617453726.1610218359455; Sun, 3 Feb 2019 23:50:17 -0800 (PST) From: Ricardo Wurmus To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#26752: Ansible & others' problems with wrapped '.ansible-real' scripts References: <874lx2w926.fsf@gnu.org> <8760fnsv3u.fsf@gnu.org> Date: Mon, 04 Feb 2019 08:50:14 +0100 In-Reply-To: <8760fnsv3u.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 22 Jun 2017 21:03:33 +0200") Message-ID: <87tvhkhu15.fsf@elephly.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29951 Cc: Jelle Licht , 26752@debbugs.gnu.org, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Jelle Licht skribis: > >> The current ansible package is still brokenin the same way. >> >> Is there already an acceptable way of working around this problem? >> Otherwise I could send my (extremely hacky) workaround that adds a speci= fic >> condition in the ansible source code to check for .ansible-real. > > For now I think we have to go with the hack. Make sure to add a comment > linking to this bug report. There is a way to get around this. It=E2=80=99s presented in #29951: https://issues.guix.info/issue/29951 Open issues with this include a hard-coded store prefix, but it=E2=80=99s n= o big obstacle. Should we give this a try on core-updates? From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 03:03:09 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 08:03:09 +0000 Received: from localhost ([127.0.0.1]:58051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZDg-0002Ha-QL for submit@debbugs.gnu.org; Mon, 04 Feb 2019 03:03:08 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZDf-0002HQ-53 for control@debbugs.gnu.org; Mon, 04 Feb 2019 03:03:07 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549267384; cv=none; d=zoho.com; s=zohoarc; b=MV2BL+KV4xg38Fvd/I/9wZ5rFk+QiByNRdHWoh6OD3rSv2pkBztIfwr+EimaroPnw15pbuN/nwJalF4B/wTp0+3qfI2sIdz7nLSapeMcoHTpSExDQIrU2Okj5tiiRSx2npyyGPwSJhcuLgl1n2jA8EgMg6FUZJwsc0WteYKJPp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549267384; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=rI1In/T0mvA7M7z2gsNlm857IYGDPaBvRDe1zd26rFE=; b=PEp4fO+UST1KeBltvpuslBjIlvyu4Qhz00JXYF1ApTdtLPh8ss3xpRMjHd9O2R2fYMrSklzTUJ4NEFb+Wc98qgpTtUwa3fbbyp9ECAE4IXcGuJYdsD//2n55s6LrQAkmiMfhYke7Bp60EnTAD0AjdTf4bSmh5I6uCxpdQWHBADg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549267384; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=22; bh=rI1In/T0mvA7M7z2gsNlm857IYGDPaBvRDe1zd26rFE=; b=JxZ6qLx5rz32FRoXFE5Bp0c0nzpUANeJIWNCsZVtNl1mrPdEqXUlyUjUy9+y+SvU NsIh1sb5NCV7neTm7pM0YnZ9sTPFqJ1jx5xTUru+hMnSj6UKpPdhcXkLa79aCwbf9bI xupCIz+oHtYjdBp76OGyrMdZ3k+53iHOfqk3zeyA= Received: from localhost (252.139-78-194.adsl-static.isp.belgacom.be [194.78.139.252]) by mx.zohomail.com with SMTPS id 154926738350938.48180397164185; Mon, 4 Feb 2019 00:03:03 -0800 (PST) Date: Mon, 04 Feb 2019 09:03:01 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b78834d7.67d54665800973180.6444581326634091821@zoho.com> Subject: control message for bug #29951 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) block 29951 by 26752 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 03:50:28 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 08:50:28 +0000 Received: from localhost ([127.0.0.1]:58074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZxU-0005Qo-4e for submit@debbugs.gnu.org; Mon, 04 Feb 2019 03:50:28 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqZxR-0005Qe-Fu for control@debbugs.gnu.org; Mon, 04 Feb 2019 03:50:26 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549269285; cv=none; d=zoho.com; s=zohoarc; b=BQgKDIsUDK1oz/eD/kLzBRzEomO8gua575vUi3t0XXDsuNfuROQgMckoPabW8TTnjqdoL+QP9iB+Pxg/XDDIZeo0lwBd+hXMC40Y1/g+YUmSRBj0s0NsafVECa+UPT3UPDsO6vUkN/LJCRk2F0Xq2HshcGV7l9q8b3Qk9GekziI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549269285; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=Z0jNIG4pjlO9EFbBe3Qbm85Ff2MCUpN7ndpMK/ntF+c=; b=DVhlOzyFMRYh/JJvEPMfe5Syl/UBzGrNaLzSRU4aSPotqqOQESol6/d5VsIpza2qEra0tfiDczXp1wPVRjcrNn3ApyyInxNk+5xn2rnCXcj+trNwEtJWJ8U7/lZvv6k0UTbMOMDhoOsY85aEEtbqnpZ2xA5gpZvxbKW5cg3Vrs8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549269285; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=22; bh=Z0jNIG4pjlO9EFbBe3Qbm85Ff2MCUpN7ndpMK/ntF+c=; b=IplW66OroZE15qPk74kQ6rQpqQXKOzZpv2g4JY0KQLm40fZlTW7EFaAWRug/gFMM kXnfxpdif72GKvdnFHG01QoDTtLb/nRtv9QGvMST1pHjlTNyV6xBOQ6RTUiuBjHTV6u 4LCZH2I/Y/1arDALER+WIVlnHls+sJmFl/XSn7BE= Received: from localhost (252.139-78-194.adsl-static.isp.belgacom.be [194.78.139.252]) by mx.zohomail.com with SMTPS id 1549269283005300.16094860040675; Mon, 4 Feb 2019 00:34:43 -0800 (PST) Date: Mon, 04 Feb 2019 09:34:39 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b7a530bf.6c123492-1929141092.-7906724368339708670@zoho.com> Subject: control message for bug #29824 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) block 29824 by 29951 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 04:48:07 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 09:48:08 +0000 Received: from localhost ([127.0.0.1]:58096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqarH-0002U9-Lu for submit@debbugs.gnu.org; Mon, 04 Feb 2019 04:48:07 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqarE-0002Tx-OJ for control@debbugs.gnu.org; Mon, 04 Feb 2019 04:48:05 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549267333; cv=none; d=zoho.com; s=zohoarc; b=L9bvlYOVtsc+2U8HvSKvDA9Da6lk0bTQv8ZOUPu0xdLuKMHB5sKGrEqiP8mg86PaUNG6AGLUla9b8kSbdsmSD7+AflBWy4Kj4Npzmo0wOepr7oYWEe/co9s9Kfsmz/iJleetDjBGDxUpiUCRBAi4wHNRgmE8czCnVbhTvC6BSSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549267333; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=VKlAd6XbGyYklVKwLYX2d54ZY6J0AtP0pFD6ddCuJZE=; b=g0bZgiKHR71G35Y8scKUR3AUjswnUI5f+9z+w2WkGkPiJFhZg3Cks4IdHPaJ87JlQLsqq9yyEEPEuvRnk4n2QeawhESRunVi/2alSRrKJzU6kR7dV7LhgdNTKkCeHGmsror820bbAmfGf0Bw3SlPUJMW5r/y0tVGmGGMBKttX2k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549267333; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=22; bh=VKlAd6XbGyYklVKwLYX2d54ZY6J0AtP0pFD6ddCuJZE=; b=Kjq81vjzWpusT1dCs41wirF3l3SFRrvy5Qb4iA1yueXIqc9R8iGAsvBbquWoFFdy 38RRVB/ctiC3mKFJ/AJUBlxsadevomlO1LsHjays3sx1S+J25cMjU9Wd78ZO4tMdthR TLPTh8buXpsA7+3jhIkw6trU/6qEH1WTe72Uab5s= Received: from localhost (252.139-78-194.adsl-static.isp.belgacom.be [194.78.139.252]) by mx.zohomail.com with SMTPS id 1549267330241718.7236487118221; Mon, 4 Feb 2019 00:02:10 -0800 (PST) Date: Mon, 04 Feb 2019 09:02:07 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b78764c2.7307dec41255821358.-6686512393397758191@zoho.com> Subject: control message for bug #29951 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) block 29951 by 29824 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 05:31:00 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 10:31:00 +0000 Received: from localhost ([127.0.0.1]:58121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbWm-0005dl-Cc for submit@debbugs.gnu.org; Mon, 04 Feb 2019 05:31:00 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbWk-0005da-8H for control@debbugs.gnu.org; Mon, 04 Feb 2019 05:30:58 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549276239; cv=none; d=zoho.com; s=zohoarc; b=JHKNJAqPPH3fQfkSBqZk8RBCj1i8jr860sjvv1OjWOnD6WWMP/y6B7XLVdj5ul3tTOxre0EprplkURm8BrgWi3Dd28R9Xz38tyIhsIkAB+zCgs6OnAMD204j2W8M5P4ueI/i6uTZ+VB8joJJLOL9Wgg5j5equmbY0CLJujY/X9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549276239; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=vh3ExNTWehl1GK7sytHfQWv8RCIS11OTxwfv5Z1gPaw=; b=cqTaK9KKlEB6MgdvWKegQ5cajB3ma+gIkCaDFJ187DvLx41aA7i9VQCqrFsgr8+OzcFm6JSqYehZn9AlKS2OAXByecUB2x0edbv69+i0U3+rS0LlSQX/RDpq4+h6/E/Mp27bx8NOcBs/yEr1P/+xEU1cA4advwjKsRwTFaMi9i4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549276239; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=24; bh=vh3ExNTWehl1GK7sytHfQWv8RCIS11OTxwfv5Z1gPaw=; b=d2cj0d4HSvCetBX/XN73mgG6a0ptim5EIV16yltt81xGHEFgcAdz/mrJjmHB+YzW 4v8b3z5BY1dLv5A08ONIdPijPkKqGzbU6fejm1mbObAw8jJ2P4yCS9cx0S4v7bXAr7D Qfc+OjeJ+SlP5O0XTbA85O4989Thh7FAgkI5LySY= Received: from localhost (46.183.103.8 [46.183.103.8]) by mx.zohomail.com with SMTPS id 1549276237125803.199792989456; Mon, 4 Feb 2019 02:30:37 -0800 (PST) Date: Mon, 04 Feb 2019 11:29:39 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b80f4d46.4e38f3fb-540430156.7945528783842604060@zoho.com> Subject: control message for bug #29824 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) unblock 29824 by 29951 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 05:31:25 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 10:31:25 +0000 Received: from localhost ([127.0.0.1]:58126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbXB-0005fN-KG for submit@debbugs.gnu.org; Mon, 04 Feb 2019 05:31:25 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbXA-0005fE-7n for control@debbugs.gnu.org; Mon, 04 Feb 2019 05:31:24 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549276281; cv=none; d=zoho.com; s=zohoarc; b=jbakEqBgX/Zn5ECJJC2YVpRev3wcarJy4DCvSw50DY9KNTJmD98bmse8XmTLbDoU5Jb7261zKD5OpjuoPL7AFcCkiwV9CztG7q5fT8ZHZMQ2MjmnzZ1ggvoohBoPoQJewP/2b4yfHqCXIN/AlZ80CWdRHAuSki/Op0SLKcsbXcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549276281; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=BbnO+zfji3llq3o6HskponYngw/H4CE4GEq0w8l4kKg=; b=DcahnSkM+t4vcf9O2cswKDsxFG9LJFvknpJMjEd629PGZeBVd8NUd4Rk4DltLxN1VAxS5n6u5vLYXnTo0N20lI1pS8C/nJw3uHZp7RAXsp9HMTFBDg7p9Wa+f6NAhMgA8t3QPJKbjO04NxVWj2HpdqWd08Js0aw7LFvOCe9vD4g= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549276281; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=22; bh=BbnO+zfji3llq3o6HskponYngw/H4CE4GEq0w8l4kKg=; b=AHIuTgN7Jl07nwm8M29+RxL/2+ohEnjD0SvwX0El4WgcCh1rnOQawPPIAkjuAuzg nUHzdzwPMPXVfMTsXadAvAGpvTq5L7ftxddsX1ezQP0pMdt62WXmipv1qi57J5QV35n 6XgGg8sH7ve6wYo++yQ5noMrIro9FzI7XgY2xMsI= Received: from localhost (46.183.103.8 [46.183.103.8]) by mx.zohomail.com with SMTPS id 1549276280869519.501237908255; Mon, 4 Feb 2019 02:31:20 -0800 (PST) Date: Mon, 04 Feb 2019 11:31:06 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b80ff826.23c94323855229521.-827146741371564246@zoho.com> Subject: control message for bug #26752 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) block 26752 by 29951 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 05:32:01 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 10:32:01 +0000 Received: from localhost ([127.0.0.1]:58129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbXk-0005gd-TU for submit@debbugs.gnu.org; Mon, 04 Feb 2019 05:32:01 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbXi-0005gR-FP for control@debbugs.gnu.org; Mon, 04 Feb 2019 05:31:58 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549276317; cv=none; d=zoho.com; s=zohoarc; b=Y8ZwJloEO+4SVSDOzGOXGJ5Ue30UEVkhbpSpyA/etuP4UUCPa6ywxRhrs8/QiawFt86sVWkIgtXxo7w2rH8EKWScSFckON1EhSxPMDRXVnNNJb0n2IOwM3PvOnJPYC6Emx+dVVMXVzQDqVCr0jsIS2MYGZNqQJDPwaSwXy1cpfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549276317; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=MX2bVFyfK9IRikjAXgdacL5RVCBLpgZlfHVZ1CSuDOA=; b=Alf9tKNB1yU/hNq42r/bRNy8180EOnDomNmAvchkW6IIIBU6i0PhPtNidj4kDhsJVgkD45TumyaWoXgT/reTht67UW7WC8VJ2iJBKVJGBUmKWMR9CdctK3MJUINQhD/P90LqzNlUbX8lxLQwNoXrcAaElB5gHIXtDissy+Z6QZU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549276317; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=24; bh=MX2bVFyfK9IRikjAXgdacL5RVCBLpgZlfHVZ1CSuDOA=; b=irUafKQS6TyFWOe+Xgb7dA8rfTyI4n96PfEYCHGBiqltvhfDfEO/VfCbSqS65rdg hKiuiJYYZzyzPgfSeetBKpa/R0JqTrfi2FaLwFh3K9twtco/B07Y2WOc36T/K4nGwzM RdwWgcvFJ6ZUPCrqkoGL9j4O6Iy+m72GFvIOXZWI= Received: from localhost (46.183.103.8 [46.183.103.8]) by mx.zohomail.com with SMTPS id 1549276315382479.8716734292393; Mon, 4 Feb 2019 02:31:55 -0800 (PST) Date: Mon, 04 Feb 2019 11:31:51 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b8107ef7.213235a9311363538.-800503255172129691@zoho.com> Subject: control message for bug #29951 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) unblock 29951 by 29824 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 05:32:29 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 10:32:29 +0000 Received: from localhost ([127.0.0.1]:58136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbYD-0005iO-6J for submit@debbugs.gnu.org; Mon, 04 Feb 2019 05:32:29 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbYA-0005iC-Jx for control@debbugs.gnu.org; Mon, 04 Feb 2019 05:32:27 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549276344; cv=none; d=zoho.com; s=zohoarc; b=bXz3ZsXZOrOdWXvRs50WAI8kjHnOQdOr3xtZz3TGjPmSz14mmvmSQqpj+IbhZ6yCXVQiLGf2lUugpXn6mVP+VHSwZG9NMPssyU4BKV2x/ZsQkp8UBhpqdOBdshSgJk/LFJ9Z8FTv5UxJtUaiXW7kMq9c34zPUhv43G0gn7LATbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549276344; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=Lohgdg/BsVwAFHjibI8Ew2rdCeLdKcshLx9WyWok7ug=; b=ev45d1egOV2WsPfPq8dutUAdAQ+7zY8Ok+BK1VvkbYC+Ne6I5MPHpwqoN5l3sP9zWAzzbt6lxnvftA8xtOnbx9eZYwCbNyueEum2uY6AGVI/Xwu3R1zvS7PIEV+jq4xzBU48ZaAYVS5/oFr82DiG7JT4O5Gs7OPpUwPvjwNFWQU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549276344; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=24; bh=Lohgdg/BsVwAFHjibI8Ew2rdCeLdKcshLx9WyWok7ug=; b=MPpxup1r9yVivNryVpqg9WTlt+mbC0q3+MCmUN2mdsz1T3lN552+YQTwYw7K0mjy 2mC9WZgh3n3lR/UibtFR7q2//i4V4EbJ3/gos0nhqya9WdabVE0uHgez3UisWoIaEOb u1Xy51bRttDO7FW3z7rTQZPZC/tHbQgXI1kO2okE= Received: from localhost (46.183.103.8 [46.183.103.8]) by mx.zohomail.com with SMTPS id 1549276343025975.3297827651221; Mon, 4 Feb 2019 02:32:23 -0800 (PST) Date: Mon, 04 Feb 2019 11:32:10 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b810eaf2.6b84c6c5-1274999762.-8695646092044213478@zoho.com> Subject: control message for bug #29951 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) unblock 29951 by 26752 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 05:33:14 2019 Received: (at control) by debbugs.gnu.org; 4 Feb 2019 10:33:14 +0000 Received: from localhost ([127.0.0.1]:58145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbYw-0005ky-M6 for submit@debbugs.gnu.org; Mon, 04 Feb 2019 05:33:14 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqbYu-0005ko-RL for control@debbugs.gnu.org; Mon, 04 Feb 2019 05:33:13 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549276305; cv=none; d=zoho.com; s=zohoarc; b=F76WYeB+xCYMSXZx9MNAO0gULXwVaY+m9qdHYWbr9iGyE8a9hsusfZwdj0x/crR1LV/FBcxJ9tyaoRZtqBh1NRKJYfzE3P76R3qLAlPgGBpZLFadunnnHpR5c6c1ADF4/U3CqcQQLyGXpqaNxi/v3BuObinh1AQ7kxBZ3+KHSgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549276305; h=Date:From:Message-ID:Subject:To:ARC-Authentication-Results; bh=Z0jNIG4pjlO9EFbBe3Qbm85Ff2MCUpN7ndpMK/ntF+c=; b=i7kZ4+p9Fd1c3XcBI/D1rKwk0xUVTXLHLIXBDFbPPp7PbSOz8wMt6VC8tiqZG87bCBA3KlmF/9EDqmeS3SDr+Q9eE1bUcIbmkPj1+RApnkzDA9++5eK+RlkzP/SoUWtMnZXt0/THumleaRL2K33u/7smGW9u2htuJIiPEIOR79M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549276305; s=zoho; d=elephly.net; i=rekado@elephly.net; h=Date:To:From:Message-ID:Subject; l=22; bh=Z0jNIG4pjlO9EFbBe3Qbm85Ff2MCUpN7ndpMK/ntF+c=; b=LtCMq/qC2jOxstMCHRNXn1+KUb0DihYqulJ84YocZDOB2eagykLHGdtbkz8weaAL RFIvMr21NbbbW/T5oC3gVl+QdS437nLWhSvZ3vtQoxS3z9UD68o1Lsj3VjTwOFJOy5e 9bt5AJGt/T7cCYLsDkjqmXY6ffb5Eh6VYHFx6Z2w= Received: from localhost (46.183.103.8 [46.183.103.8]) by mx.zohomail.com with SMTPS id 1549276303306993.3712479133467; Mon, 4 Feb 2019 02:31:43 -0800 (PST) Date: Mon, 04 Feb 2019 11:31:36 +0100 To: control@debbugs.gnu.org From: Ricardo Wurmus Message-ID: <168b8104fcb.745c4eff1000524141.2903290622000671690@zoho.com> Subject: control message for bug #29824 X-ZohoMailClient: External X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) block 29824 by 29951 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 04 13:05:53 2019 Received: (at 29951) by debbugs.gnu.org; 4 Feb 2019 18:05:53 +0000 Received: from localhost ([127.0.0.1]:59705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqicy-0003ug-Lw for submit@debbugs.gnu.org; Mon, 04 Feb 2019 13:05:52 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:37332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqicw-0003uS-3e; Mon, 04 Feb 2019 13:05:50 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 87C75B951; Mon, 4 Feb 2019 19:05:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yu9NLB8SWXwA; Mon, 4 Feb 2019 19:05:48 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6EBFDB950; Mon, 4 Feb 2019 19:05:48 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ricardo Wurmus Subject: Re: bug#26752: Ansible & others' problems with wrapped '.ansible-real' scripts References: <874lx2w926.fsf@gnu.org> <8760fnsv3u.fsf@gnu.org> <87tvhkhu15.fsf@elephly.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 =?utf-8?Q?Pluvi=C3=B4se?= an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 04 Feb 2019 19:05:47 +0100 In-Reply-To: <87tvhkhu15.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 04 Feb 2019 08:50:14 +0100") Message-ID: <8736p3sa2s.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29951 Cc: Jelle Licht , 26752@debbugs.gnu.org, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Hi, Ricardo Wurmus skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> Jelle Licht skribis: >> >>> The current ansible package is still brokenin the same way. >>> >>> Is there already an acceptable way of working around this problem? >>> Otherwise I could send my (extremely hacky) workaround that adds a spec= ific >>> condition in the ansible source code to check for .ansible-real. >> >> For now I think we have to go with the hack. Make sure to add a comment >> linking to this bug report. > > There is a way to get around this. It=E2=80=99s presented in #29951: > > https://issues.guix.info/issue/29951 > > Open issues with this include a hard-coded store prefix, but it=E2=80=99s= no big > obstacle. Should we give this a try on core-updates? Definitely, please do! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 06 17:14:11 2019 Received: (at 29951) by debbugs.gnu.org; 6 Feb 2019 22:14:11 +0000 Received: from localhost ([127.0.0.1]:36287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grVSM-0001Vq-VY for submit@debbugs.gnu.org; Wed, 06 Feb 2019 17:14:11 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:54844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grVSI-0001Vb-U9; Wed, 06 Feb 2019 17:14:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5EC27C7EF; Wed, 6 Feb 2019 23:14:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5t60NTMrEO65; Wed, 6 Feb 2019 23:14:05 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 51A89C7E9; Wed, 6 Feb 2019 23:14:05 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ricardo Wurmus Subject: Re: bug#26752: Ansible & others' problems with wrapped '.ansible-real' scripts References: <874lx2w926.fsf@gnu.org> <8760fnsv3u.fsf@gnu.org> <87tvhkhu15.fsf@elephly.net> Date: Wed, 06 Feb 2019 23:14:04 +0100 In-Reply-To: <87tvhkhu15.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 04 Feb 2019 08:50:14 +0100") Message-ID: <87lg2s5zv7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29951 Cc: Jelle Licht , 26752@debbugs.gnu.org, 29951@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Ricardo Wurmus skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> Jelle Licht skribis: >> >>> The current ansible package is still brokenin the same way. >>> >>> Is there already an acceptable way of working around this problem? >>> Otherwise I could send my (extremely hacky) workaround that adds a spec= ific >>> condition in the ansible source code to check for .ansible-real. >> >> For now I think we have to go with the hack. Make sure to add a comment >> linking to this bug report. > > There is a way to get around this. It=E2=80=99s presented in #29951: > > https://issues.guix.info/issue/29951 BTW, there=E2=80=99s also this patch series on this topic: https://issues.guix.info/issue/27003 What to do? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 06 18:11:25 2019 Received: (at 29951) by debbugs.gnu.org; 6 Feb 2019 23:11:25 +0000 Received: from localhost ([127.0.0.1]:36350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grWLi-00032R-Te for submit@debbugs.gnu.org; Wed, 06 Feb 2019 18:11:25 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grWLd-00032C-PQ for 29951@debbugs.gnu.org; Wed, 06 Feb 2019 18:11:19 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549494654; cv=none; d=zoho.com; s=zohoarc; b=eaCFTGTX3vPlIqBf3DKcI2vMJVwfi0o01iH9MLndJkZy/m6k1knrTEyCGEMcFPFRxLJ2WJu0wTOh89zOfnvyKGxukTnAAGaAs+c6EAnlIUlZi6QAG0M6DFKl6YAS1U6yEGKY9LPKvh/1MhCOSDBDq+/71lAeviTgLt6y1B7jUbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549494654; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=3oz41+O7doxXU/cyYD3bjdHjmMhPLPXdk8T994AZ2IY=; b=nhWVKqPwmIz9+pLppjUwBFArObAevNEyeDg1qaa3S5Lx1Rx+1x1Ryd/YeG44yfnFVd/nOlXTqxAgu02K5PVPgBnti/h2gMnWNiZH0EcwC0Pdn09htQxecImMH0KLZ3/LZ6f3coPIYAzHQ1zGD9oOly7AfzqWe0ndg3rKmzSHaQg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549494654; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; l=9354; bh=3oz41+O7doxXU/cyYD3bjdHjmMhPLPXdk8T994AZ2IY=; b=X1OMoOKQApTmoXdlIUyugY5Mf/qpvSAOc0XSL7yRQICSdAcvJbxz7s7pfpl7T91V E9agvKRAQLDZ//JVYvO1BUdDYAzdjFB47z8QODd44XQHf6u6AnBd3X4RbkIJjUE/vm5 ep29v5IkV7aHSNNMBAI/BAMkxhNyk9NRp2Iqyk28= Received: from localhost (p3E9E9403.dip0.t-ipconnect.de [62.158.148.3]) by mx.zohomail.com with SMTPS id 1549494653285686.1107214484396; Wed, 6 Feb 2019 15:10:53 -0800 (PST) User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: 29951@debbugs.gnu.org Subject: [PATCH]: guix: Add wrap-script. X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Thu, 07 Feb 2019 00:10:49 +0100 Message-ID: <87d0o4fr7q.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 29951 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Here=E2=80=99s a new version which raises a condition on errors, handles all shebangs (including those with arguments or with custom store prefix), and which allows the value for =E2=80=9Cguile=E2=80=9D to be overr= idden. It comes with tests. It doesn=E2=80=99t apply automatically when =E2=80=9Cwrap-program=E2=80=9D = is used. It might be a good idea to call it automatically and fall back to =E2=80=9Cwrap-program= =E2=80=9D if the target is not a supported script. Comments are very welcome! --=20 Ricardo --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-guix-Add-wrap-script.patch Content-Transfer-Encoding: quoted-printable >From 8b0a19b35b6cad2347b68893bf751caec87b9df6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 2 Jan 2018 21:43:07 +0100 Subject: [PATCH] guix: Add wrap-script. * guix/build/utils.scm (wrap-script): New procedure. (&wrap-error): New condition. (wrap-error?, wrap-error-program, wrap-error-type): New procedures. * tests/build-utils.scm ("wrap-script, simple case", "wrap-script, with encoding declaration", "wrap-script, raises condition"): New tests. --- guix/build/utils.scm | 125 ++++++++++++++++++++++++++++++++++++++++++ tests/build-utils.scm | 102 ++++++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 55d34b67e..b7cd748d8 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2013 Nikita Karetnikov ;;; Copyright =C2=A9 2015, 2018 Mark H Weaver ;;; Copyright =C2=A9 2018 Arun Isaac +;;; Copyright =C2=A9 2018, 2019 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,6 +91,11 @@ remove-store-references wrapper? wrap-program + wrap-script + + wrap-error? + wrap-error-program + wrap-error-type =20 invoke invoke-error? @@ -1042,6 +1048,11 @@ known as `nuke-refs' in Nixpkgs." (put-u8 out (char->integer char)) result)))))) =20 +(define-condition-type &wrap-error &error + wrap-error? + (program wrap-error-program) + (type wrap-error-type)) + (define (wrapper? prog) "Return #t if PROG is a wrapper as produced by 'wrap-program'." (and (file-exists? prog) @@ -1146,6 +1157,120 @@ with definitions for VARS." (chmod prog-tmp #o755) (rename-file prog-tmp prog)))) =20 +(define wrap-script + (let ((interpreter-regex + (make-regexp + (string-append "^#! ?(/[^ ]+/bin/(" + (string-join '("python[^ ]*" + "Rscript" + "perl" + "ruby" + "bash" + "sh") "|") + "))( ?.*)"))) + (coding-line-regex + (make-regexp + ".*#.*coding[=3D:][[:space:]]*([-a-zA-Z_0-9.]+)"))) + (lambda* (prog #:key (guile (which "guile")) #:rest vars) + "Wrap the script PROG such that VARS are set first. The format of V= ARS +is the same as in the WRAP-PROGRAM procedure. This procedure differs from +WRAP-PROGRAM in that it does not create a separate shell script. Instead, +PROG is modified directly by prepending a Guile script, which is interpret= ed +as a comment in the script's language. + +Special encoding comments as supported by Python are recreated on the seco= nd +line. + +Note that this procedure can only be used once per file as Guile scripts a= re +not supported." + (define update-env + (match-lambda + ((var sep '=3D rest) + `(setenv ,var ,(string-join rest sep))) + ((var sep 'prefix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append ,(string-join rest sep) + ,sep current) + ,(string-join rest sep))))) + ((var sep 'suffix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append current ,sep + ,(string-join rest sep)) + ,(string-join rest sep))))) + ((var '=3D rest) + `(setenv ,var ,(string-join rest ":"))) + ((var 'prefix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append ,(string-join rest ":") + ":" current) + ,(string-join rest ":"))))) + ((var 'suffix rest) + `(let ((current (getenv ,var))) + (setenv ,var (if current + (string-append current ":" + ,(string-join rest ":")) + ,(string-join rest ":"))))))) + (let-values (((interpreter args coding-line) + (call-with-ascii-input-file prog + (lambda (p) + (let ((first-match + (false-if-exception + (regexp-exec interpreter-regex (read-line = p))))) + (values (and first-match (match:substring first-= match 1)) + (and first-match (match:substring first-= match 3)) + (false-if-exception + (and=3D> (regexp-exec coding-line-regex= (read-line p)) + (lambda (m) (match:substring m 0= )))))))))) + (if interpreter + (let* ((header (format #f "\ +#!~a --no-auto-compile +#!#; ~a +#\\-~s +#\\-~s +" + guile + (or coding-line "Guix wrapper") + (cons 'begin (map update-env + (match vars + ((#:guile _ . vars)= vars) + (_ vars)))) + `(let ((cl (command-line))) + (apply execl ,interpreter + (car cl) + (cons (car cl) + (append + ',(string-split args #= \space) + cl)))))) + (template (string-append prog ".XXXXXX")) + (out (mkstemp! template)) + (st (stat prog)) + (mode (stat:mode st))) + (with-throw-handler #t + (lambda () + (call-with-ascii-input-file prog + (lambda (p) + (format out header) + (dump-port p out) + (close out) + (chmod template mode) + (rename-file template prog) + (set-file-time prog st)))) + (lambda (key . args) + (format (current-error-port) + "wrap-script: ~a: error: ~a ~s~%" + prog key args) + (false-if-exception (delete-file template)) + (raise (condition + (&wrap-error (program prog) + (type key)))) + #f))) + (raise (condition + (&wrap-error (program prog) + (type 'no-interpreter-found))))))))) + ;;; ;;; Locales. diff --git a/tests/build-utils.scm b/tests/build-utils.scm index 7d49446f6..1c9084514 100644 --- a/tests/build-utils.scm +++ b/tests/build-utils.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2012, 2015, 2016 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2019 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -122,4 +123,105 @@ (and (zero? (close-pipe pipe)) str)))))) =20 +(let ((script-contents "\ +#!/anything/cabbage-bash-1.2.3/bin/sh + +echo hello world")) + + (test-equal "wrap-script, simple case" + (string-append + (format #f "\ +#!GUILE --no-auto-compile +#!#; Guix wrapper +#\\-~s +#\\-~s +" + '(begin (let ((current (getenv "GUIX_FOO"))) + (setenv "GUIX_FOO" + (if current + (string-append "/some/path:/some/other/= path" + ":" current) + "/some/path:/some/other/path")))) + '(let ((cl (command-line))) + (apply execl "/anything/cabbage-bash-1.2.3/bin/sh" + (car cl) + (cons (car cl) + (append '("") cl))))) + script-contents) + (call-with-temporary-directory + (lambda (directory) + (let ((script-file-name (string-append directory "/foo"))) + (call-with-output-file script-file-name + (lambda (port) + (format port script-contents))) + (chmod script-file-name #o777) + + (mock ((guix build utils) which (const "GUILE")) + (wrap-script script-file-name + `("GUIX_FOO" prefix ("/some/path" + "/some/other/path")))) + (let ((str (call-with-input-file script-file-name get-string-all)= )) + (with-directory-excursion directory + (delete-file "foo")) + str)))))) + +(let ((script-contents "\ +#!/anything/cabbage-bash-1.2.3/bin/python3 -and -args +# vim:fileencoding=3Dutf-8 +print('hello world')")) + + (test-equal "wrap-script, with encoding declaration" + (string-append + (format #f "\ +#!MYGUILE --no-auto-compile +#!#; # vim:fileencoding=3Dutf-8 +#\\-~s +#\\-~s +" + '(begin (let ((current (getenv "GUIX_FOO"))) + (setenv "GUIX_FOO" + (if current + (string-append "/some/path:/some/other/= path" + ":" current) + "/some/path:/some/other/path")))) + `(let ((cl (command-line))) + (apply execl "/anything/cabbage-bash-1.2.3/bin/python3" + (car cl) + (cons (car cl) + (append '("" "-and" "-args") cl))))) + script-contents) + (call-with-temporary-directory + (lambda (directory) + (let ((script-file-name (string-append directory "/foo"))) + (call-with-output-file script-file-name + (lambda (port) + (format port script-contents))) + (chmod script-file-name #o777) + + (wrap-script script-file-name + #:guile "MYGUILE" + `("GUIX_FOO" prefix ("/some/path" + "/some/other/path"))) + (let ((str (call-with-input-file script-file-name get-string-all)= )) + (with-directory-excursion directory + (delete-file "foo")) + str)))))) + +(test-assert "wrap-script, raises condition" + (call-with-temporary-directory + (lambda (directory) + (let ((script-file-name (string-append directory "/foo"))) + (call-with-output-file script-file-name + (lambda (port) + (format port "This is not a script"))) + (chmod script-file-name #o777) + (catch 'srfi-34 + (lambda () + (wrap-script script-file-name + #:guile "MYGUILE" + `("GUIX_FOO" prefix ("/some/path" + "/some/other/path")))) + (lambda (type obj) + (wrap-error? obj))))))) + (test-end) --=20 2.20.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 05:11:06 2019 Received: (at 29951-done) by debbugs.gnu.org; 8 Feb 2019 10:11:06 +0000 Received: from localhost ([127.0.0.1]:38920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs37h-00074N-Qm for submit@debbugs.gnu.org; Fri, 08 Feb 2019 05:11:05 -0500 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs37e-000742-Nn for 29951-done@debbugs.gnu.org; Fri, 08 Feb 2019 05:11:03 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1549620644; cv=none; d=zoho.com; s=zohoarc; b=Q/CkZIA6tobhrsx63fdLYogCuHSyINmlI/KlIXfidC+Vh9wzFNEJUuuIIE5mRizhGh1UjwzyIlod1ByP3KfJJLsBH57b9hgz743kurPbU7hyr7MMHSdYDlPb8sYfOqptJZrQuLUk8yzSToed/kBs937NZxtNernxV2PeLJWqD1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1549620644; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=n/h1YKnR/wL3NEd9gtF6vcB3SJonKyLcu9FCBew14FQ=; b=QoDrD96BCGjb2yZmpQwXNUZOj8UAfAiv7sgBeyQxg0SH1/4tk5nc9xmxccvNp9GKgUDfpw3yBsj5VPpI4lUDRtppBzT3/Jh6oAvhQjGmBjYWKy9pHcUEQ6oYW2B3ujmCbl19HPh0VvVRQ+ZTSIFbFMU2r1IOGl4K1Iu93VJltFw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549620644; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; l=834; bh=n/h1YKnR/wL3NEd9gtF6vcB3SJonKyLcu9FCBew14FQ=; b=OOX2+Dbyin/2VnmbkRw/r5qAikuJVfaIrpIVUM2Iv0nVS28RteW3eVFONmIi7yEf JbaVFY2/8WDKJ+Le++ugPvx8lGGto4aw46EAUH1rtQe4YkBRG0qgc7aGdvKBQT44JXk h55IQ//cofTs+zM0zHaCdKxbrCjgALDnlr48KHEo= Received: from localhost (p3E9E9147.dip0.t-ipconnect.de [62.158.145.71]) by mx.zohomail.com with SMTPS id 1549620643292305.0987363298989; Fri, 8 Feb 2019 02:10:43 -0800 (PST) References: <20180102204434.2716-1-rekado@elephly.net> <87d0o4fr7q.fsf@elephly.net> User-agent: mu4e 1.0; emacs 26.1 From: Ricardo Wurmus To: 29951-done@debbugs.gnu.org Subject: Re: [bug#29951] [PATCH]: guix: Add wrap-script. In-reply-to: <87d0o4fr7q.fsf@elephly.net> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Fri, 08 Feb 2019 11:10:40 +0100 Message-ID: <87h8demvz3.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29951-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Ricardo Wurmus writes: > Here=E2=80=99s a new version which raises a condition on errors, handles > all shebangs (including those with arguments or with custom store > prefix), and which allows the value for =E2=80=9Cguile=E2=80=9D to be ove= rridden. > > It comes with tests. I have pushed this to core-updates with commit 0fb9a8df429a7b9f40610ff15baaff0d8e31e8cf > It doesn=E2=80=99t apply automatically when =E2=80=9Cwrap-program=E2=80= =9D is used. It might be > a good idea to call it automatically and fall back to =E2=80=9Cwrap-progr= am=E2=80=9D if > the target is not a supported script. It still doesn=E2=80=99t do this. To use it you have to opt in and use =E2=80=9Cwrap-script=E2=80=9D instead of =E2=80=9Cwrap-program=E2=80=9D. Comments are still welcome! -- Ricardo From unknown Mon Jun 23 23:54:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 08 Mar 2019 12: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