build/wasm: retain final Go and C++ DWARF after optimization - #2662
Conversation
There was a problem hiding this comment.
Review: Final WebAssembly DWARF verification + LLGo-patched Binaryen
Overall this is a clean, well-tested change. The Go post-link code (resolveWasmOpt, wasmOptIdentity, and the new debug threading into wasmPreAsyncifyArgs) is single-purpose and covered by both success and failure-path tests. The CI action validates the checksum format on both bash and PowerShell paths, asserts the extracted binaries are executable, and downloads over HTTPS. Fixtures and the new dev/test_wasm_debug_info.py integration test line up with the asserted source lines and DWARF names.
Two things worth a look inline, plus one architectural note below. Nothing blocking.
Supply-chain note (non-blocking): The Binaryen download source moves from WebAssembly/binaryen to the xgo-dev/binaryen fork (llgo-v132.2). The pinned SHA-256s guarantee byte-integrity of the fork's published archives, but not that they were built from audited upstream source, so CI's build-tool trust now depends on the xgo-dev org's release process. Consider documenting the fork's build provenance (ideally reproducible builds or SLSA/gh attestation) and restricting who can publish releases there.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
LLGo baseline benchmarks
Program measurements
Core language and compiler benchmarks
Timer runtime benchmarks
Compared with |
LLGo WebAssembly build benchmarks
WebAssembly output sizes
LLGo WebAssembly build measurements
Compared with |
7f23f53 to
1ef7918
Compare
Optimized W32 debug builds ran
wasm-opt -O2before Asyncify without-g. The program still ran, but final DWARF marked Go and C++ functions as dead and source lookup failed. Preserve debug information through that pre-Asyncify optimization when the build retains DWARF.Add a Go-to-C++ fixture that checks the final module after all Binaryen rewrites:
llvm-dwarfdump --verify, Go/C++ DIEs and variables, source-line lookup withllvm-addr2line, and Node/Wasmtime execution at O0 and O2. The pinnedllgo-v132.3release includes the Memory64 DWARF fix from xgo-dev/binaryen#4, so CI now runs J32, J64, and W32 instead of gating J64.This PR is stacked on #2652, which pins
llgo-v132.3for Emscripten and LLGo's standalone post-link. The diff againstmainincludes that dependency.Validation: all six J32/J64/W32 × O0/O2 cases passed locally using the published macOS ARM64
llgo-v132.3archive and Emscripten 6.0.8. The fulldev/test_wasm_single_worker.sh test-commandsuite, focusedinternal/buildpost-link tests,actionlint, andgit diff --checkpassed.