Beginner's question: stdin from generated file

I’m very new to CWL, so hopefully this is not too stupid a question. I have a program that receives “instructions” on stdin, as such: mtzutils in foo.mtz out bar.mtz <<< "resolution 3.0". To model this in CWL, I wrote the following (self-contained) cwl file:

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: mtzutils
hints:
  DockerRequirement:
    dockerPull: pegi3s/ccp4
requirements:
  InitialWorkDirRequirement:
    listing:
      - entryname: keywords.txt
        entry: $(inputs.keywords)
inputs:
  input_mtz:
    type: File
    inputBinding:
      position: 0
      prefix: hklin
  output_mtz:
    type: string
    inputBinding:
      position: 1
      prefix: hklout
  keywords:
    type: string
stdin: keywords.txt
      

outputs:
  output_mtz:
    type: File
    outputBinding:
      glob: $(inputs.output_mtz)

As you can see, I’m generating a file keywords.txt using the InitialWorkDirRequirement and then feeding that to stdin.

When I run this with, for instance, this workflow yaml file:

input_mtz:
  class: File
  path: foo.mtz
output_mtz: output.mtz
keywords: |
  resolution 3.0

using cwl-runner foo.cwl foo.yml, I get:

keywords.txt missing from pathmapper

This happens with the toil-cwl-runner as well. The command looks fine to me otherwise.

Anything I’ve missed?

Welcome @pmidden and thanks for your question. Looks like a bug in the CWL runner you are using. I’m guessing you have cwltool installed as cwl-runner. What is the output of cwltool --version?

Thanks for the rapid response. I installed cwltool via pip and it outputs:

...python-3.8.5/bin/cwltool 3.1.20210521105815