-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(env_host_tuple)]
This adds the current host tuple (AKA target triple) to std::env
.
The goal is to remove the need for using build scripts to save Cargo's TARGET
env var (example). Tools invoking cargo
often need to know the platform's default target in order to add a matching --target <tuple>
arg.
It uses the term "tuple" instead of "triple", because the "host tuple" terminology has been decided in: #125579 (comment)
It uses the term "host", because:
- after
std
has been built, its compilation target becomes the host for programs using it. - during cross-compilation, Cargo's
build.rs
scripts will get the same tuple in theHOST
env var, but a differentTARGET
. - the term "target" is overloaded in Rust/Cargo.
Public API
std::env::consts::HOST_TUPLE: &str
Steps / History
- Implementation: Current platform's target tuple in std::env::consts #146296
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
@rustbot label -S-tracking-unimplemented
Footnotes
fmease and tgross35
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.