-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow specifying additional target triples in rust_register_toolchain…
…s() 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>
- Loading branch information
Showing
3 changed files
with
33 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters