rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Add `x86_64-unknown-none` as a Tier 2 target

Open SlyMarbo opened this issue 2 years ago • 5 comments

As announced in rust-lang/rust#95705, x86_64-unknown-none is now a Tier 2 target with distributed build artefacts. It would be great to be able to use this in extra_target_triples in rust_register_toolchains, but it's currently missing from some of the lists in rust/platform/tiple_mappings.bzl.

Would it be possible to add this? I reckon it should take us a lot of the way to being able to cross-compile to x86_64-unknown-none natively. I'm very happy to help out with testing if that would help. Many thanks.

SlyMarbo avatar Apr 14 '22 22:04 SlyMarbo

What would this platform be represented as? The problem with some of the triples supported by rust is that some platforms are indistinguishable from others given the lack of constraints commonly available in Bazel (related to https://github.com/bazelbuild/platforms/issues/38). As long as the triple isn't going to conflict with another, I think it'd be fine to add.

UebelAndre avatar Apr 15 '22 12:04 UebelAndre

Good question. I'll have a think about how you'd represent it.

SlyMarbo avatar Apr 15 '22 13:04 SlyMarbo

Would the combination of cpu = "x86_64" and os = "none" work? Sorry if I've misunderstood the question.

SlyMarbo avatar Apr 16 '22 09:04 SlyMarbo

Would the combination of cpu = "x86_64" and os = "none" work? Sorry if I've misunderstood the question.

This sounds reasonable to me and that the combination of those constraints wouldn't match another platform triple. Seems like a reasonable addition to me. Do you want to open a pull request? I'd be happy to review 😄

UebelAndre avatar Apr 16 '22 14:04 UebelAndre

I'm happy to try, but I'm not familiar with the code in rust/platform/triple_mappings.bzl so I'm not confident I'd make all the necessary changes.

SlyMarbo avatar Apr 16 '22 15:04 SlyMarbo