Open dolevrahat opened 3 years ago
Thank you for pointing this out. We will fix #2 in the next version of the WDL spec. For the other two points, this is a major downside of the ANTLR4 parser. I'll keep looking for a way to improve the error message.
Hello
I have encountered the following problem:
I have a workflow that contains (among others) the two tasks GetBwaVersion and MergeBamAlignment. MergeBamAlignment takes as an input the output of GetBwaVersion.
When I attempted to compile this workflow I got the following error message:
As it turned out (after considerable frustration), the cause of this error is that version is apparently a reserved keyword in WDL, and thus naming the output of GetBwaVersion version resulted in the parser failing to find an identifier for this output.
I see three issues that make this difficult to debug: 1. Uninformative error message: The way this error message is phrased, it is very difficult to infer that the problem is the use of a reserved keyword. It would have been very helpful had the parser indicated this explicitly. 2. Lacunae in the documentation: I was unable to find any mention of the fact that version is a reserved keyword. It does not appear in the list of reserved keywords in the WDL specfications. I infer that it is a reserved keyword based on the fact that replacing the output name from version to _bwaversion resulted in a successful compilation of the workflow, and also from the following clause in the wdlTools code:
(source: https://github.com/dnanexus-rnd/wdlTools/blob/682efa4151c17dbeff627832d7f491df0436fc5f/src/test/scala/wdlTools/syntax/v1/ConcreteSyntaxV1Test.scala) 3. Inconsistent error messages between task and call: At same point I switched the name of the task output to _bwaversion but forgot to change it in the call to MergeBamAlignment. This resulted in the following cryptic error message:
The line numbers in the error message correspond to the call to MergeBamAlignment, but suggest a localized syntax problem such as a misplaced comma/newline and not an inconsistency between the name of the output of the task definition and its name in the call. I assume that this is also caused by the use of a reserved keyword. To test this, I changed the output name in the task to _bwaversion and set the input of the call to
bwa_version = GetBwaVersion.bwa_version2
Which resulted in the much more informative error message: