Skip to content

cwl-runner --pack is not idempotent #560

Closed
@wgerlach

Description

@wgerlach

Expected Behavior

Running cwl-runner --pack on an already packed (normalized) cwl workflow should create the same file again.

Actual Behavior

Id fields do get an additional path "main":

cwl-runner --pack ./v1.0/null-expression1-tool.cwl ./v1.0/null-expression1-job.json > test.txt
cwl-runner --pack test.txt > test2.txt
diff test*
--- test.txt
+++ test2.txt
@@ -9,13 +9,13 @@
         {
             "type": "Any", 
             "default": "the-default", 
-            "id": "#main/i1"
+            "id": "#main/main/i1"
         }
     ], 
     "outputs": [
         {
             "type": "int", 
-            "id": "#main/output"
+            "id": "#main/main/output"
         }
     ], 
     "expression": "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})", 

Workflow Code

See compliance tests
v1.0/null-expression1-tool.cwl

Full Traceback

NA

Your Environment

  • cwltool version: 1.0.20171017195544
    Check using cwltool --version

Activity

mr-c

mr-c commented on Nov 12, 2017

@mr-c
Member

Thank you @wgerlach for this report; I concur with that this is a bug and this feature should be made to be idempotent.

anton-khodak

anton-khodak commented on Nov 21, 2017

@anton-khodak
Member

Another error (but the same scope) with running a packed workflow:

Tool definition failed initialization:
Tool file contains graph of multiple objects, must specify one of #main, #wc2-tool.cwl
Traceback (most recent call last):
  File "/Users/anton/Programming/CWL/cwltool/cwltool/main.py", line 841, in main
    makeTool, make_tool_kwds)
  File "/Users/anton/Programming/CWL/cwltool/cwltool/load_tool.py", line 249, in make_tool
    urllib.parse.urldefrag(i["id"])[1] for i in resolveduri
cwltool.errors.WorkflowException: Tool file contains graph of multiple objects, must specify one of #main, #wc2-tool.cwl
added a commit that references this issue on Nov 22, 2017
added a commit that references this issue on Nov 28, 2017

Merge pull request #570 from common-workflow-language/fix/#560

6670a19
added a commit that references this issue on Mar 20, 2018
added a commit that references this issue on Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wgerlach@mr-c@anton-khodak

        Issue actions

          cwl-runner --pack is not idempotent · Issue #560 · common-workflow-language/cwltool