Repository navigation
[browser][coreclr] Stage composite R2R image for library tests - #135897
Merged
Merged
Conversation
Library tests crossgen in the nested publish but serve the build output from bin/. The composite owner (<entry>.r2r.wasm) was only defined as a publish static web asset, so it was never copied to bin/wwwroot/_framework or listed in the build boot config, and startup aborted with "Assembly not found". Define the owner as a build static web asset with the readyToRunComposite trait in the test infrastructure so the build boot config lists it as a composite image. Document the composite library test command. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5cdca42a-e013-4c55-bdc9-491a5efb80a9
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5cdca42a-e013-4c55-bdc9-491a5efb80a9
|
Azure Pipelines: Successfully started running 4 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. |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
maraf
reviewed
Oct 16, 2026
Instead of globbing obj/R2R from test infrastructure, have WasmNestedPublishApp return the composite ReadyToRun image it produced, and define it as a build static web asset in _ResolveWasmOutputs when a nested publish ran during the build. A regular publish resolves build assets before the nested publish runs, so it keeps using the existing publish asset. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5cdca42a-e013-4c55-bdc9-491a5efb80a9
maraf
approved these changes
Oct 17, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Browser CoreCLR library tests fail to start with
PublishReadyToRunComposite=true:Cause
Library tests crossgen inside the nested publish, then serve the build output from
bin/. The build-time webcil staging readsobj/R2R, so the composite component stubs are staged. The composite owner (<entry>.r2r.wasm) is not an assembly, though. The WebAssembly SDK defines it only as a publish static web asset inProcessPublishFilesForWasm, which doesn't run here. As a result the owner is never copied towwwroot/_frameworkand never listed in the build boot config.Fix
The nested publish now returns the composite image as one of its outputs, the same way
WasmNativeAssetandWasmAssembliesFinalflow back to the outer build:BrowserWasmApp.CoreCLR.targets:WasmNestedPublishAppreturns the image it produced (_ReadyToRunCompileListwithCreateCompositeImage=true) as_WasmNestedPublishCompositeR2RImage, andWasmTriggerPublishAppcollects it.Microsoft.NET.Sdk.WebAssembly.Browser.targets: when that item is present,_ResolveWasmOutputsdefines the image as a build static web asset with the existingWasmResource=readyToRunCompositetrait.GenerateWasmBootJsonthen lists it incoreAssemblywithisCompositeImage, and it is copied to output and fingerprinted like the other framework assets.In a regular
dotnet publish, the outer build resolves its assets beforeWasmTriggerPublishAppruns, so the item is empty there and the existing publish asset remains the only definition.eng/testing/tests.browser.targetsis unchanged.docs/workflow/testing/libraries/testing-wasm.mdnow documents the composite library-test command.Validation (macOS arm64, Release)
Prereq:
./build.sh clr+libs+host+packs -os browser -c Release /p:AotHostArchitecture=arm64 /p:AotHostOS=osxLibrary tests. Base command:
./build.sh libs.tests -test -os browser -c Release --projects <csproj> /p:RuntimeFlavor=CoreCLR /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true; composite runs add/p:PublishReadyToRunComposite=true.Apps:
Wasm.Build.Tests.ReadyToRunTests(CoreCLR, no-workload, rebuiltMicrosoft.NET.Sdk.WebAssembly.Pack): 10/10 passed. These publishes don't run a nested publish, so this shows the new block is a no-op for them.src/mono/sample/wasm/console-node(make publish MSBUILD_ARGS="/p:RuntimeFlavor=CoreCLR /p:PublishReadyToRun=true /p:PublishReadyToRunComposite=true", twice): runs under node with one composite image and oneisCompositeImageentry. The binlog shows the outer_ResolveWasmOutputsruns before the nested publish returns the image.Note
This PR description was generated with GitHub Copilot.