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

output block is needed for publishing outputs from workflow #5460

Open
fgroll opened this issue Nov 1, 2024 · 1 comment · May be fixed by #5502
Open

output block is needed for publishing outputs from workflow #5460

fgroll opened this issue Nov 1, 2024 · 1 comment · May be fixed by #5502
Labels

Comments

@fgroll
Copy link

fgroll commented Nov 1, 2024

Bug report

When using the second preview version for publishing outputs from workflows the output block is required for files to be actually published. Nothing needs to be set within the block, output {} is enough for files to be published. Omitting this line prevents any file from being published.

Expected behavior and actual behavior

The documentation for Customizing outputs clearly states that the output block is only needed for customizing the output and can be omitted when the default behaviour is good enough. But that doesn't seem to be the case, as omitting the output block prevents any file from being published.

Steps to reproduce the problem

workflow.nf

#!/usr/bin/env nextflow

nextflow.preview.output = true

process doStuff {
    output:
        path 'file.txt'

    script:
        """
        touch file.txt
        """
}


workflow {
    main:
        println "outputDir: $workflow.outputDir"
        out = doStuff()
        out.view { file -> "Out: ${file}" }

    publish:
        out >> "default"
    
}

// Uncomment the next line to actually publish the output file
// output {}

Run this file once and check with ls to see no results directory

NXF_VER=24.10.0 nextflow run workflow.nf
ls -lh

And then run it again after uncommenting the last line to see the results directory

NXF_VER=24.10.0 nextflow run workflow.nf
ls -lh

Program output

N E X T F L O W  ~  version 24.10.0
Launching `workflow.nf` [hopeful_sanger] DSL2 - revision: d4837e8320
WARN: WORKFLOW OUTPUT DSL IS A PREVIEW FEATURE - SYNTAX AND FUNCTIONALITY CAN CHANGE IN FUTURE RELEASES
outputDir: /absolute/path/to/current/directory/results
[be/c36072] Submitted process > doStuff
Out: /absolute/path/to/current/directory/work/be/c360721f8d99f992ba55284f903b45/file.txt

.nextflow.log

Environment

  • Nextflow version: 24.10.0
  • Java version: openjdk 11.0.13 2021-10-19
  • Operating system: Rocky Linux 8.10 (Green Obsidian)
  • Bash version: GNU bash, version 4.4.20(1)-release
@bentsherman
Copy link
Member

Good catch, and sorry for the confusion. I will fix it (this time with a test case 😅 ) and try to get it into the next patch release

@bentsherman bentsherman added the bug label Nov 4, 2024
@bentsherman bentsherman linked a pull request Nov 13, 2024 that will close this issue
6 tasks
alpae added a commit to DessimozLab/nf-oma-browser-build that referenced this issue Dec 18, 2024
without output {}, nothing is publishded (see
nextflow-io/nextflow#5460 )

if output block is defined, nextflow errors out with
unclear error. leaving like this for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants