-
Notifications
You must be signed in to change notification settings - Fork 750
Fix: tolerate special bash characters in $NXF_TASK_WORKDIR
#6421
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
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
|
Is this PR linked to an issue? Or could you provide more info about the case that this PR fixes? I was trying to validate the changes with a failing case but I couldn't find it. I run a pipeline with Singularity and a work dir with spaces and it is not failing with the latest releases. All the task outputs are correctly stored in the work dir. |
|
Hi @jorgee ! I'll try to replicate this issue with the latest commit of Nextflow today! I don't believe it's tied to an issue — I think (at the time) a PR seemed like the fastest way to fix it! |
Prior to this commit, selecting a workDir with spaces or other special Bash characters in the pathname — like `(`, `)`, etc — would result in `cd $NXF_TASK_WORKDIR` failing. Now `$NXF_TASK_WORKDIR` is correctly quoted in the generated `.output.run` scripts. Signed-off-by: Brooks J Rady <b.j.rady@gmail.com>
|
For @jorgee , with spaces and containers, this issue seems to often be silent, with
I'll re-check that's still the case with the latest master and will check that my PR definitely still fixes that! EDIT: I've confirmed that the issue still exists on 55f6ff5, but it's fixed by 8d3692a ! |
$NXF_TASK_WORKDIR$NXF_TASK_WORKDIR
|
I have replicated the problem with parentheses. I tested with local, docker and singularity. It is only failing with singularity and the PR fixes it |
jorgee
left a comment
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.
Changes are fine to me. Just adding missing "" in the command and entrypoint definition for the singularity case. I have replicated the issue and checked the PR fixes it.

Prior to this commit, selecting a workDir with spaces or other special Bash characters in the pathname — like
(,), etc — would result incd $NXF_TASK_WORKDIRfailing. Now$NXF_TASK_WORKDIRis correctly quoted in the generated.output.runscripts.I just got into Nextflow yesterday, and this is my first time touching Groovy code, so let me know if you'd like to see this fix implemented in some other way!