Skip to content

Commit b1d3e00

Browse files
authored
chore(deps): upgrade napi to remove linker args that skip missing symbols (#15323)
1 parent 3f7e73e commit b1d3e00

File tree

3 files changed

+33
-56
lines changed

3 files changed

+33
-56
lines changed

.cargo/config.toml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ allocs = "run -p oxc_track_memory_allocations --profile coverage --"
1111
rule = "run -p rulegen"
1212
lintgen = "run -p oxc_linter_codegen"
1313

14-
# Fix napi breaking in test environment <https://github.com/napi-rs/napi-rs/issues/1005#issuecomment-1011034770>
15-
# To be able to run unit tests on macOS, support compilation to 'x86_64-apple-darwin'.
16-
[target.'cfg(target_vendor = "apple")']
17-
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup,-no_fixup_chains"]
18-
1914
[target.x86_64-pc-windows-msvc]
2015
rustflags = ["-C", "target-feature=+crt-static"]
2116

@@ -25,28 +20,18 @@ rustflags = ["-C", "target-feature=+crt-static"]
2520
[target.aarch64-pc-windows-msvc]
2621
rustflags = ["-C", "target-feature=+crt-static"]
2722

28-
# To be able to run unit tests on Windows, support compilation to 'x86_64-pc-windows-msvc'.
29-
# Use Hybrid CRT to reduce the size of the binary (Coming by default with Windows 10 and later versions).
3023
[target.'cfg(target_os = "windows")']
3124
rustflags = [
32-
"-C",
33-
"link-args=/FORCE",
25+
# Disables linking against the default Universal C Runtime (libucrt.lib). This prevents conflicts if another CRT library is linked manually.
3426
"-C",
3527
"link-args=/NODEFAULTLIB:libucrt.lib",
28+
# Manually adds ucrt.lib (the Universal CRT) as a default library to link against, replacing the one you just excluded above.
29+
# This ensures consistent linking when multiple CRTs might be available.
3630
"-C",
3731
"link-args=/DEFAULTLIB:ucrt.lib",
3832
]
3933

40-
# Addresses a potential segmentation fault issue that occurs when
41-
# running napi-rs within a Node.js worker thread on GNU/Linux systems.
42-
# See https://x.com/Brooooook_lyn/status/1895848334692401270
43-
[target.'cfg(target_env = "gnu")']
44-
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]
45-
46-
[target.'cfg(target_os = "linux")']
47-
rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"]
48-
4934
# LLD linker is currently broken for us, opt out.
5035
# https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/#what-s-in-1-90-0-stable
5136
[target.x86_64-unknown-linux-gnu]
52-
rustflags = ["-C", "linker-features=-lld", "-C", "link-args=-Wl,--warn-unresolved-symbols"]
37+
rustflags = ["-C", "linker-features=-lld"]

.github/workflows/ci.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ jobs:
2626
save-cache: ${{ github.ref_name == 'main' }}
2727
cache-key: warm
2828
- run: cargo ck
29-
- run: cargo test --workspace --all-features --exclude website
30-
- run: cargo test -p website # Run separately to avoid feature unification problems with `oxlint`
29+
- run: cargo test --workspace --all-features
3130
- run: git diff --exit-code # Must commit everything
3231

3332
test-ubuntu-aarch64:
@@ -42,8 +41,7 @@ jobs:
4241
save-cache: ${{ github.ref_name == 'main' }}
4342
cache-key: warm-aarch64
4443
- run: cargo ck
45-
- run: cargo test --workspace --all-features --exclude website
46-
- run: cargo test -p website # Run separately to avoid feature unification problems with `oxlint`
44+
- run: cargo test --workspace --all-features
4745
- run: git diff --exit-code # Must commit everything
4846

4947
test-mac: # Separate job to save a job on PRs
@@ -58,8 +56,7 @@ jobs:
5856
save-cache: ${{ github.ref_name == 'main' }}
5957
cache-key: warm
6058
- run: cargo ck
61-
- run: cargo test --workspace --all-features --exclude website
62-
- run: cargo test -p website # Run separately to avoid feature unification problems with `oxlint`
59+
- run: cargo test --workspace --all-features
6360
- run: git diff --exit-code # Must commit everything
6461

6562
test-windows:
@@ -104,9 +101,7 @@ jobs:
104101
- name: Run tests
105102
# No need for `cargo ck` because it's already checked in linux
106103
# Run `website` tests separately to avoid feature unification problems with `oxlint`
107-
run: |
108-
cargo test --workspace --all-features --exclude website
109-
cargo test -p website
104+
run: cargo test --workspace --all-features
110105
working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}
111106
shell: bash
112107

@@ -125,10 +120,7 @@ jobs:
125120
- run: cross --version
126121
# `--lib --bins --tests` to skip doctests which are very slow to run via `cross`.
127122
# https://github.com/cross-rs/cross/issues/1703
128-
# Exclude NAPI crates because of linker errors.
129-
- run: cross test --workspace --lib --bins --tests --all-features --exclude website --exclude oxc_minify_napi --exclude oxc_parser_napi --exclude oxc_playground_napi --exclude oxc_transform_napi --target s390x-unknown-linux-gnu
130-
# Run separately to avoid feature unification problems with `oxlint`
131-
- run: cross test -p website --target s390x-unknown-linux-gnu
123+
- run: cross test --workspace --lib --bins --tests --all-features --target s390x-unknown-linux-gnu
132124

133125
test-wasm32-wasip1-threads:
134126
name: Test wasm32-wasip1-threads

Cargo.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)