Skip to content

request: a flag to limit target list results by support tier level #3308

Open
@mcandre

Description

@mcandre

Problem you are trying to solve

Hi,

I want to loop over the tier 1 and tier 2 targets and cross-compile my Rust apps for these platforms. I do this for my Rust projects in order to make it easier for non-Rust users to enjoy my command line tools!

I have a working script to do just that, called crit, based on the excellent cross tool.

https://github.com/mcandre/crit

This works (yay!) for about 80% of the available triples from rustup target list. Unfortunately, it requires hardcoding target triples to skip over, namely the tier 3 triples, for which the cross community has yet to publish stable Docker images.

Over time, this triple exclusion hardcoding represents some extra maintenance and fragility. I would prefer that rustup be able to filter by support tier as a built-in capability.

There is an HTML source of truth to get this data:

https://doc.rust-lang.org/rustc/platform-support.html

But of course HTML is not the most friendly or robust way to query the information in an automated fashion.

Solution you'd like

I would love for rustup target list to accept an optional flag, like --max-support-tier <n>.

When present, the flag elides target triples from the console output whose support tier is known to be larger than n.

Alternatively, add a new column to the target triple output lines, indicating the support tier number. Then, we still have an automated source of truth, which downstream CLI tools could reasonably handle parsing with simple regular expressions / awk / etc.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions