You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running cargo build results in couldn't read target/debug/build/xmd-lalrpop-<id>/out/src/calculator1.lalrpop: no such file or directory.
I can get the build script to finish if I use lalrpop_mod!(pub calculator1, "/../../../../../src/calculator1.lalrpop") but that really doesn't look like the intended way to use the macro.
Using cargo -Vcargo 1.60.0 (d1fd9fe 2022-03-01)
Project layout based on calculator example example:
I found the reason for this. It is because in the macro lalrpop_mod! it looks for the file in env!("OUT_DIR")/argument-given-to-macro
The issue comes with the fact that cargo sets OUT_DIR on build. so when OUT_DIR=foobar cargo build is run, OUT_DIR gets set to the binary output dir, rather than foobar
the fix for this is to change the enviroment variable used inside lalrpop_mod! to something like LALRPOP_OUT_DIR
Running
cargo build
results incouldn't read target/debug/build/xmd-lalrpop-<id>/out/src/calculator1.lalrpop: no such file or directory
.I can get the build script to finish if I use
lalrpop_mod!(pub calculator1, "/../../../../../src/calculator1.lalrpop")
but that really doesn't look like the intended way to use the macro.Using
cargo -V
cargo 1.60.0 (d1fd9fe 2022-03-01)
Project layout based on calculator example example:
src/lib.rs:
The text was updated successfully, but these errors were encountered: