Skip to content

[wasm][coreclr] Drop -v:diag from WBT crossgen2 arguments test - #137291

Merged
maraf merged 1 commit into
mainfrom
lewing-wbt-r2r-drop-diag-verbosity
Nov 11, 2026
Merged

maraf merged 1 commit into
mainfrom
lewing-wbt-r2r-drop-diag-verbosity

Conversation

@lewing

@lewing lewing commented Nov 10, 2026

Copy link
Copy Markdown
Member

Removes extraBuildArgs.Add("-v:diag"); from ReadyToRunTests.PublishCrossgen2ArgumentsReflectWasmDebugInfoProperties. The theory matrix and assertions are unchanged.

Why

The Helix work item WBT-NoWorkload-CLR-Wasm.Build.Tests on windows.server2025.amd64.open is dead-lettering on main and on PRs. Examples: main build 1672437, and #136772 builds 1670137 and 1672543. Each one fails with exit -1 after 0 s and no console log.

The test doesn't need diagnostic verbosity. GetCrossgen2ExtraCommandLineArgs(binlogPath) reads the Crossgen2ExtraCommandLineArgs parameter of the RunReadyToRunCompiler task from the binlog, and the binary logger records task parameters at any console verbosity.

Validation

  • ./dotnet.sh build src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj -c Release -p:TargetOS=browser -p:TargetArchitecture=wasm -p:RuntimeFlavor=CoreCLR -p:InstallWorkloadForTesting=false: passed (0 warnings, 0 errors).
    • Without -p:InstallWorkloadForTesting=false, the test assembly still compiled. The build then failed in the testing-SDK provisioning step (workloads-browser.targets(122,5)), because this worktree has no locally built runtime packs.
  • I did not run the test locally, since that needs a full browser-wasm CoreCLR build. CI coverage of the Windows WBT-NoWorkload-CLR work item is the real check.

Note

This PR description was generated with GitHub Copilot.

The assertion reads Crossgen2ExtraCommandLineArgs from the binlog, which
records task parameters regardless of console verbosity. Diagnostic
verbosity made each case capture ~120 MB of output and pushed the Windows
no-workload WBT work item past its 90 minute Helix timeout.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@lewing
lewing enabled auto-merge (squash) November 10, 2026 22:12
@maraf

maraf commented Nov 11, 2026

Copy link
Copy Markdown
Member

/ba-g Failures are not related to the console-verbosity change.

The only failing Helix work item in build 1673938 is Windows WBT-NoWorkload-CLR-Wasm.Build.Tests, which exited with code -3 after approximately 94 minutes against a 90-minute execution limit. The same lane passed on Linux with exit code 0.

The Windows work item also failed on main in build 1672437, before this change. This supports a pre-existing Windows work-item timeout rather than a regression from removing -v:diag. The PR preserves binary logging and all assertions.

The Windows run uploaded no test results, and Build Analysis has no known-issue match. Bypassing the check does not establish that this change fully resolves the Windows timeout.

Note

This comment was generated with the assistance of GitHub Copilot.

@maraf
maraf merged commit 62b13ea into main Nov 11, 2026
38 of 40 checks passed
auto-merge was automatically disabled November 11, 2026 08:43

Pull Request is not mergeable

@maraf
maraf deleted the lewing-wbt-r2r-drop-diag-verbosity branch November 11, 2026 08:43
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 11, 2026
lewing added a commit that referenced this pull request Nov 12, 2026
#137360)

This makes
`ReadyToRunTests.PublishCrossgen2ArgumentsReflectWasmDebugInfoProperties`
(added in #136506) much cheaper while keeping its coverage.

## Why

The Windows Helix work item `WBT-NoWorkload-CLR-Wasm.Build.Tests` keeps
hitting its 90-minute timeout. #137291 removed `-v:diag` from this test,
but that only shrank the logs. On #137291's own CI (Helix job
`96967939-699a-48d4-a0d9-ab808c96a280`) the work item still ran 1h34m
and timed out with exit -3.

