-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Bash path configurable #5696
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ import java.nio.file.Path | |
import groovy.transform.CompileStatic | ||
import groovy.transform.PackageScope | ||
import groovy.util.logging.Slf4j | ||
import nextflow.NF | ||
import nextflow.SysEnv | ||
import nextflow.container.ContainerBuilder | ||
import nextflow.container.DockerBuilder | ||
|
@@ -84,8 +85,7 @@ class BashWrapperBuilder { | |
catch( Exception e ) { | ||
log.warn "Invalid value for `NXF_DEBUG` variable: $str -- See http://www.nextflow.io/docs/latest/config.html#environment-variables" | ||
} | ||
BASH = Collections.unmodifiableList( level > 0 ? ['/bin/bash','-uex'] : ['/bin/bash','-ue'] ) | ||
|
||
BASH = Collections.unmodifiableList( level > 0 ? [NF.bash(), '-uex'] : [NF.bash(), '-ue'] ) | ||
Comment on lines
-87
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal should be to specify a custom Bash path not to alter the shell option. That's possible in some extent via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that Maybe for some context, here is a test script that I am using to check whether the Nextflow package is running as expected on NixOS. I'm linking this here to show what my goal is/was with #5684. (The test is easy to understand without knowledge of Nix.). 5684 would allow me to pass this test. I think even today, I could use an unpatched Nextflow on NixOS if I "simply" adapt There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct.
my understanding is that in NixOS the Bash interpreter is located at Is it not the case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NixOS has bash at But: The docker images doesn't have it there. They have it (officially) at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. What's preventing creating a symlink to "normalise" it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A Nix package cannot create arbitrary files on the file system. Actually, older definitions of the Nextflow package used a wrapper to make |
||
} | ||
|
||
|
||
|
@@ -567,7 +567,7 @@ class BashWrapperBuilder { | |
// keep the shell path as "/bin/bash" when a non-custom "shell" attribute is specified | ||
// to not introduce unexpected changes due to the fact BASH is defined as "/bin/bash -eu" by default | ||
return shell.is(BASH) | ||
? "/bin/bash" | ||
? NF.bash() | ||
: shell.join(' ') | ||
} | ||
|
||
|
@@ -600,7 +600,7 @@ class BashWrapperBuilder { | |
if( (env || needChangeTaskWorkDir) && !containerConfig.entrypointOverride() ) { | ||
if( needChangeTaskWorkDir ) | ||
cmd = 'cd $NXF_TASK_WORKDIR; ' + cmd | ||
cmd = "/bin/bash -c \"$cmd\"" | ||
cmd = "${NF.bash()} -c \"$cmd\"" | ||
} | ||
launcher = containerBuilder.getRunCommand(cmd) | ||
} | ||
|
@@ -738,7 +738,7 @@ class BashWrapperBuilder { | |
builder.params(readOnlyInputs: true) | ||
|
||
if( this.containerConfig.entrypointOverride() ) | ||
builder.params(entry: '/bin/bash') | ||
builder.params(entry: NF.bash()) | ||
|
||
// give a chance to override any option with process specific `containerOptions` | ||
if( containerOptions ) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config scope was renamed to
workflow
, I would just call itworkflow.bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's discuss about this. I think we need to nextflow wide setting (more tied to runtime than workflow concept)