Repository navigation
tools: WASI release programs carry no debug information - #27
Merged
Merged
Conversation
wasi-sdk's prebuilt libc++, libc++abi and libunwind carry DWARF, which wasm-ld copied into every wasip2 and wasip3 program, a release one too: most of its bytes. The Jamroot now links a WASI program built without debug symbols, as a release is, with -Wl,--strip-debug (its region wasi-strip-debug), which wasm-component-ld passes to wasm-ld. A debug build, or a release with debug-symbols=on, keeps its DWARF. tools/test/webcpp_jam_test.py reads every custom section of the demo's catches.wasm, nested core modules of the component included, at release, debug and release with debug-symbols=on on both targets; it failed before the change.
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.
Owner decision (2026-11-17): WASI programs built at
variant=releasecarry no debug information; debug builds keep theirs.Change
Jamroot:<target-os>wasi,<debug-symbols>off:<linkflags>-Wl,--strip-debug(regionwasi-strip-debug). wasm-component-ld passes it to wasm-ld, so the core module of a wasip2 or wasip3 component has no.debug*section. Keyed on<debug-symbols>off, whichvariant=releasesets, so a release that asks fordebug-symbols=onkeeps its DWARF, as a debug build does. No other target is touched.tools/test/webcpp_jam_test.py:test_a_wasi_release_program_carries_no_debug_informationreads every custom section of the demo'scatches.wasm, recursing into the core modules and components a component nests, for release, debug and release withdebug-symbols=on, on wasip2 and wasip3. Seen failing before the change (the release component had.debug_info,.debug_line,.debug_strand others).AGENTS.md,CODING-GUIDELINES.md(decision bullet),doc/releases/0.1.0.adoc(one line).Size effect (release, wasm-component-ld output)
xactor_quick_startsha256pratt_calculatordocument_quick_startboost_json_commandOver 120 release examples (document, hash, idna, pratt, wasi, xactor, both targets): 455,280,120 bytes to 69,615,792 (-84.7%); every one had
.debug*sections before, none after.Emscripten release links (
-O3) keep no custom section at all: 47 release programs of pratt, hash and asio's size-table variants checked.Size tables
webcpp.size-table(asio'sasio.sizes.md) is Emscripten only, a build output, not committed data: no change.doc/measurements*.jsonstays as measured on 2026-11-16, per the owner; its measure lane already linked WASI with--strip-debug.doc/release-measurements.adoc(dated 2026-11-07, built bybench/build.pywithvariant=releasethrough this Jamroot) reports WASI payloads that included this DWARF; not regenerated here.Verification (macOS arm64)
python3 tools/test/webcpp_jam_test.py: all 47 cases ok;python3 tools/test/jamroot_test.py: ok.tools/lint/lint.sh:lint: clean.variant=release: 590 and 632 passed; the only failures are crypto'ssecp256k1_allocationandsecp256k1_allocation_no_exceptions, which fail identically on main without this change (the test's controldelete new int(1)is elided at -O3, so the allocation counter does not move).🤖 Generated with Claude Code