feat(node-binding): add external wasm debug info for wasm dwarf debugging#13638
feat(node-binding): add external wasm debug info for wasm dwarf debugging#13638
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for linking a sidecar wasm debug artifact by writing the WebAssembly external_debug_info custom section into the runtime wasm, so DWARF can remain in rspack.wasm32-wasi.debug.wasm while the non-debug wasm is loaded by default.
Changes:
- Add
addExternalDebugInfohelper script that injects theexternal_debug_infocustom section usingllvm-objcopy. - Invoke the helper from the node binding build script for the wasm32-wasip1-threads build (non-browser).
- Update the WASI loader to stop preferring the
*.debug.wasmat runtime and instead resolve the runtime wasm via package/local fallback.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/node_binding/scripts/build.js | Calls the new helper during wasm builds to embed external_debug_info. |
| crates/node_binding/scripts/add-external-debug-info.js | New helper that encodes the external DWARF URL and injects the custom section via llvm-objcopy. |
| crates/node_binding/rspack.wasi.cjs | Adjusts wasm file resolution logic to load the non-debug wasm by default. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 644eac9517
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Merging this PR will degrade performance by 1.69%
Performance Changes
Comparing Footnotes
|
📦 Binary Size-limit
🎉 Size decreased by 8.34KB from 49.35MB to 49.34MB (⬇️0.02%) |
Rsdoctor Bundle Diff AnalysisFound 6 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📦 Download Diff Report: popular-libs Bundle Diff Generated by Rsdoctor GitHub Action |
…ging (#13638) * feat(node-binding): add external wasm debug info * fix(node-binding): prefer local wasm and add debug script * chore: fix npm script naming
Summary
external_debug_infocustom section into the runtime wasmrspack.wasm32-wasi.debug.wasmwhile loading the non-debug wasm by defaultaddExternalDebugInfoRelated links
ms-vscode.wasm-dwarf-debugging-1.0.2.repacked.vsix.zip
Checklist