target-lexicon OS sometimes doesn't match rustc target jsons
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by comparing target-lexicon's parsed OS values with rustc target-spec JSON for i686-linux-android and aarch64-apple-darwin, using the rustc command shown in the issue. Read the target parsing and OS-mapping code, then check existing tests for these triples. Done means the intended naming behavior is agreed and the discrepancies are covered by passing regression tests.
Written by the indexing model from the issue text.
Description
I've been playing around with target-lexicon a bit and it seems like while most of the time it is pretty faithful to the rustc target json, some of the time the result diverges.
For example, i686-linux-android has this rustc target JSON:
$ RUSTC_BOOTSTRAP=1 rustc -Z unstable-options --target=i686-linux-android --print target-spec-json
{
"arch": "x86",
"cpu": "pentiumpro",
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128",
"default-uwtable": true,
"dwarf-version": 2,
"dynamic-linking": true,
"env": "gnu",
"executables": true,
"features": "+mmx,+sse,+sse2,+sse3,+ssse3",
"has-rpath": true,
"is-builtin": true,
"llvm-target": "i686-linux-android",
"max-atomic-width": 64,
"os": "android",
"position-independent-executables": true,
"pre-link-args": {
"gcc": [
"-Wl,--allow-multiple-definition"
]
},
"relro-level": "full",
"stack-probes": {
"kind": "call"
},
"target-family": [
"unix"
],
"target-pointer-width": "32"
}
However, target-lexicon parses the same triple as having the OS Linux rather than Android.
Somewhat related, for "aarch64-apple-darwin":
- rustc has
"os": "macos" - target-lexicon parses this as Darwin
I'm not sure exactly what behavior is desired here but I thought it might be useful to flag this. Thanks!
- Dominant language
- Rust
- Stars
- 60
- Forks
- 71
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/target-lexicon
-
Remove build script?Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
bytecodealliance/target-lexicon#112 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
bytecodealliance/target-lexicon#76 · 7 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
bytecodealliance/target-lexicon#63 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in bytecodealliance/target-lexicon
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-challenge/player_rust#22 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
foundry-rs/foundry#17175 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
state:triage-needed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github/copilot-sdk#2793 ·
Maintainers usually reply within 1 day