Fix CI for latest rustc nightly#5152
Merged
Merged
Conversation
Nightly Rust as of 2026-05-06 no longer implicitly exports __heap_base/__data_end on wasm32-unknown-unknown. wasm-bindgen's threading post-processing requires __heap_base, so callers must now pass -Clink-arg=--export=__heap_base in RUSTFLAGS alongside the existing TLS exports. Updated: * Atomics CI job rustflags * CLI reference tests for atomics * nodejs-threads, raytrace-parallel, wasm-audio-worklet examples The flag is backward-compatible with older nightlies.
daxpedda
approved these changes
May 8, 2026
ee535b8 to
26da3c6
Compare
rust-lang/rust#156061 flipped the wasm `-Cpanic=unwind` default from legacy EH (try/catch) to modern (exnref) EH. Adjust CI and justfile so the legacy EH path now requires an explicit `-Cllvm-args=-wasm-use-legacy-eh` opt-in, while the unmarked `-Cpanic=unwind` invocations follow the new modern default. * legacy EH CI job now passes `-Cllvm-args=-wasm-use-legacy-eh` (Node 20 remains fine since legacy EH is still validated there). * exnref CI job drops the now-redundant `=false` opt-out and runs on Node 25 (modern EH needs V8 12.5+, i.e. Node 22.22.3+ or 24+). * test_native bumped from Node 20 to 24 because the cli termination tests build with `-Cpanic=unwind` and now emit modern EH wasm. * justfile: `test-wasm-bindgen-unwind` no longer needs the opt-out and `test-wasm-bindgen-unwind-eh` is renamed to `test-wasm-bindgen-unwind-legacy-eh` with the explicit legacy opt-in. TODOs noted in CI to drop modern-EH jobs back to Node 22 LTS once 22.22.3 ships on 2026-05-13.
`-Cpanic=unwind` now emits modern (exnref) EH by default. Document the runtime version requirement and how to opt into legacy EH for Node 20 compatibility.
Rename the Unreleased `Fixed` section to `Notices` (both entries are nightly toolchain compatibility heads-ups rather than wasm-bindgen bug fixes) and add an entry for rust-lang/rust#156061 flipping the wasm panic=unwind EH default to modern (exnref).
Node 24.14 (current setup-node '24' resolution) still hits the termination test failures; 24.15 is required for the cli termination tests to pass with modern EH wasm.
Earlier comments said "Node 24+" but 24.14 still fails the termination tests \u2014 24.15.0 is the actual minimum on the 24 line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes CI on current nightly Rust (2026-05-06+) with two recent issues:
failed to find \__heap_base` for injecting thread id`.Use Node.js 24.15+ 22.22.3+
Node.js modern exception handling requires 22.22.3+ OR 24.15+.
We change the tests to use this version, and then explicitly turn on legacy exception handling for those tests.
Add --export=__heap_base for threading after rust-lang/rust#156174
rust-lang/rust#156174 (merged 2026-05-06) intentionally removed the implicit
__heap_base/__data_endexports onwasm*-unknown-unknownandwasm32v1-none, requiring threading toolchains like wasm-bindgen to opt in explicitly. The PR description spells out the required link arg directly:wasm-bindgen's threading post-processing needs__heap_base(seecrates/cli-support/src/transforms/threads/mod.rs:193) to set up per-thread stacks, so without the new export it bails immediately.This PR adds
-Clink-arg=--export=__heap_baseeverywhere the existing TLS exports are listed:.github/workflows/main.yml— atomics CI rustflagscrates/cli/tests/wasm-bindgen/reference.rs—runtest_targets_atomicsandno_duplicate_wasm_export_in_node_esm_atomics_debugexamples/nodejs-threads/package.jsonexamples/raytrace-parallel/package.jsonexamples/wasm-audio-worklet/package.jsonVerified locally: the fix makes the failing
headlesstest pass onnightly-2026-05-07(365c0e1d7), and remains backward-compatible with older nightlies (nightly-2026-05-06/e95e73209).