bazelbuild / bazelbuild/rules_rust

Support alternative --target values on the same toolchain

Open
#101 6 comments 0 reactions 1 assignee Claimed by @acmcarther View on GitHub
needs-triage
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.