rrevenantt / antlr4rust

ANTLR4 parser generator runtime for Rust programming laguage
Other
398 stars 70 forks source link

Dependency gets recompiled every time due to rerun-if-changed with non-existing path #32

Open jhorstmann opened 2 years ago

jhorstmann commented 2 years ago

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.