Skip to content

Parse simulator triple#130

Open
madsmtm wants to merge 1 commit into
bytecodealliance:mainfrom
madsmtm:simulator
Open

Parse simulator triple#130
madsmtm wants to merge 1 commit into
bytecodealliance:mainfrom
madsmtm:simulator

Conversation

@madsmtm
Copy link
Copy Markdown
Contributor

@madsmtm madsmtm commented Apr 17, 2026

This is the LLVM triple, the Environment::Sim is used by rustc

Comment thread src/targets.rs
Uclibceabihf,
Sgx,
/// The name Rust triples use for the iOS simulator environment.
Sim,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target-lexicon used to attempt to support Rust triples, but they turned out to diverge in too many ways, so now target-lexicon is just focusing on LLVM-like triples. So I think this means we should only add the LLVM form of the name, and not the Rust triple form.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk., I think there is a bit of value in supporting both? But I guess that may be because I want to eventually rename the Rust *-apple-darwin triples to *-apple-macos, and then target-lexicon would be able to parse rustc triples again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I'd also be fine with just removing (or deprecating) this variant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've come to understand that Rust target names are not even intended to be parsed. There's nothing in Rust that requires a Rust target name to encode the LLVM target triple or the various target attributes it represents.

With that understanding, users that want to write code that recognizes Rust target names should use something like the platforms crate, and if they want the fields broken out like target-lexicon does, then they should obtain the target triple from the platforms crate and then pass that to target-lexicon.

My preference would be to remove the Rustc forms of the variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants