target-lexicon-mit
RustMIT-licensed, API-compatible subset of target-lexicon for parsing and formatting target triples such as x86_64-unknown-linux-gnu. Drop-in replacement for the Apache-2.0 WITH LLVM-exception crate via [patch.crates-io].
Languages
target-lexicon-mit
An MIT-licensed replacement for the target-lexicon crate, providing the subset of
its API that PyO3's build configuration (pyo3-build-config) uses: parsing and
formatting target triples and reporting the host triple.
The upstream crate is licensed Apache-2.0 WITH LLVM-exception. This crate is
written from scratch against the public behaviour of target triples and is
licensed MIT only.
Use as a drop-in replacement
Keep the normal target-lexicon = "0.13" requirement and patch it in the
consuming workspace's root Cargo.toml:
[patch.crates-io]
target-lexicon = { git = "https://github.com/tpt-solutions/target-lexicon-mit", rev = "<commit>" }
For a local checkout, use { path = "../target-lexicon-mit" } instead.
Scope
Triplewitharchitecture,vendor,operating_system,environmentandbinary_format, plusFromStr,DisplayandTriple::host().Architecture,Vendor,OperatingSystem,EnvironmentandBinaryFormatenums. Unrecognised components are kept asOther(String)instead of being rejected, so unusual triples still round-trip.- The
triple!macro, for constants and tests.
It is not a full port of the upstream crate. Variants that are not listed above
are not provided. Add them as Other values or new variants when a consumer needs
them.
Licence
MIT. See LICENSE-MIT.