Repository navigation
[WASM] Add preview-.NET WASM test job to catch exception-handling regressions - #4488
Conversation
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4488PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4488"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4488/packages --name skiasharp-pr-4488More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4488 |
bf9517c to
ec5b6ce
Compare
ec5b6ce to
1db9168
Compare
1db9168 to
256341e
Compare
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
256341e to
dcfd80c
Compare
|
| Native lib | Outcome |
|---|---|
new-EH (_wasmeh,_newexc,st,simd, from #4487 build) |
module compiles, suite runs 1180 total / 1081 passed / 0 failed / 99 skipped → ✅ green |
legacy-EH (_wasmeh,st,simd, current main) |
mix of legacy and new exception handling instructions CompileError → ❌ red |
This goes green once #4487 lands on main (5.0.6 rebuilt with _newexc → new-EH) and this branch is rebased. The red here is proof the guard works.
dcfd80c to
9e6f6d2
Compare
e56507f to
8a7b683
Compare
…ressions Runs the existing tests/SkiaSharp.Tests.Wasm suite as the preview .NET (net11) so a legacy/new WASM exception-handling mismatch in the emsdk 5.0.6 native libSkiaSharp (which fails at runtime in the browser with "module uses a mix of legacy and new exception handling instructions") — or any WASM breakage on the newer runtime — turns CI red. The preview runtime is used for TESTS ONLY; net10 stays the default for all other CI. - source/SkiaSharp.Build.props: add opt-in UsePreviewTFM toggle (default off) that shifts the TFM window forward (current=net11, previous=net10), dropping the now-EOL net9.0 so projects build cleanly under a preview .NET SDK. - scripts/infra/tests/tests-wasm.cake: add --previewtfm=true, which runs the suite with -p:UsePreviewTFM=true. The cake is the run; it does not provision. - scripts/azure-templates-jobs-bootstrapper.yml: add reusable installPreviewSdk + previewWorkloads parameters that install the preview SDK, pin global.json to it, and install the requested workloads (via the shared install-dotnet-workloads.ps1, pinned to the exact preview workload set) — so other jobs can opt into a preview run. - scripts/azure-templates-variables.yml: add DOTNET_VERSION_PREVIEW and DOTNET_WORKLOAD_VERSION_PREVIEW (default DOTNET_VERSION stays net10). - scripts/azure-templates-stages-test.yml: add tests_wasm_preview_linux job (consumes the native artifact, installPreviewSdk=true, previewWorkloads=wasm-tools,android, runs tests-wasm --previewtfm=true). The android workload is needed because the WASM test still restores the -android TFMs of referenced projects. tests_wasm_linux (net10) is unchanged. Co-authored-by: Copilot App <[email protected]> Copilot-Session: a10a6eaa-d107-41bc-bc5c-1357d9ef2408
8a7b683 to
3834671
Compare
What
Adds automated preview-.NET WebAssembly regression coverage by running the existing
tests/SkiaSharp.Tests.Wasmsuite as the preview .NET (currently net11) in CI. It is off by default; only this one test job opts in, so the rest of CI stays on net10 and the shipping TFMs are unchanged.Why
The emsdk 5.0.6 WASM
libSkiaSharpcan emit legacy wasm exception-handling instructions while the preview .NET links WASM apps with the new exnref model (WASM_LEGACY_EXCEPTIONS=0). Mixing them makes the WASM app fail at runtime in the browser with:There was no CI test that would have caught this. This PR is that guard: it runs the real WASM suite on the preview runtime, so an EH mismatch — or any preview-runtime WASM breakage — turns the build red.
How
source/SkiaSharp.Build.props— opt-inUsePreviewTFMtoggle (default off): shifts the .NET version window forward one release (dropping the now-EOL oldest version) so projects build cleanly under a preview .NET SDK.scripts/infra/tests/tests-wasm.cake—--previewtfm=trueruns the suite with-p:UsePreviewTFM=true. The cake is the run; it does not provision.scripts/azure-templates-jobs-bootstrapper.yml— reusableinstallPreviewSdk+previewWorkloadsparams (install the preview SDK, pin global.json to it, install the requested preview workloads) so other jobs can opt into a preview-runtime run.scripts/azure-templates-variables.yml—DOTNET_VERSION_PREVIEW+DOTNET_WORKLOAD_VERSION_PREVIEW(defaultDOTNET_VERSIONstays net10).scripts/azure-templates-stages-test.yml—tests_wasm_preview_linuxjob (consumes thenativeartifact,installPreviewSdk: true,previewWorkloads: wasm-tools, runstests-wasm --previewtfm=true). The net10tests_wasm_linuxjob is unchanged.Validation
Locally verified end-to-end both paths (preview SDK, DeviceRunners headless browser, real 5.0.6
st,simdnatives from CI artifacts):_wasmeh,_newexc,st,simdlib): the module compiles and the suite runs (1180 total / 1081 passed / 0 failed / 99 skipped)._wasmeh,st,simdlib, i.e. main today): the browser fails with the exactmodule uses a mix of legacy and new exception handling instructionsCompileError and the job goes red.Note on branching
This is currently based on
main, which has the 5.0.6 native builds but not the EH fix (PR #4487), so thetests_wasm_preview_linuxjob is expected to be red here — that red is the negative control proving the guard works. Once #4487 lands on main (5.0.6 built with_newexc) and this branch is rebased, it goes green.