rust-lang / rust-forge

Information useful to people contributing to Rust

Home Page:https://forge.rust-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto generate list of supported targets from rustup

gnzlbg opened this issue · comments

Manually maintaining the list of supported targets has never really properly worked. People remember to add new targets every now and then, but nobody remembers to remove old targets.

We should "somehow" use rustup to automatically generate a list of targets, and the components they support. We can then assign them tier1-3 labels manually, but should ideally get a warning / error when a target disappear or a new target each added.

Maybe rust-lang/rust could record the tier of each build artifact, and rustup could allow querying this, so that no manual effort is necessary.

Also note that this reveals the first issue, targets are toolchain dependent, and not all toolchains support all targets. People are probably also interested in both: all targets that Rust supports, and all targets that my toolchain supports.

Maintainers of tools based on Rust, like compiler-explorer (aka godbolt), have issues because they cannot see which targets are available for which toolchains, e.g., compiler-explorer/compiler-explorer#1271 (comment).

This would not need rustup support since the channel toml files are pretty sensible and form a stable interface.

I would be interested in helping to separate out into a vaguely supportable (though still 0.x) crate for managing manifest files if there was interest in sharing the work.

Are there channel toml files for each Rust toolchain release somewhere?

Yes. I've submitted a PR which begins to document this (descriptivist not prescriptivist though, so errors are likely) -- https://static.rust-lang.org/dist/channel-rust-X.YY.Z.toml should exist for any X.YY.Z which was released. It's possible the older v2 manifests as these are called may not be present.

For reference, the PR is here: #227

Thanks!

@gnzlbg Why close this? #227 is a good step to figure out how to fix this issue, but still looks very relevant. rustc --print target-list has 135 targets in today’s Nightly, but tiers.yaml in this repository lists much fewer: #247 (comment)

@SimonSapin i closed this because my use case (installing all available targets) was resolved in the mean time (rustup target add all). If someone wants to print the list of all available targets re-opening sounds good.

image

https://forge.rust-lang.org/release/platform-support.html

I find a duplicated line. Is this issue responsible? or should I create another issue?

@termoshtt It would best if you could create a PR correcting it. The file is in src/release/platform-support.md

I'm going to close this as effectively resolved. The target-tier documentation now lives in rust-lang/rust, and there is validation to ensure that the list is in sync with rustc. It doesn't validate that entries are in the correct tier, but I don't think that can be done from a practical sense (since the tier is driven by CI), though that could possibly be done with metadata in the target spec.