common-workflow-language / common-workflow-language/cwltool

Selected input parameter type is not propagated as output parameter type

Open
#2,039 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

---

## Expected Behavior
cwltool should treat the input type identical to the output type (at least if it accepts two different types)

## Actual Behavior
cwltool crashes, because it always uses the output type `Directory` instead of `Directory[]`

## Workflow Code
```
class: CommandLineTool
cwlVersion: v1.2
id: pass
baseCommand: echo
inputs:
- id: msin
type:
- Directory
- Directory[]
outputs:
- id: msout
type:
- Directory
- Directory[]
outputBinding:
outputEval: $(inputs.msin)
```
I call the command like this:

`cwltool steps/pass.cwl debug.json`

with `debug.json`:
```
{
"msin": [
{"class": "Directory", "path": ""},
{"class": "Directory", "path": ""}
]
}
```

## Full Traceback
```
INFO /usr/local/conda/envs/toil/bin/cwltool 3.1.20240508115724
INFO Resolved 'steps/pass.cwl' to 'file:///home/alex/software/LINC/steps/pass.cwl'
INFO [job pass] /tmp/6scfxd33$ echo

ERROR [job pass] Job error:
("Error collecting output for parameter 'msout': steps/pass.cwl:19:7: Multiple matches for output item that is a single file.", {})
WARNING [job pass] completed permanentFail
{}
WARNING Final process status is permanentFail
```

## Your Environment
* cwltool version: 3.1.20240508115724

## What works
- Removing one element from `debug.json` so that the array has only one element
- Removing `Directory` as a possible output type for `msout`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.