Conversation
|
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. |
5dd203d to
77ee8ca
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Improve the ReadyToRun-specific relinking error message before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Relinks browser CoreCLR Wasm ReadyToRun apps so compilation and native P/Invoke helper generation use the same managed closure.
Changes:
- Requires native relinking for browser ReadyToRun publishes.
- Preserves explicit VFS payloads in trimmed CoreCLR tests.
- Adds guarded P/Invoke and native-module regression coverage.
Review note: the ReadyToRun relinking failure can produce an unhelpful error message when WasmBuildNative=false is explicit (moderate, 3 votes).
| File | Description |
|---|---|
src/mono/wasm/Wasm.Build.Tests/ReadyToRunTests.cs |
Adds ReadyToRun relinking regression coverage. |
src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs |
Validates generated direct-P/Invoke arguments. |
src/mono/wasm/testassets/EntryPoints/PInvoke/GuardedFrameworkEntryPoint.cs |
Adds the guarded framework P/Invoke regression entry point. |
src/mono/browser/build/BrowserWasmApp.CoreCLR.targets |
Enables relinking for browser ReadyToRun publishes. |
eng/testing/tests.browser.targets |
Preserves explicit VFS files in trimmed tests. |
Require browser CoreCLR ReadyToRun publishes to relink the native runtime so Crossgen2 and the PInvoke call-helper generator process the same managed closure. Preserve explicit test payload files under trimming, add guarded PInvoke coverage, and update ReadyToRun build tests for the implied relink. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
77ee8ca to
b637222
Compare
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
| value differs from what was baked into the runtime pack forces a relink, and an | ||
| explicit WasmBuildNative=false in that situation is an error rather than a silent | ||
| mismatch between the app's configuration and the prebuilt dotnet.native.wasm. --> | ||
| value differs from what was baked into the runtime pack forces a relink. ReadyToRun |
There was a problem hiding this comment.
What is the cost of auto-enabling relink for ReadyToRun?
It doesn’t seem right to me to auto-enable relinking for ReadyToRun solely to accommodate tests that represent invalid user code.

Summary
Browser CoreCLR ReadyToRun publishing now implies
WasmBuildNative=true, ensuring Crossgen2 and the generated P/Invoke call-helper table process the same managed closure.The failure occurred when per-app ReadyToRun compilation classified framework modules such as
System.Nativeas direct whileWasmBuildNative=falsereused the prebuilt framework-only helper table. Test-only entry points such asSystemNative_GetEUidwere then absent from that table and failed during ReadyToRun fixup before the guarded call was reached.This change:
PINVOKE_TARGETcodegen;SystemNative_GetEUidregression;--directpinvoke:native-libresponse-file entry.Validation
clr+libs+host+packsbuild passed.System.Runtime.Extensions.Tests: 8,308 passed, 70 skipped, 0 failed.PINVOKE_TARGETremains forprint_lineandSystemNative_GetEUid.DllImportEntry(print_line)andDllImportEntry(SystemNative_GetEUid).Sequencing
#133656 currently carries a narrow
#if NETworkaround inAdminHelpers. Whichever PR merges second should remove that workaround so the root fix is the only retained behavior change.Resolves #133614
Note
This pull request description and change were prepared with GitHub Copilot assistance.