Skip to content

std.Build: check for native CPU when serializing CrossTarget#16860

Merged
andrewrk merged 1 commit intoziglang:masterfrom
mlugg:fix/build-native-cpu
Aug 17, 2023
Merged

std.Build: check for native CPU when serializing CrossTarget#16860
andrewrk merged 1 commit intoziglang:masterfrom
mlugg:fix/build-native-cpu

Conversation

@mlugg
Copy link
Member

@mlugg mlugg commented Aug 16, 2023

When using std.Build.dependency with target options, dependencies
would sometimes get targets which are equivalent but have distinct
names, e.g. native vs native-native. This is a somewhat broad issue,
and it's unclear how to fix it more generally - perhaps we should
special-case CrossTarget in options passing, or maybe targets should
have a canonical name which we guarantee to use everywhere aside from
raw user input.

However, this commit fixes the most egregious issue, which was an active
blocker to using the package manager for some users. This was caused by
the CPU changing from native to a specific descriptor (e.g.
skylake+sgx), which then changed the behavior of zigTriple.

Resolves: #16856

When using `std.Build.dependency` with target options, dependencies
would sometimes get targets which are equivalent but have distinct
names, e.g. `native` vs `native-native`. This is a somewhat broad issue,
and it's unclear how to fix it more generally - perhaps we should
special-case CrossTarget in options passing, or maybe targets should
have a canonical name which we guarantee to use everywhere aside from
raw user input.

However, this commit fixes the most egregious issue, which was an active
blocker to using the package manager for some users. This was caused by
the CPU changing from `native` to a specific descriptor (e.g.
`skylake+sgx`), which then changed the behavior of `zigTriple`.

Resolves: ziglang#16856
@andrewrk andrewrk merged commit 000aa30 into ziglang:master Aug 17, 2023
@andrewrk
Copy link
Member

Thanks.

@mlugg mlugg deleted the fix/build-native-cpu branch May 18, 2025 20:08
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.

build: regression: file exists in multiple modules with same module twice in dependency tree

2 participants