unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
* GWL bash-minimal masks input bash
@ 2022-04-06  8:38 Liliana Marie Prikler
  2022-05-02  9:33 ` zimoun
  2022-07-12 19:05 ` Ricardo Wurmus
  0 siblings, 2 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-04-06  8:38 UTC (permalink / raw)
  To: gwl-devel

Hi scientific Guix,

I have a scientific workflow that depends on a bash script using an
extension.  (I wish I did not.)  Said script is the least common
denominator working on all systems that have some basic utilities, and
needs therefore not consider the reproducibility of its inputs (it is
assumed, that those are up to date).  However, at least on my personal
machine I want to ensure the reproducibility of the entire workflow,
including the invocation of said script.

I wrote a GWL workflow that calls the script, but due to the extension
the script actually fails in the GWL context.  This is because GWL's
process->script unconditionally conses bash-minimal to the process
inputs.  It should probably check whether a bash input already exists
or alternatively just append (list (bash-minimal)) instead.

For those in a similar situation as I am needing a fix, the following
works for me: instead of calling "bash" inside the workflow's inline
code, I specify
--8<---------------cut here---------------start------------->8---
  values
    run-with-store
      open-connection
      package-file bash "bin/bash"
--8<---------------cut here---------------end--------------->8---
and use {{values}} instead of "bash" to call my script.  (Don't forget
to add bash to your inputs, because package-file does not guarantee
existence of the file). 

Cheers


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

* Re: GWL bash-minimal masks input bash
  2022-04-06  8:38 GWL bash-minimal masks input bash Liliana Marie Prikler
@ 2022-05-02  9:33 ` zimoun
  2022-05-02 10:42   ` Liliana Marie Prikler
  2022-07-12 19:05 ` Ricardo Wurmus
  1 sibling, 1 reply; 5+ messages in thread
From: zimoun @ 2022-05-02  9:33 UTC (permalink / raw)
  To: Liliana Marie Prikler, gwl-devel

Hi Liliana,

Thanks for the tip.

On Wed, 06 Apr 2022 at 10:38, Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:

> I wrote a GWL workflow that calls the script, but due to the extension
> the script actually fails in the GWL context.  This is because GWL's
> process->script unconditionally conses bash-minimal to the process
> inputs.  It should probably check whether a bash input already exists
> or alternatively just append (list (bash-minimal)) instead.

Out of curiosity, why bash-minimal is not enough for running your
script?


Cheers,
simon


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

* Re: GWL bash-minimal masks input bash
  2022-05-02  9:33 ` zimoun
@ 2022-05-02 10:42   ` Liliana Marie Prikler
  0 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-05-02 10:42 UTC (permalink / raw)
  To: zimoun, gwl-devel

Am Montag, dem 02.05.2022 um 11:33 +0200 schrieb zimoun:
> Hi Liliana,
> 
> Thanks for the tip.
> 
> On Wed, 06 Apr 2022 at 10:38, Liliana Marie Prikler
> <liliana.prikler@ist.tugraz.at> wrote:
> 
> > I wrote a GWL workflow that calls the script, but due to the
> > extension the script actually fails in the GWL context.  This is
> > because GWL's process->script unconditionally conses bash-minimal
> > to the process inputs.  It should probably check whether a bash
> > input already exists or alternatively just append (list (bash-
> > minimal)) instead.
> 
> Out of curiosity, why bash-minimal is not enough for running your
> script?
Because it dynamically loads a bash extension via `enable -f'.  This is
not supported by bash-minimal, but it is supported by regular bash.

Cheers


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

* Re: GWL bash-minimal masks input bash
  2022-04-06  8:38 GWL bash-minimal masks input bash Liliana Marie Prikler
  2022-05-02  9:33 ` zimoun
@ 2022-07-12 19:05 ` Ricardo Wurmus
  2022-07-13  5:55   ` Liliana Marie Prikler
  1 sibling, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2022-07-12 19:05 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: gwl-devel


Hi Liliana,

> I have a scientific workflow that depends on a bash script using an
> extension.  (I wish I did not.)  Said script is the least common
> denominator working on all systems that have some basic utilities, and
> needs therefore not consider the reproducibility of its inputs (it is
> assumed, that those are up to date).  However, at least on my personal
> machine I want to ensure the reproducibility of the entire workflow,
> including the invocation of said script.
>
> I wrote a GWL workflow that calls the script, but due to the extension
> the script actually fails in the GWL context.  This is because GWL's
> process->script unconditionally conses bash-minimal to the process
> inputs.  It should probably check whether a bash input already exists
> or alternatively just append (list (bash-minimal)) instead.

Would appending bash-minimal really help?  Does it really give
preference to your bash when resolving conflicts as it builds the
profile?

Not sure how we should check for the presence of a package providing a
shell.  We can check for certain packages by name, of course, but it
doesn’t feel right to me.

Any other ideas how to accommodate the need to swap out the package
providing a shell?

> For those in a similar situation as I am needing a fix, the following
> works for me: instead of calling "bash" inside the workflow's inline
> code, I specify
>
>   values
>     run-with-store
>       open-connection
>       package-file bash "bin/bash"
>
> and use {{values}} instead of "bash" to call my script.  (Don't forget
> to add bash to your inputs, because package-file does not guarantee
> existence of the file). 

That’s an interesting solution.  Thanks for sharing it.

-- 
Ricardo


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

* Re: GWL bash-minimal masks input bash
  2022-07-12 19:05 ` Ricardo Wurmus
@ 2022-07-13  5:55   ` Liliana Marie Prikler
  0 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-07-13  5:55 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: gwl-devel

Am Dienstag, dem 12.07.2022 um 21:05 +0200 schrieb Ricardo Wurmus:
> 
> Hi Liliana,
> 
> > I have a scientific workflow that depends on a bash script using an
> > extension.  (I wish I did not.)  Said script is the least common
> > denominator working on all systems that have some basic utilities,
> > and needs therefore not consider the reproducibility of its inputs
> > (it is assumed, that those are up to date).  However, at least on
> > my personal machine I want to ensure the reproducibility of the
> > entire workflow, including the invocation of said script.
> > 
> > I wrote a GWL workflow that calls the script, but due to the
> > extension the script actually fails in the GWL context.  This is
> > because GWL's process->script unconditionally conses bash-minimal
> > to the process inputs.  It should probably check whether a bash
> > input already exists or alternatively just append (list (bash-
> > minimal)) instead.
> 
> Would appending bash-minimal really help?  Does it really give
> preference to your bash when resolving conflicts as it builds the
> profile?
Why should it not?

> Not sure how we should check for the presence of a package providing
> a shell.  We can check for certain packages by name, of course, but
> it doesn’t feel right to me.
I'm fairly certain this lookup uses PATH or an equivalent
implementation in Guile (search-input-file springs to mind, which also
uses inputs in the order given).

> Any other ideas how to accommodate the need to swap out the package
> providing a shell?
You could check for the presence of bash in inputs before adding it,
but that'd be more error-prone.  Alternatively the implicit vs.
explicit problem also exists in gnu-build-system, so that solution
could be adapted as well.

Cheers


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

end of thread, other threads:[~2022-07-13  5:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  8:38 GWL bash-minimal masks input bash Liliana Marie Prikler
2022-05-02  9:33 ` zimoun
2022-05-02 10:42   ` Liliana Marie Prikler
2022-07-12 19:05 ` Ricardo Wurmus
2022-07-13  5:55   ` Liliana Marie Prikler

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).