Skip to content

Rust platform triples should omit and ignore the vendor #1763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Conan-Kudo opened this issue Oct 4, 2016 · 4 comments
Open

Rust platform triples should omit and ignore the vendor #1763

Conan-Kudo opened this issue Oct 4, 2016 · 4 comments
Labels
T-dev-tools Relevant to the development tools team, which will review and decide on the RFC.

Comments

@Conan-Kudo
Copy link

Currently, rust and cargo use the full platform identity for identifying platforms (<arch>-<vendor>-<os>[-<libc]).

However, the vendor attribute in a platform identity (commonly known as platform triples) is a private attribute intended to indicate variants and configurations. For example, RH/Fedora based distros use <arch>-redhat-linux-gnu for the platform identity, Mageia based ones use <arch>-mageia-linux-gnu, and so on. However, for the purposes of determining platform equivalence, only arch, os, and libc matter.

The tooling should be changed to ignore the vendor attribute and platforms should be similarly altered so that the platform triple should only contain the meaningful attributes.

For example, instead of saying x86_64-unknown-linux-gnu, it would be x86_64-linux-gnu. Alternatively, simply forcing the vendor to always be considered something generic (like pc) would be sufficient.

The vendor attribute is meaningful to humans, but not tools.

@codyps
Copy link

codyps commented Oct 4, 2016

Ideally the rust triple wouldn't be examined at all except to locate our target config. That isn't quite the case (especially due to the move towards rustbuild using scanning the target triple a bit more to replace the platform cfg), but it's a decent goal to decouple meaning the triple from it's value (say no to triple parsing).

That said, as soon as we admit that folks may have different configurations that aren't represented by arch-os-libc, they need a way to disambiguate them. Right now, vendor can be used for that purpose, so I don't think we can drop it entirely. That said, it might be possible for the builtin targets to drop their vendors... if we had yet to release them. At the moment, lots of Cargo.toml's, and builds that pass --target, and things that use rustup to download std expect certain targets to have the vendor included, so we can't just remove it without breaking those users.

There might be a place for providing documented rules for how rust target triples should be used/created in the future, though.

@Conan-Kudo
Copy link
Author

Conan-Kudo commented Oct 4, 2016

@jmesmon Maybe vendor aliases could be implemented? For example, if Fedora's rust triple is <arch>-redhat-linux-gnu, the platform configuration could also accept unknown and pc (the generic names) and direct it to the native redhat vendor configuration? That gives you some flexibility you didn't have before, too, as you can identify compatible platforms easily by vendor aliases.

@codyps
Copy link

codyps commented Oct 4, 2016

I guess I'd be looking for a real problem that we're solving at that point:

  • What specific problem does fix? ie: is there a specific thing that is impossible to avoid without aliases?
  • how is such a database of aliases maintained?
  • how can we guarantee the aliases are always compatible when rustc doesn't control some of the targets? (or does it control the targets)?

@nagisa
Copy link
Member

nagisa commented Oct 4, 2016

Duplicate-ish of rust-lang/rust#33147

@nrc nrc added the T-dev-tools Relevant to the development tools team, which will review and decide on the RFC. label Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-dev-tools Relevant to the development tools team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

4 participants