-
Notifications
You must be signed in to change notification settings - Fork 106
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
Discrepency between Windows and Linux on generated .ts file location #303
Comments
On Windows the output it looks like this:
While on Linux:
Here's a link to show what the build output in this area should look like in context: https://ci.appveyor.com/project/sharwell/antlr4ts/build/1.0.473#L1187 |
This seems to be related |
The ANTLR tool treats input paths differently if they contain a path separator - but for this check it only uses the default path separator for the current platform. For cases where you have one fixed build command that runs on both Windows and non-Windows systems, you must avoid specifying directory names in the set of input files passed to antlr4ts. See commit 27b9316 for the resolution as applied to this repository. |
I was confused by the title of #307. The fix in that PR is isn't very general, only fixes the problem in this one project. I'm now running into the same problem trying to build Mike's cool looking antlr4-c3. Sam, is it possible to fix the tool to be more platform-neutral? Perhaps Mike's antlr PR above can help. |
@sharwell it sounds like this new I suspect taking advantage of it will be easy, but I've forgotten how to go about merging in and update from the antlr4/antlr4 repository. Any pointers to details? |
Hi, I'm having a similar issue on MacOS when trying to build two .g4 files (one being the lexer and the other being the parser). The two files are located in a sub directory
It seems like antlr4 is looking at the current working directory (or root) instead of the location of the files. However, the workaround mentioned here resolves the issue. |
When the Java part of the antlr4ts-cli tool gets invoked with a grammar file specification of
benchmark/Java.g4
, and-o benchmark/gen/std
, the output goes tobenchmark/gen/std/./Java.ts
on Windowsbenchmark/gen/std/benchmark/Java.ts
on LinuxThis discrepancy currently causes later failures on Linux builds as reported in #252 & #283 during the tsc step, because tsc doesn't find the file in the expected location.
Workaround
The problem seems to be related to specifying relative path names on the
antlr4ts
command line. If your grammar files are in a subdirectory, it may work best to setup a script to run the tool in yourpackage.json
something like this:instead of
The text was updated successfully, but these errors were encountered: