Repository navigation
[browser] Disable stack trace line numbers by default on publish - #136971
Merged
pavelsavara merged 3 commits intoNov 6, 2026
Merged
Conversation
Preserve development-build defaults and explicit source-location opt-in. Resolve runtime feature configuration before trimming no-build publishes, and verify build-publish-build behavior with browser regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 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 'arch-wasm': @lewing, @pavelsavara |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Resolve WebAssembly configuration before trimming only in the outer publish. Initializing it in native-only nested publishes generates an incomplete boot manifest and completion stamp before the managed assemblies are staged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pavelsavara
marked this pull request as ready for review
November 6, 2026 09:30
pavelsavara
requested review from
akoeplinger,
ilonatommy,
lewing and
maraf
as code owners
November 6, 2026 09:30
maraf
reviewed
Nov 6, 2026
Set the default in the guarded publish target when the CLI publishing flag is absent. Cover direct MSBuild publishing and move the stack trace probe into the shared test app with its standard output helper and runtime category. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf
approved these changes
Nov 6, 2026
Member
Author
|
/ba-g known windows infra |
This was referenced Nov 6, 2026
This was referenced Nov 9, 2026
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
StackTraceLineNumberSupporttofalsefor browser publishing, including Debug publish, while preserving development-build defaults and explicit property values.dotnet publish --no-build.This is a behavioral change: published CoreCLR managed stack traces keep method names, but source file/line lookup now requires explicit opt-in. The existing property restores the previous behavior:
Breaking-change documentation has been prepared as a local draft; the source PR is not merged yet.
Size evidence
Using the source-built WebAssembly SDK pack with the same optimized
12.0.0-alpha.1.26528.120browser runtime pack, a minimal trimmed Debug Blazor publish gives:*.wasm.gzbytesThe default removes exactly System.Collections.Immutable, System.Diagnostics.StackTrace, System.IO.Compression, System.IO.MemoryMappedFiles and System.Reflection.Metadata from both the linked closure and published WebCIL assets: 241,152 managed bytes and 104,563 gzip bytes saved. The consumed SDK target bytes were verified against the source-built package.
Locally built unoptimized Debug CoreLib can retain unreachable PDB-reader code after feature substitution. Size results above intentionally use an optimized shipping runtime pack; browser behavior tests use the locally built Debug runtime.
Validation
All commands ran from the isolated Windows worktree.
Passed: zero warnings/errors.
Passed: zero warnings/errors.
Passed in Chrome: 6 passed, 0 failed, 0 skipped, including all four new cases and both existing trimmed-PDB cases. The new cases check actual source-line availability and retained method names across build/publish/build. Against the unchanged SDK package, the two new default-publish cases failed because source lines remained enabled; both explicit-override cases passed.
Two additional minimal publishes with the changed SDK package passed exact assertions for the linked and published five-assembly difference above.
git diff --checkpassed.The complete WBT suite, Mono runtime lane, and interactive managed debugger were not run.
Nested-publish CI follow-up
The early configuration dependency initially ran inside native-only nested publishes.
That generated an incomplete boot manifest before the outer publish staged managed
assemblies, then poisoned its shared incremental completion stamp. A guarded wrapper
now keeps the early dependency in the outer publish only; the original satellite and
reference preparation still runs in both contexts.
The existing workload
LazyLoadingTests.FailOnMissingLazyAssemblyreproducedBLAZORSDK1001with the unguarded package and passed with the guarded source-builtpackage. Existing coverage therefore catches this regression without adding redundant
tests.
Passed: zero warnings/errors.
Passed in Chrome: 1 passed, 0 failed, 0 skipped.
Passed in Chrome: 4 passed, 0 failed, 0 skipped, covering defaults, explicit
true/false, no-build publish, and build/publish/build. An initial run had one
ten-second harness exit-message timeout; that exact published opt-in artifact
independently printed source information, method name and
WASM EXIT 0, and thecomplete four-case confirmation above passed.
All consumed package targets matched the final source bytes.
git diff --checkpassed. The complete CI matrix and full Mono test lane have not been rerun locally.
Review follow-up: direct MSBuild publishing
The guarded publish target now applies the line-number default even when publishing
with
dotnet msbuild -t:Publish, which does not supply_IsPublishing. Explicitproperty values remain honored. The managed probe is now a standard
StackTraceTestscenario in WasmBasicTestApp, usesTestOutput.WriteLine, and thetheory uses the
coreclrtest category.The expanded theory covers CLI and direct-MSBuild publishing, no-build publishing,
explicit true/false, and build/publish/build. Against the preceding package, both
direct-MSBuild default cases failed because source lines remained enabled; the
other six cases passed.
The source-built SDK package passed with zero warnings/errors:
Final browser validation:
Passed in Chrome: 8 passed, 0 failed, 0 skipped.
Passed in Chrome: 1 passed, 0 failed, 0 skipped. Packaged target bytes match the
source;
git diff --checkpassed.Resolves #135222
Note
This PR was generated with assistance from GitHub Copilot.