miniwdl icon indicating copy to clipboard operation
miniwdl copied to clipboard

Standard library function `read_bool` does not support whitespace or capitalization

Open stxue1 opened this issue 8 months ago • 0 comments

The WDL spec says read_boolean is whitespace and case insensitive when calling read_bool.

However, MiniWDK is unable to run the following workflow:

version 1.1

task read_bool {
  command <<<
  printf "  true  \n" > true_file
  printf "  FALSE  \n" > false_file
  >>>

  output {
    Boolean b1 = read_boolean("true_file")
    Boolean b2 = read_boolean("false_file")
  }
}
2024-07-02 18:01:16.858 wdl.t:read_bool task setup :: name: "read_bool", source: "/home/heaucques/Documents/wdl-conformance-tests/unit_tests/read_bool_task.wdl", line: 3, column: 1, dir: "/home/heaucques/Documents/wdl-conformance-tests/20240702_180116_read_bool", thread: 125767233647744
2024-07-02 18:01:16.997 wdl.t:read_bool docker swarm lists existing miniwdl-related services. This is normal if other miniwdl processes are running concurrently; otherwise, stale state could interfere with this run. To reset it, `docker swarm leave --force`
2024-07-02 18:01:16.998 wdl.t:read_bool docker swarm resources :: workers: 1, max_cpus: 8, max_mem_bytes: 12270206976, total_cpus: 8, total_mem_bytes: 12270206976
2024-07-02 18:01:17.008 wdl.t:read_bool docker image :: tag: "ubuntu:20.04", id: "sha256:5f5250218d28ad6612bf653eced407165dd6475a4daf9210b299fed991e172e9", RepoDigest: "ubuntu@sha256:0b897358ff6624825fb50d20ffb605ab0eaea77ced0adb8c6a4b756513dec6fc"
2024-07-02 18:01:18.762 wdl.t:read_bool docker task exit :: state: "complete", exit_code: 0
2024-07-02 18:01:19.333 wdl.t:read_bool task read_bool (/home/heaucques/Documents/wdl-conformance-tests/unit_tests/read_bool_task.wdl Ln 3 Col 1) failed :: dir: "/home/heaucques/Documents/wdl-conformance-tests/20240702_180116_read_bool", error: "EvalError", message: "function evaluation failed, read_boolean(): file content is not \"true\" or \"false\"", node: "decl-b1", pos: {"source": "/home/heaucques/Documents/wdl-conformance-tests/unit_tests/read_bool_task.wdl", "line": 10, "column": 18}
2024-07-02 18:01:19.334 miniwdl-run function evaluation failed, read_boolean(): file content is not "true" or "false" :: error: "EvalError", node: "decl-b1", pos: {"source": "/home/heaucques/Documents/wdl-conformance-tests/unit_tests/read_bool_task.wdl", "line": 10, "column": 18}, dir: "/home/heaucques/Documents/wdl-conformance-tests/20240702_180116_read_bool"

Only when removing the whitespace and lowercasing the values does the WDL work.

version 1.1

task read_bool {
  command <<<
  printf "true" > true_file
  printf "false" > false_file
  >>>

  output {
    Boolean b1 = read_boolean("true_file")
    Boolean b2 = read_boolean("false_file")
  }
}

stxue1 avatar Jul 03 '24 01:07 stxue1