In the last passing slow run (Helix job
`a5e1304b-0299-470a-a3ce-9a2289a5b925`), this test's 12 cases took
**1464 s**. Each case runs a full per-app or composite ReadyToRun
publish (~120 s), just to read back `Crossgen2ExtraCommandLineArgs`.

The flags under test (`--wasm-debug-info=*`, `--strip-inlining-info`,
`--strip-debug-info`, `--opt-cross-module:*`) are all set in static
`PropertyGroup`s, in
`Microsoft.NET.Sdk.WebAssembly.Browser.CoreCLR.targets` and
`Microsoft.NET.CrossGen.targets`. `RunReadyToRunCompiler` receives
`$(PublishReadyToRunCrossgen2ExtraArgs);$(_PublishReadyToRunCrossgen2ExtraArgs)`,
and none of the targets touch these flags. In a CI binlog of the old
test (Release, per-app, `DebuggerSupport=true`), the evaluated property
was `;--wasm-debug-info=none;--opt-cross-module:*`. The task received
`;--wasm-debug-info=none;--opt-cross-module:*;`, the same value plus the
empty underscore property.

## Change

- `PublishCrossgen2ArgumentsReflectWasmDebugInfoProperties` now runs
`dotnet msbuild -t:Restore` and then `dotnet msbuild
-getProperty:PublishReadyToRunCrossgen2ExtraArgs`, both with
`-p:_IsPublishing=true` and the same project properties and `-p:`
arguments, writing a binlog for each step. Restore has to be a separate
invocation: MSBuild skips `-restore` when `-getProperty` runs without a
target, and the WebAssembly SDK pack that sets these arguments is
imported from the test's restored packages.
  - The 12-case matrix is unchanged.
- Composite cases still pass the Crossgen2 SDK override props and
targets, so both import orders are still covered.
- Each case's cost drops from a full R2R publish (~120 s) to a restore
plus an evaluation. The restore took ~8.7 s inside the old publishes.
- `PublishRunAllPagesCore` now reads its existing publish binlog and
asserts the same flags on the `RunReadyToRunCompiler` task. That covers
per-app Debug, per-app Release (trimmed, untrimmed, native relink), and
composite Release, so we still prove crossgen2 receives the flags,
without extra publishes.

Expected savings: about 20 minutes on the Windows no-workload CLR work
item. That's an estimate from the timings above, not a measurement.

## Validation

- `./dotnet.sh build
src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj -c Release
-p:TargetOS=browser -p:TargetArchitecture=wasm -p:RuntimeFlavor=CoreCLR
-p:InstallWorkloadForTesting=false`: **passed** (0 warnings, 0 errors).
- Repo SDK, scratch project: `dotnet msbuild -restore
-getProperty:NuGetPackageRoot` produced no `obj/` and an empty value.
Running `dotnet msbuild -t:Restore` first, then `dotnet msbuild
-getProperty:NuGetPackageRoot -getProperty:Foo`, **returned the restored
value**, and stdout contained only the JSON result.
- CI on the first commit (build 1675766):
- All 12 evaluation cases failed on Linux and Windows with an empty
value, because restore never ran. The second commit fixes that.
- The new `RunReadyToRunCompiler` assertions in `PublishRunAllPages`,
`PublishRunAllPagesComposite` and `PublishRunAllPagesNativeRelink`
passed on both platforms.
- On Windows, `WBT-NoWorkload-CLR` finished in **1h16m**, under the
90-minute limit; the previous run timed out at 1h34m. The 12 cases took
about 10 s total there. With the fix, expect roughly 2–3 more minutes
for restore and evaluation.
- `PublishWithUnnormalizedIntermediatePathKeepsReadyToRunImages`
(Release, and Release composite) failed on Windows only: `AssertBundle`
found loose `.dll` files in `publish/`. That test (#137229) doesn't use
any code this PR changes, and it passed on Linux.
- I did **not** run the WBT tests locally, because they need a
browser-wasm CoreCLR build. The CI `WBT-NoWorkload-CLR` lanes are the
real check.

> [!NOTE]
> This PR description was generated with GitHub Copilot.

---------

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants