GNU bug report logs - #32293
wrap-program with non-colon separtor produces incorrect bash substitutions

Previous Next

Package: guix;

Reported by: Jelle Licht <jlicht <at> fsfe.org>

Date: Fri, 27 Jul 2018 15:52:01 UTC

Severity: normal

Done: Jelle Licht <jlicht <at> fsfe.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32293 in the body.
You can then email your comments to 32293 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#32293; Package guix. (Fri, 27 Jul 2018 15:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jelle Licht <jlicht <at> fsfe.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 27 Jul 2018 15:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: "Bug-guix\@gnu org" <bug-guix <at> gnu.org>
Subject: wrap-program with non-colon separtor produces incorrect bash
 substitutions
Date: Fri, 27 Jul 2018 17:51:06 +0200
Hi all,

While working to package some lua-related stuff, I need to deal with the
LUA_PATH environment variable. This variable uses `;' as a separator, and
as such, I wanted to wrap one of my programs

--8<---------------cut here---------------start------------->8---
...
(wrap-program (string-append out "/bin/fennel")
                   `("LUA_PATH" ";" prefix (,path)))
...
--8<---------------cut here---------------end--------------->8---

... which gives me the following snippet for the fennel script:

--8<---------------cut here---------------start------------->8---
export LUA_PATH="/gnu/store/3yjzvzwczi37snccrxbw7xsmbns1qc7a-fennel-1-1.f2a3d3b/share/lua/5.3/?.lua${LUA_PATH;+;}$LUA_PATH"
--8<---------------cut here---------------end--------------->8---

... which is not a correct bash substitution. I _think_ the first `;' in
`{LUA_PATH;+;}' needs to be a colon instead, at least if `wrap-program'
is only used to generate bash-compliant wrappers.

It seems this can be (easily?) fixed around guix/build/utils.scm:1055,
but any changes I made there had me starting to build bash and other
things from scratch.




Information forwarded to bug-guix <at> gnu.org:
bug#32293; Package guix. (Sun, 19 Aug 2018 10:57:02 GMT) Full text and rfc822 format available.

Message #8 received at 32293 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jelle Licht <jlicht <at> fsfe.org>
Cc: 32293 <at> debbugs.gnu.org
Subject: Re: bug#32293: wrap-program with non-colon separtor produces
 incorrect bash substitutions
Date: Sun, 19 Aug 2018 12:56:43 +0200
Hello Jelle!

Jelle Licht <jlicht <at> fsfe.org> skribis:

> While working to package some lua-related stuff, I need to deal with the
> LUA_PATH environment variable. This variable uses `;' as a separator, and
> as such, I wanted to wrap one of my programs
>
> ...
> (wrap-program (string-append out "/bin/fennel")
>                    `("LUA_PATH" ";" prefix (,path)))
> ...
>
>
> ... which gives me the following snippet for the fennel script:
>
> export LUA_PATH="/gnu/store/3yjzvzwczi37snccrxbw7xsmbns1qc7a-fennel-1-1.f2a3d3b/share/lua/5.3/?.lua${LUA_PATH;+;}$LUA_PATH"
>
> ... which is not a correct bash substitution. I _think_ the first `;' in
> `{LUA_PATH;+;}' needs to be a colon instead, at least if `wrap-program'
> is only used to generate bash-compliant wrappers.
>
> It seems this can be (easily?) fixed around guix/build/utils.scm:1055,
> but any changes I made there had me starting to build bash and other
> things from scratch.

It’s indeed where the bug lies.  Changing that file involves a full
rebuild (because every package build process uses it), but that’s OK:
you can test the ‘wrap-program’ procedure independently (at the REPL,
for example), and then we can push this change to ‘core-updates’.

We need to check whether ‘core-updates’ still accepts full-rebuild
changes at this stage, though.

Thanks,
Ludo’.




Reply sent to Jelle Licht <jlicht <at> fsfe.org>:
You have taken responsibility. (Mon, 20 Aug 2018 15:07:02 GMT) Full text and rfc822 format available.

Notification sent to Jelle Licht <jlicht <at> fsfe.org>:
bug acknowledged by developer. (Mon, 20 Aug 2018 15:07:02 GMT) Full text and rfc822 format available.

Message #13 received at 32293-done <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Jelle Licht <jlicht <at> fsfe.org>, 32293-done <at> debbugs.gnu.org
Subject: Re: bug#32293: wrap-program with non-colon separtor produces
 incorrect bash substitutions
Date: Mon, 20 Aug 2018 17:06:07 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello Jelle!
>
> Jelle Licht <jlicht <at> fsfe.org> skribis:
>
>> While working to package some lua-related stuff, I need to deal with the
>> LUA_PATH environment variable. This variable uses `;' as a separator, and
>> as such, I wanted to wrap one of my programs
>>
>> ...
>> (wrap-program (string-append out "/bin/fennel")
>>                    `("LUA_PATH" ";" prefix (,path)))
>> ...
>>
>>
>> ... which gives me the following snippet for the fennel script:
>>
>> export LUA_PATH="/gnu/store/3yjzvzwczi37snccrxbw7xsmbns1qc7a-fennel-1-1.f2a3d3b/share/lua/5.3/?.lua${LUA_PATH;+;}$LUA_PATH"
>>
>> ... which is not a correct bash substitution. I _think_ the first `;' in
>> `{LUA_PATH;+;}' needs to be a colon instead, at least if `wrap-program'
>> is only used to generate bash-compliant wrappers.
>>
>> It seems this can be (easily?) fixed around guix/build/utils.scm:1055,
>> but any changes I made there had me starting to build bash and other
>> things from scratch.
>
> It’s indeed where the bug lies.  Changing that file involves a full
> rebuild (because every package build process uses it), but that’s OK:
> you can test the ‘wrap-program’ procedure independently (at the REPL,
> for example), and then we can push this change to ‘core-updates’.
>
> We need to check whether ‘core-updates’ still accepts full-rebuild
> changes at this stage, though.

I pushed this on core-updates as e6c4e41102.

>
> Thanks,
> Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Sep 2018 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.