[wasm][coreclr] Strip R2R debug info by default for browser-wasm publish - #134689
Merged
lewing merged 3 commits intoSep 26, 2026
Merged
Conversation
Match the Apple mobile default: pass --strip-debug-info to crossgen2 for CoreCLR browser-wasm ReadyToRun publish to minimize download size. Opt out with PublishReadyToRunStripDebugInfo=false to keep IL offset maps and variable locations for debugging R2R code. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
_CreateR2RImages only tracks file inputs, so toggling a crossgen2 argument such as PublishReadyToRunStripDebugInfo left stale images in obj/R2R. Stamp PublishReadyToRunCrossgen2ExtraArgs (written only when different) and add it to _ReadyToRunCompilerInputs, mirroring the P/Invoke manifest. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Sep 25, 2026
steveisok
approved these changes
Sep 25, 2026
lewing
merged commit Sep 26, 2026
43c27ac
into
lewing-enable-wasm-composite-r2r
43 of 47 checks passed
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.
Summary
Pass
--strip-debug-infoto crossgen2 for CoreCLR browser-wasm ReadyToRun publish. This drops the R2RDebugInfosection (native-to-IL offset maps and variable locations) from shipped images. Opt out withPublishReadyToRunStripDebugInfo=falseto keep the data for debugging R2R code (e.g. the cDAC work in #133086 / #133890).Also makes crossgen2 argument changes invalidate per-app R2R images.
_CreateR2RImagesonly tracks file inputs, so togglingPublishReadyToRunStripDebugInfo(or anyPublishReadyToRunCrossgen2ExtraArgschange) previously left stale images inobj/R2R. The arguments are now written toobj/wasm-r2r-args.stamp(only when different) and added to_ReadyToRunCompilerInputs, mirroring the existing P/Invoke manifest input.Important
Stacked on #134618, which rewrites the same targets file. Retarget to
mainafter it merges.Size impact
Per-assembly R2R images compiled directly with crossgen2 using the SDK's browser-wasm arguments (
--obj-format:wasm --opt-cross-module:* --codegenopt:JitWasm*NyiToR2RUnsupported=1), with and without--strip-debug-info. Total for System.Private.CoreLib, System.Text.Json, System.Linq, and System.Collections:Per-assembly brotli sizes (bytes, keep → strip)
The #133086 compiler is based on an older commit, so compare keep vs. strip within a column rather than across columns.
Validation
--strip-debug-infois present by default, absent withPublishReadyToRunStripDebugInfo=false, and absent whenPublishReadyToRunis off._CreateR2RImagesruns on first build, skips when unchanged, reruns on opt-out, skips when repeated, and reruns when switching back.Runtime-pack framework R2R images (used only by the dev-loop build) are unchanged; publish recompiles the whole closure through these targets.
--strip-inlining-infois intentionally not included: it removesCrossModuleInlineInfo, and cross-module inlining is load-bearing on wasm, so it needs separate validation.Note
This pull request was created with assistance from GitHub Copilot.