Skip to content

Conversation

@bentsherman
Copy link
Member

Close #6512

This PR fixes an apparent regression in 25.10. The following directives fail when they are specified with a closure that references a process input:

  • accelerator
  • arch
  • publishDir

This has to do with how they are implemented in ProcessBuilder. Most directives aren't implemented explicitly, but these directives require explicit methods in order to handle named arguments.

I'm not sure why it works in 25.04 but not in 25.10, since the logic of these methods were not changed when they were moved to ProcessBuilder. I suspect it was being held together with some hidden Groovy magic 🤷

Test case derived from the issue:

params.analysis_output_dir = 'analysis_output_dir'
params.analysis_id = 'analysis_id'

workflow {
    TEST( tuple('individual_id', 'sample_id') )
}

process TEST {
    publishDir { dirProcessReads(individual_id, sample_id) }, mode: 'link'

    input:
    tuple val(individual_id), val(sample_id)

    script:
    """
    echo '${dirProcessReads(individual_id, sample_id)}'
    """
}

def dirProcessReads(individual_id, sample_id) { 
    return "${sampleBaseDir(individual_id, sample_id)}/processedReads"
}

def sampleBaseDir(individual_id, sample_id) {
    return "${params.analysis_output_dir}/${params.analysis_id}.${individual_id}.${sample_id}"
}

I added a simplified version of this to the e2e tests.

@netlify
Copy link

netlify bot commented Nov 7, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 93f2556
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/690e3a4352145e00083afd79

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in running function within publishDir block

2 participants