-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
There isn't a reliable way to determine if a given target tuple supports std or not #142296
Copy link
Copy link
Open
Labels
A-targetsArea: Concerning the implications of different compiler targetsArea: Concerning the implications of different compiler targetsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-targetsArea: Concerning the implications of different compiler targetsArea: Concerning the implications of different compiler targetsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Related to #141863. I'd like to implement a reliable
//@ needs-target-stdcompiletest directive, but after some experimentation I found out that we don't really have a reliable way to determine if a given target tuple supports std.Bootstrap, for this reason, has to resort to the hack for determining target std support that is
rust/src/bootstrap/src/core/config/toml/target.rs
Lines 87 to 89 in 100199c
Noratrieb suggested a proper long-term solution (on community discord)
which seems way more principled to me.
rustcsimilarly does not have any way to convey this information. For instance, the closest thing is the target specmetadata.stdfield, but not all built-in target specs actually populate this field1. Built-in target specs currently without std support field (2025-06-10)2:Footnotes
Putting aside that
metadatais really only intended for doc generation purposes and is by no means guaranteed to be reliable ↩Just for expository purposes. ↩