bazelbuild / bazelbuild/rules_rust
C++ deps double-building on cargo_build_script targets
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Right now, if we need to get a linker search path in a build script (e.g. to set `$OPENSSL_DIR`), we typically end up double-compiling C++ deps.
Typically one add a `compile_data` dep which is actually linked against. But one also adds a `build_script_data` dep which is just present so we can refer to the target in an `$(execpath)` macro in the cargo build script.
Because the `cargo_build_script` is compiled in the exec configuration, its data ends up being compiled in the exec configuration just so that we can extract a path.
While we could fake out these paths somehow, ideally the `cargo_build_script` machinery would allow us to pass a target-configured dep as data so we can `$(execpath)` it for the purposes of the dependent target.
Contributor guide
Assessment
This issue has not been assessed yet.