From 3ff64e4504badcd9f76954e2cd40af123473f68a 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/toil/cwl/cwltoil.py b/src/toil/cwl/cwltoil.py index 482f098bab..feccb6793b 100644 --- a/src/toil/cwl/cwltoil.py +++ b/src/toil/cwl/cwltoil.py @@ -4186,6 +4186,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) + 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" # make sure this doesn't add listing items; if shallow_listing is # selected, it will discover dirs one deep and then again later on