commit | bf59038cac11798cbaef9f3bf965bad8182b97fa | [log] [tgz] |
---|---|---|
author | Denis Koroskin <dkoroskin@fb.com> | Wed Mar 09 13:46:37 2022 -0800 |
committer | GitHub <noreply@github.com> | Wed Mar 09 13:46:37 2022 -0800 |
tree | 298768c1b3e0063c8ed254957fe778d3f6650104 | |
parent | 348c3e31667ad0e73d3e0b19b372061c14ee8d58 [diff] |
Allow specifying additional target triples in rust_register_toolchains() and fix androideabi system (#1181) * Allow specifying additional target triples in rust_register_toolchains() and fix androideabi system In addition to host target, "wasm32-unknown-unknown" and "wasm32-wasi" targets are being installed, which includes downloading corresponding rust-std libraries. This CL allow specifying custom additional target triples by introducing a new parameter to rust_register_toolchains(), which defaults to ["wasm32-unknown-unknown" and "wasm32-wasi"] for compatibility. As an example, it is now possible to compile for Android if ["armv7-linux-androideabi"] is specified as an extra_target_triples. Specifically for Android, most of the required infrastructure was already in place. For example, @rules_rust//rust/platform:triple_mappings.bzl already has all the necessary information to compile Android libraries (e.g. _SYSTEM_TO_STDLIB_LINKFLAGS). However, "armv7-linux-androideabi" is not a 'proper' target tripple because 'androideabi' is not a proper system. As such, special handling is required to map 'androideabi' back to 'android'. * Extract common triple decomposition logic into a helper method that returns a struct with the fields populated. * Use triple() function from triple.bzl * Restore removed methods, and add deprecation message. Co-authored-by: Denis Koroskin <dkoroskin@google.com>
This repository provides rules for building Rust projects with Bazel.
General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust
.
Please refer to the full documentation.