Had a break for lunch so decided to take a look at this issue
I think I found the issue, just need to figure out how to write a test. I used the hello workflow from this example from the user guide.
Running with a debugger:
cwltool --tmpdir-prefix /tmp/cwl/ /tmp/1st-tool.cwl /tmp/echo-job.yml
I had created
/tmp/cwl/, and copied the user guide examples to
/tmp. I set two breakpoints, one in each part where temporary directories are removed in
executors.py and in
executors.py, there’s a line:
if runtime_context.cachedir is None:
The issue is when
"", which was my case when running the hello workflow. That skipped that if statement, and then the temporary directory would not be removed.
If anyone would like to patch
cwltool locally and try the fix, it’s an one-liner change : Remove temporary directories when cache dir is empty string by kinow · Pull Request #1541 · common-workflow-language/cwltool · GitHub