opened
apaul7
username_0
Hi!

I am attempting to run a tool that requires a directory structure as an input. One issue is that the tool will error out if there are files in the directory that are not the expected type. In our infrastructure we occasionally will have `.md5` files next to the important files which leads to the error in running the tool.

To avoid this issue when launching Cromwell workflows I am attempting to list the good files in the listing attribute of the Directory input data type. The files I list are being staged in the inputs folder for the step but they are not being staged in the input directory folder path. Cromwell uses the empty input directory folder path as input to the tool which causes it to fail. 

Example.cwl
```
#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool

baseCommand: ["ls"]
arguments: ["$(inputs.dir)"]

requirements:
    - class: DockerRequirement
      dockerPull: "ubuntu:xenial"

inputs:
  dir:
    type: Directory

outputs:
  example_out:
    type: stdout

stdout: output.txt
```
Input.yaml:
```
dir: 
  class: Directory
  listing:
  - class: File
    path: ./data/1.txt
  - class: File
    path: ./data/2.txt
```

staged files:
```
=> find inputs/
inputs/
inputs/1465754395
inputs/1465754395/2.txt
inputs/1465754395/1.txt
inputs/-143808698
inputs/-143808698/87e206a9-befc-4977-9a6e-c7a36832385d
inputs/-143808698/87e206a9-befc-4977-9a6e-c7a36832385d/.file
```

And the generated Cromwell command
```
[d14c14d1example.cwl:NA:1]: 'ls' '/cromwell-executions/example.cwl/d14c14d1-ce96-44fc-9315-d1c431011f83/call-example.cwl/inputs/-143808698/87e206a9-befc-4977-9a6e-c7a36832385d'
```


Tested using Cromwell 35 and 37. Cwltool works as expected after adding a basename to the input directory in the yaml. 



<!--
Hi!  Thanks for taking the time to report feedback.

Before posting an issue here, please check whether your question is already answered in our:
  forum  https://gatkforums.broadinstitute.org/wdl/categories/ask-the-wdl-team
  documentation http://cromwell.readthedocs.io/en/develop/

Other forums:
FireCloud https://gatkforums.broadinstitute.org/firecloud/categories/ask-the-firecloud-team
WDL https://gatkforums.broadinstitute.org/wdl/categories/ask-the-wdl-team
CWL https://www.biostars.org/
-->

<!-- Are you seeing something that looks like a bug?  Then great!  You're in the right place.  -->

<!-- Which backend are you running?  -->

<!-- Paste/Attach your workflow if possible: -->

<!-- Paste your configuration if possible, MAKE SURE TO OMIT PASSWORDS, TOKENS AND OTHER SENSITIVE MATERIAL: -->
Staging error for listing attribute in Directory input type
issue
created
geoffjentry
username_1
@username_2 Can you take a look at this and see if its still an issue?
comment
created
cjllanwarne
username_2
I haven't run the workflow manually, but I don't see any commits in the last few releases which would have helped this. I think we should mark this as a bug (even if the "fix" just ends up being a test case to prove that it's fixed)
comment