Make CARGO_BUILD_TARGET
accept multiple target triples
#14820
Labels
A-configuration
Area: cargo config files and env vars
A-cross-compiling
Area: using --target flag for other platforms
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Problem
It is really nice that Cargo supports compiling for multiple platform target triples (not to be confused with the artifacts that Cargo produces). However, it is inconvenient that this capability does not extend to
CARGO_BUILD_TARGET
.Proposed Solution
Make
CARGO_BUILD_TARGET
take multiple values, potentially comma-separated, such thatCARGO_BUILD_TARGET=aarch64-apple-darwin,aarch64-apple-ios cargo build
would work the same ascargo build --target aarch64-apple-darwin --target aarch64-apple-ios
.Perhaps we could even extend
--target
to allow comma-separated target triples too?As a bit of prior art,
x.py
in rust-lang/rust supports comma-separated target triples.Notes
This wouldn't work with custom target triple paths that contain commas. How common are these? And would it be okay to break, since custom target json specs are unstable anyhow?
This was also discussed in #10473, but nothing further was done about this yet (from my understanding?)
The text was updated successfully, but these errors were encountered: