Currently the CARGO_MANIFEST_DIR in build.rs is retrieved at compile time.
According to documentation https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts it is set at execution time as well.
Currently the value, that is set at run-time is ignored.
This breaks caching of the build script, in build systems like bazel, where compilation is executed in sandboxes, and the path is different every time.
Are there any downsides of reading the value at runtime using std::env::var ?
Currently the
CARGO_MANIFEST_DIRin build.rs is retrieved at compile time.According to documentation https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts it is set at execution time as well.
Currently the value, that is set at run-time is ignored.
This breaks caching of the build script, in build systems like bazel, where compilation is executed in sandboxes, and the path is different every time.
Are there any downsides of reading the value at runtime using
std::env::var?