unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32293: wrap-program with non-colon separtor produces incorrect bash substitutions
@ 2018-07-27 15:51 Jelle Licht
  2018-08-19 10:56 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Jelle Licht @ 2018-07-27 15:51 UTC (permalink / raw)
  To: 32293

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.

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

* bug#32293: wrap-program with non-colon separtor produces incorrect bash substitutions
  2018-07-27 15:51 bug#32293: wrap-program with non-colon separtor produces incorrect bash substitutions Jelle Licht
@ 2018-08-19 10:56 ` Ludovic Courtès
  2018-08-20 15:06   ` Jelle Licht
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-08-19 10:56 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 32293

Hello Jelle!

Jelle Licht <jlicht@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’.

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

* bug#32293: wrap-program with non-colon separtor produces incorrect bash substitutions
  2018-08-19 10:56 ` Ludovic Courtès
@ 2018-08-20 15:06   ` Jelle Licht
  0 siblings, 0 replies; 3+ messages in thread
From: Jelle Licht @ 2018-08-20 15:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Jelle Licht, 32293-done


Ludovic Courtès <ludo@gnu.org> writes:

> Hello Jelle!
>
> Jelle Licht <jlicht@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’.

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

end of thread, other threads:[~2018-08-20 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 15:51 bug#32293: wrap-program with non-colon separtor produces incorrect bash substitutions Jelle Licht
2018-08-19 10:56 ` Ludovic Courtès
2018-08-20 15:06   ` Jelle Licht

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

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

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