Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--zig-abi-suffix has no effect #1431

Closed
controversial opened this issue Jan 11, 2023 · 0 comments · Fixed by #1432
Closed

--zig-abi-suffix has no effect #1431

controversial opened this issue Jan 11, 2023 · 0 comments · Fixed by #1432

Comments

@controversial
Copy link
Contributor

napi-rs uses a zig -target of x86_64-linux-gnu.2.17 when cross-compiling for x86_64-unknown-linux-gnu regardless of what value is passed to --zig-abi-suffix (and likewise for aarch64-unknown-linux-gnu)

This is because of a typo as far as I can tell; this expression:

napi-rs/cli/src/build.ts

Lines 333 to 336 in 097c5d6

const zigABIVersion =
this.zigABIVersion ?? (isCrossForLinux && triple.abi === 'gnu')
? DEFAULT_GLIBC_TARGET
: null

always resolves to either DEFAULT_GLIBC_TARGET or null—because the ?? operator has higher precedence than the ternary.

This bug was introduced in #1367.

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 a pull request may close this issue.

1 participant