Skip to content
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

Typo in the container declaration leads to null and nextflow using a local tool installation #5814

Open
FriederikeHanssen opened this issue Feb 25, 2025 · 4 comments · May be fixed by #4613

Comments

@FriederikeHanssen
Copy link

Bug report

When the container definition ends on [], the container itself is not used but the container declaration is set to null. If the tool is available locally, nextflow uses that tool and the script is not portable anymore.

Expected behavior and actual behavior

Such a typo should throw an error and warn the user

Steps to reproduce the problem

I created a small example here: https://github.com/FriederikeHanssen/mre/blob/container_typo/main.nf

The container declaration ends on []. If cowsay is not installed in my local environment the script fails with .command.sh: line 2: cowpy: command not found. However, if I have it installed in my local environment (i.e pip install cowpy ) The script finishes successfully.

Program output

The .command.run:

#!/bin/bash
### ---
### name: 'COWSAY'
### container: 'null'
### ...
set -e
set -u
NXF_DEBUG=${NXF_DEBUG:=0}; [[ $NXF_DEBUG > 1 ]] && set -x
NXF_ENTRY=${1:-nxf_main}

Environment

  • Nextflow version: 24.10.3.5933
  • Operating system: macOS
@pditommaso
Copy link
Member

Emm, why there's a [] after the container name! 😆

@FriederikeHanssen
Copy link
Author

Typos happen

@pditommaso
Copy link
Member

Not sure how much it can be done, it's valid syntax returning an empty string

def x = 'foo'[]
assert x == ''

@bentsherman
Copy link
Member

This syntax is not valid with the language server / new script parser. Will be fixed by #4613

@bentsherman bentsherman linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants