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

Configuration file variable interpolation does not respect source order #4983

Open
mluypaert opened this issue May 9, 2024 · 1 comment
Open

Comments

@mluypaert
Copy link

Bug report

Expected behavior and actual behavior

Expected behaviour:
When using variable interpolation in the nextflow.config file, I expect parameters provided on the command line to override the value of the respective variable in the config file (as per the documented source priority order), and interpolation in other parameters to use this command-line provided value.

Actual behaviour:
While the parameter provided on the command-line overrides the value of said parameter definition from the config file, any variable interpolation done in the config file will use the value as found in the config file instead of the cmdline provided value.

Steps to reproduce the problem

Define a nextflow.config file with the following content:

profiles {
    test {
        params {
            propertyOne = 'world'
            anotherProp = "Hello $propertyOne"
        }
    }
}

Write a file called variable-interpolation-test.nf with the following content:

params.propertyOne = ''
params.anotherProp = ''

workflow {
    print "propertyOne: ${params.propertyOne}"
    print "anotherProp: ${params.anotherProp}"
}

Run the variable-interpolation-test.nf script:

nextflow run -profile test variable-interpolation-test.nf --propertyOne There!

and witness that the propertyOne value defined as cmdline argument is not interpolated into anotherProp as it produced below output

Program output

May 09, 2024 3:39:38 PM com.google.auth.oauth2.DefaultCredentialsProvider warnAboutProblematicCredentials
WARNING: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
N E X T F L O W  ~  version 23.10.1
Launching `variable-interpolation-test.nf` [curious_mcclintock] DSL2 - revision: d61a249b4e
propertyOne: There!
anotherProp: Hello world

Environment

  • Nextflow version: 23.10.1
  • Java version: openjdk 17.0.10
  • Operating system: Linux (Ubuntu)
  • Bash version: GNU bash, version 5.0.17(1)-release
mluypaert added a commit to alliance-genome/agr_pavi that referenced this issue May 9, 2024
@bentsherman
Copy link
Member

Duplicate of #2662, will be solved by #4744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants