Skip to content

Delete "dirname" also for type Directory#2281

Open
adrabent wants to merge 3 commits into
common-workflow-language:mainfrom
adrabent:patch-1
Open

Delete "dirname" also for type Directory#2281
adrabent wants to merge 3 commits into
common-workflow-language:mainfrom
adrabent:patch-1

Conversation

@adrabent

@adrabent adrabent commented Jun 2, 2026

Copy link
Copy Markdown

Dear developers,

I have observed that suddenly under certain circumstances inputs (of type Directory) are mounted into the WorkDir without having specified it. This may cause conflicts, especially if identical file names are used.

The issue appeared the first time at version 3.2.20260413085819

I have one example (in short).
I have used the InitialWorkDirRequirement to put my inputs msin to:

hints:
   - class: InitialWorkDirRequirement
    listing:
      - entry: $(inputs.msin)
        writable: false

msin itself is correctly mounted to the workDir, but in addition also a second input:

{
        "position": [
            0,
            "flag_transfer_source_ms"
        ],
        "prefix": "flagtransfer.source_ms=",
        "separate": false,
        "datum": {
            "basename": "L667520_123MHz_uv.dp3concat",
            "class": "Directory",
            "dirname": "/ubcCuq",
            "location": "/home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_123MHz_uv",
            "writable": false,
            "path": "/ubcCuq/L667520_123MHz_uv.dp3concat"
        }
    },

Surprisingly, it has put the flag_transfer_source_ms already in the workDir right from the beginning, given by the inputs:

"file:///home/alex/prefactor3-cwl/workflows/linc_target/concat.cwl#concat/dp3concat/flag_transfer_source_ms": {
        "basename": "L667520_123MHz_uv.dp3concat",
        "class": "Directory",
        "dirname": "/ubcCuq",
        "location": "/home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
        "nameext": ".dp3concat",
        "nameroot": "L667520_123MHz_uv",
        "writable": false
    },

The root cause is that dirname became part of the input dictionary itself and is propagated through the entire workflow.
I repeated my workflow with an older cwltool version. There I get from an output of a previous step:

outputs {
    "msout": [
        {
            "basename": "L667520_121MHz_uv.dp3concat",
            "class": "Directory",
            "location": "file:///home/alex/debug/tmp/sx3t5ahe/L667520_121MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_121MHz_uv",
            "writable": true
        }
    ],

And with the new version the dirname became part of the output.

outputs {
    "msout": [
        {
            "basename": "L667520_123MHz_uv.dp3concat",
            "class": "Directory",
            "dirname": "/ubcCuq",
            "location": "file:///home/alex/debug/tmp/7da5clhb/L667520_123MHz_uv.dp3concat",
            "nameext": ".dp3concat",
            "nameroot": "L667520_123MHz_uv",
            "writable": true
        }
    ],

Removing the dirname entry from the output dictionary solves this issue.

Cheers,
Alex

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.88%. Comparing base (8949fc2) to head (a2d0ba3).

❗ There is a different number of reports uploaded between BASE (8949fc2) and HEAD (a2d0ba3). Click for more details.

HEAD has 12 uploads less than BASE
Flag BASE (8949fc2) HEAD (a2d0ba3)
13 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2281       +/-   ##
===========================================
- Coverage   85.10%   71.88%   -13.22%     
===========================================
  Files          46       46               
  Lines        8591     8591               
  Branches     2011     2011               
===========================================
- Hits         7311     6176     -1135     
- Misses        813     1809      +996     
- Partials      467      606      +139     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants