Open madsmtm opened 6 days ago
Another solution would be to rename rustc
's macOS targets to *-apple-macos
, which is desirable anyhow. But that's a complicated process.
This is also relevant for figuring out how to parse deployment targets for iOS/tvOS/watchOS/visionOS targets (since what we do here depends on what target-lexicon
intends on supporting).
I see that this has also been discussed a bit in https://github.com/bytecodealliance/target-lexicon/issues/78.
target-lexicon was written at a time when there was a combination of a lack of alternatives, and a lack of understanding on my part of the relationship between rust target names and LLVM target names.
If one only wants to work with Rust target names now, it may be better to switch to the platforms crate instead.
Perhaps this means that target-lexicon should ideally migrate to focusing only on LLVM target names.
It isn't really clear from the documentation whether this crate parses LLVM or rustc target triples, and that's probably because it tries to parse both.
This is problematic though, in particular the triple
aarch64-apple-darwin
is from my understanding ambiguous?aarch64-apple-macosx
.-miphoneos-version-min=...
.Would it make sense to say "
FromStr
only parsesrustc
triples", or "FromStr
only parses LLVM triples"? Or maybe addTriple::from_llvm(&str) -> Result<Self>
andTriple::from_rustc(&str) -> Result<Self>
, and removeFromStr
?