From c5bccca30b03f6dfef5d6efaaafc20fa9b25f164 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 30 Nov 2025 00:59:49 +0000 Subject: command-line-tool: Handle absent arguments field. --- e2e-tests/tests.yaml | 9 +++++++++ e2e-tests/tools/command-line-tool-without-arguments.cwl | 12 ++++++++++++ ravanan/command-line-tool.scm | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 e2e-tests/tools/command-line-tool-without-arguments.cwl diff --git a/e2e-tests/tests.yaml b/e2e-tests/tests.yaml index bc4639c..6f561a8 100644 --- a/e2e-tests/tests.yaml +++ b/e2e-tests/tests.yaml @@ -223,3 +223,12 @@ class: File size: 6 checksum: sha1$d493abaf2d0ffe0bec8d302fdee38a43e80d2a91 +- id: command-line-tool-without-arguments + doc: CommandLineTool without the arguments field + tool: tools/command-line-tool-without-arguments.cwl + job: jobs/hello-world.yaml + output: + output_message: + class: File + size: 13 + checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b diff --git a/e2e-tests/tools/command-line-tool-without-arguments.cwl b/e2e-tests/tools/command-line-tool-without-arguments.cwl new file mode 100644 index 0000000..f0440b0 --- /dev/null +++ b/e2e-tests/tools/command-line-tool-without-arguments.cwl @@ -0,0 +1,12 @@ +cwlVersion: v1.2 +class: CommandLineTool +baseCommand: + - echo +inputs: + message: + type: string + inputBinding: + position: 1 +outputs: + output_message: + type: stdout diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index c1cd53e..fd988f7 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -508,7 +508,8 @@ named @var{name} using tools from Guix manifest in @var{manifest-file} and on (build-command #$(assoc-ref cwl "baseCommand") #$(vector->gexp (vector-map (compose alist->gexp coerce-argument) - (assoc-ref cwl "arguments"))) + (or (assoc-ref cwl "arguments") + #()))) #$(assoc-ref cwl "inputs") inputs)) #$(coerce-expression (assoc-ref cwl "stdin")) -- cgit 1.4.1