bazelbuild / bazelbuild/rules_rust
Support alternative --target values on the same toolchain
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Currently the stdlib and platform exts are baked into the toolchain as attrs:
https://github.com/bazelbuild/rules_rust/blob/1a05fccbd9b18430cd5ea2b0af1c79d14773870c/rust/toolchain.bzl#L222
... but this doesn't actually match how the Rust compiler works. Any given rust compiler can compile for any target platform provided that the right --target flag, stdlib, and linker are provided[1]. Keeping the current attrs as _defaults_ seems fine, but we should also support retrieving the other stdlibs if an alternative --target is specified.
https://github.com/google/cargo-raze/pull/54 has a little bit of discussion about the high level details of what a given target-triple should mean in terms of config_settings among other things.
[1] https://github.com/japaric/rust-cross#cross-compiling-with-rustc
Contributor guide
Assessment
This issue has not been assessed yet.