antlr4rust
antlr4rust copied to clipboard
Dependency gets recompiled every time due to rerun-if-changed with non-existing path
The build.rs
references a local antlr.jar that usually does not exist when using antlr4rust as a dependency. This seems to trigger a full rebuild every time, according to a cargo issue that is the expected behaviour.
I can imagine two solutions, either check in the antlr.jar
so it can be referenced using a local file (but not sure about the license implications), or the build.rs
logic could be triggered only when an environment variable is set, since this seems to be needed for tests only. Detecting the test profile from within build.rs
does not seem to be possible yet.