bazelbuild / bazelbuild/rules_rust
Rust link arguments are not passed transitively to dependant rust targets
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Simple repro case is [in this branch](https://github.com/bazelbuild/rules_rust/compare/master...SirVer:link_example?expand=1).
`bazel run @examples//hello_world` exposes the problem.
The example is a simple dependency chain: `rust_binary` ("hello_world") depends on `rust_library` ("hello_from_c_sys") which depends on `cc_library` ("hello_from_c"). The c library requires c++, therefore needs linking with `-lstdc++`. It should be sufficient to specify this in the `rust_library` rule, but right now all `rust_binary` rules that transitively depend on the lib need to specify it as well: https://github.com/bazelbuild/rules_rust/compare/master...SirVer:link_example?expand=1#diff-e85472ad14a7cde9a8510d9beae332c5R18
Contributor guide
Assessment
This issue has not been assessed yet.