Skip to content

Strict parser doesn't add ext properties to task hash #6695

@bentsherman

Description

@bentsherman

Bug report

Minimal example:

// main.nf

process EXAMPLE_EXT {

    script:
    """
    echo "args = ${task.ext.args}"
    """
}

workflow {
    EXAMPLE_EXT()
}
// nextflow.config

process {
    withName: 'EXAMPLE_EXT' {
        ext.args = "--some-param value"
    }
}

Nextflow should add the value of task.ext.args to the task hash, so that changing this value re-executes the task on resume, just like changing a regular input.

However, Nextflow 25.10 with the strict parser does not do this.

I believe it's because the strict parser doesn't apply the VariableVisitor, which collects all variable references in the process body. The task processor gets the task ext references from this list.

I think I originally neglected this piece because I wanted to discourage the use of external variables in the process body. The strict parser already disallows most global variables in the process body. However, since we haven't validated any good replacement for task ext, I think we should just support it for now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions