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

Implicit variable launchDir breaks caching #5253

Open
Sodbo opened this issue Aug 23, 2024 · 0 comments
Open

Implicit variable launchDir breaks caching #5253

Sodbo opened this issue Aug 23, 2024 · 0 comments

Comments

@Sodbo
Copy link

Sodbo commented Aug 23, 2024

Bug report

Ciao from Human Technopole, Milano!

Expected behavior and actual behavior

Using the $launchDir variable in the script: section breaks caching (the process gets executed even though nothing has changed).

Steps to reproduce the problem

#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

process test_cache_launchDir {
    output:
        path("result.txt"), emit: result
    
    script:
    """
    file ${launchDir}/foo.txt > result.txt
    """
}

process test_cache_projectDir {
    output:
        path("result.txt"), emit: result
    
    script:
    """
    file ${projectDir}/foo.txt > result.txt
    """
}

workflow {
    test_cache_launchDir()
    test_cache_projectDir()
}

Program output

[bugtest]sodbo.sharapov@hnode02$ nextflow run main.nf

Nextflow 24.04.4 is available - Please consider updating your version to it

 N E X T F L O W   ~  version 24.04.2

Launching `main.nf` [pedantic_bose] DSL2 - revision: a61cfacf8f

executor >  local (2)
[8f/62d857] process > test_cache_launchDir  [100%] 1 of 1 ✔
[d3/32cc2a] process > test_cache_projectDir [100%] 1 of 1 ✔

[bugtest]sodbo.sharapov@hnode02$ nextflow run main.nf -resume

Nextflow 24.04.4 is available - Please consider updating your version to it

 N E X T F L O W   ~  version 24.04.2

Launching `main.nf` [sleepy_kalman] DSL2 - revision: a61cfacf8f

executor >  local (1)
[39/6cbe9d] process > test_cache_launchDir  [100%] 1 of 1 ✔
[d3/32cc2a] process > test_cache_projectDir [100%] 1 of 1, cached: 1 ✔

Environment

  • Nextflow version: 24.04.2
  • Java version: openjdk/17.0.8.1_1
  • Operating system: linux
  • Bash version: GNU bash, version 4.4.19(1)

Additional context

A similar problem with projectDir was fixed three years ago in Issue #2186. The fix was implemented in commit 7a4d1f1.

I also checked the task hashes, and they differ between same runs, as it was reported here.

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

No branches or pull requests

1 participant