Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expr refactor: quoting in generated javascript is sometimes wrong #46

Closed
mr-c opened this issue Nov 13, 2020 · 4 comments · Fixed by #47
Closed

expr refactor: quoting in generated javascript is sometimes wrong #46

mr-c opened this issue Nov 13, 2020 · 4 comments · Fixed by #47

Comments

@mr-c
Copy link
Member

mr-c commented Nov 13, 2020

@mvdbeek to provide a specific example

@mvdbeek
Copy link

mvdbeek commented Nov 13, 2020

One example is https://github.com/mvdbeek/galaxy/blob/debug_stuff/test/unit/tools/cwl_tools/v1.0/v1.0/count-lines11-null-step-wf-noET.cwl, which results in

#!/usr/bin/env cwl-runner
class: Workflow
id: file:///Users/mvandenb/src/galaxy/test/functional/tools/cwl_tools/v1.0/v1.0/count-lines11-null-step-wf-noET.cwl
inputs: []
outputs:
- id: wc_output
  outputSource: step1/output
  type: File
cwlVersion: v1.0
steps:
- id: step0
  in: []
  out:
  - output
  run:
    class: CommandLineTool
    id: null-expression3-tool.cwl
    inputs: []
    outputs:
    - id: output
      type: Any
    requirements:
    - class: InitialWorkDirRequirement
      listing:
      - entryname: expression.js
        entry: |-
          "use strict";
          var inputs=$/(inputs);
          var runtime=$/(runtime);
          var ret = function(){{'output': null }}();
          process.stdout.write(JSON.stringify(ret));
    hints:
    - class: DockerRequirement
      dockerPull: node:slim
    - class: SoftwareRequirement
      packages:
      - package: nodejs
    cwlVersion: v1.0
    baseCommand:
    - nodejs
    - expression.js
    stdout: cwl.output.json
- id: step1
  in:
  - id: file1
    source: step0/output
    default:
      class: File
      location: whale.txt
  out:
  - output
  run:
    class: CommandLineTool
    id: wc-tool.cwl
    inputs:
    - id: file1
      type: File
    outputs:
    - id: output
      outputBinding:
        glob: output
      type: File
    hints:
    - ramMin: 8
      class: ResourceRequirement
    cwlVersion: v1.0
    baseCommand:
    - wc
    - -l
    stdin: $(inputs.file1.path)
    stdout: output

This is for cwl-utils updated this morning from the master branch.

@mr-c
Copy link
Member Author

mr-c commented Nov 13, 2020

Thanks for this! Found an error in a CWL conformance test and cwltool!

common-workflow-language/cwltool#1369
common-workflow-language/common-workflow-language#916

@mr-c mr-c mentioned this issue Nov 13, 2020
1 task
@mvdbeek
Copy link

mvdbeek commented Nov 13, 2020

I've tried #47 with #916 and it doesn't look quite right ?

#!/usr/bin/env cwl-runner
class: Workflow
id: file:///Users/mvandenb/src/galaxy/test/functional/tools/cwl_tools/v1.0/v1.0/count-lines11-null-step-wf-noET.cwl
inputs: []
outputs:
- id: wc_output
  outputSource: step1/output
  type: File
cwlVersion: v1.0
steps:
- id: step0
  in: []
  out:
  - output
  run:
    class: CommandLineTool
    id: null-expression3-tool.cwl
    inputs: []
    outputs:
    - id: output
      type:
      - 'null'
      - Any
    requirements:
    - class: InitialWorkDirRequirement
      listing:
      - entryname: expression.js
        entry: |-
          "use strict";
          var inputs=$/(inputs);
          var runtime=$/(runtime);
          var ret = function(){{'output': null }}();
          process.stdout.write(JSON.stringify(ret));
    hints:
    - class: DockerRequirement
      dockerPull: node:slim
    - class: SoftwareRequirement
      packages:
      - package: nodejs
    cwlVersion: v1.0
    baseCommand:
    - nodejs
    - expression.js
    stdout: cwl.output.json
- id: step1
  in:
  - id: file1
    source: step0/output
    default:
      class: File
      location: whale.txt
  out:
  - output
  run:
    class: CommandLineTool
    id: wc-tool.cwl
    inputs:
    - id: file1
      type: File
    outputs:
    - id: output
      outputBinding:
        glob: output
      type: File
    hints:
    - ramMin: 8
      class: ResourceRequirement
    cwlVersion: v1.0
    baseCommand:
    - wc
    - -l
    stdin: $(inputs.file1.path)
    stdout: output

- 'null' looks odd (but maybe it's not), and the quoting still seems off.

@mvdbeek
Copy link

mvdbeek commented Nov 13, 2020

OK, used the wrong tool ... sorry.

@mr-c mr-c closed this as completed in #47 Nov 13, 2020
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 a pull request may close this issue.

2 participants