From 15de587cc7efeaefdd06da8b18f9f21fb9b43a26 Mon Sep 17 00:00:00 2001 From: stxue1 Date: Thu, 7 Nov 2024 13:10:15 -0800 Subject: [PATCH] Do not reset listingn in workflows --- src/toil/cwl/cwltoil.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py index 3a57418da6..03b56258e0 100644 --- a/src/toil/cwl/cwltoil.py +++ b/src/toil/cwl/cwltoil.py @@ -4142,12 +4142,16 @@ def main(args: Optional[list[str]] = None, stdout: TextIO = sys.stdout) -> int: # ToilFsAccess needs to be set up if we want to be able to use # URLs. builder = tool._init_job(initialized_job_order, runtime_context) - - # make sure this doesn't add listing items; if shallow_listing is - # selected, it will discover dirs one deep and then again later on - # (probably when the cwltool builder gets ahold of the job in the - # CWL job's run()), producing 2+ deep listings instead of only 1. - builder.loadListing = "no_listing" + if not isinstance(tool, cwltool.workflow.Workflow): + # make sure this doesn't add listing items; if shallow_listing is + # selected, it will discover dirs one deep and then again later on + # (when the cwltool builder gets constructed from the job in the + # CommandLineTool's job() method, + # see https://github.com/common-workflow-language/cwltool/blob/9cda157cb4380e9d30dec29f0452c56d0c10d064/cwltool/command_line_tool.py#L951), + # producing 2+ deep listings instead of only 1. + # ExpressionTool also uses a builder, see https://github.com/common-workflow-language/cwltool/blob/9cda157cb4380e9d30dec29f0452c56d0c10d064/cwltool/command_line_tool.py#L207 + # Workflows don't need this because they don't go through CommandLineTool or ExpressionTool + builder.loadListing = "no_listing" builder.bind_input( tool.inputs_record_schema,