Repository navigation
[WASM] Fix net11 exception-handling mismatch in emsdk 5.0.6 native libs - #4487
Conversation
.NET 11 links WASM apps with the new exnref exception-handling model (WASM_LEGACY_EXCEPTIONS=0 -> try_table/throw_ref). The emsdk 5.0.6 libSkiaSharp.a/libHarfBuzzSharp.a were compiled with -fwasm-exceptions but without pinning the instruction variant, so they emitted the legacy wasm-EH instructions (try/catch). A net11 app mixing the legacy SkiaSharp objects with the new-EH .NET runtime fails to compile in the browser: CompileError: WebAssembly.compileStreaming(): module uses a mix of legacy and new exception handling instructions Add a '_newexc' emscripten feature that appends '-s WASM_LEGACY_EXCEPTIONS=0' to extra_cflags and extra_cflags_cc (compile-time codegen flag; required for both C++ exceptions and the wasm setjmp/longjmp in the C deps). Enable it only for the 5.0.6 (net11) native matrix variants. net8 (3.1.34) and net9/net10 (3.1.56) keep legacy EH to match their runtimes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: e238622e-1dea-47a8-b3ce-e029defca5f0
📦 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 -- 4487PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4487"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4487/packages --name skiasharp-pr-4487More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4487 |
|
📖 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. |
✅ Local verification (net11 + system Chrome 150)Rebuilt the emsdk 5.0.6
Objdump of the fixed No net9/net10 regression: the change is gated on a new Next: adding a net11 WASM test job to CI so this is caught automatically. |
✅ Full end-to-end verification (local)Both the fix and the new CI smoke test are validated end-to-end. The fix (rebuilt 5.0.6 libs from source, net11.0 + Chromium 149/150)
Link flags confirm the split: net11 links The new CI smoke test (
|
✅ CI green — build 4.151.0-pr.4487.3 (1517651) SUCCEEDEDThe full complete pipeline passed end-to-end (1h38m, 0 failed records).
Marking ready for review. |
f2d8dd3 to
90891ad
Compare
|
Refocused this PR to just the build fix (native |
…ressions (#4488) [WASM] Add preview-.NET WASM test job to catch exception-handling regressions (#4488) Context: #4487 The emsdk 5.0.6 WASM libSkiaSharp can emit *legacy* wasm exception-handling instructions, while .NET 11 links Blazor WASM apps with the *new* exnref model (WASM_LEGACY_EXCEPTIONS=0). Mixing the two makes the app fail at runtime in the browser, before a single line of user code runs: CompileError: WebAssembly.compileStreaming(): module uses a mix of legacy and new exception handling instructions PR #4487 fixes the native build to emit new-EH instructions, but nothing in CI would have caught the original regression. This adds that missing guard: it runs the existing tests/SkiaSharp.Tests.Wasm suite under the preview .NET (net11) so an EH mismatch — or any WASM breakage on the newer runtime — turns the build red. The preview runtime is used for TESTS ONLY. net10 remains the default for every other job, and the shipping TFMs are unchanged. * source/SkiaSharp.Build.props: add an opt-in UsePreviewTFM toggle (default off) that shifts the .NET version window forward one release (current=net11, previous=net10). Dropping the now-EOL net9.0 lets the test and the SkiaSharp binding it references build cleanly as net11.0 under a preview SDK, without tripping NETSDK1202 on the EOL net9.0-* platform TFMs. * scripts/infra/tests/tests-wasm.cake: add --previewtfm=true, which runs the same suite with -p:UsePreviewTFM=true. The cake is the run, not the infra. * scripts/azure-templates-jobs-bootstrapper.yml: add reusable installPreviewSdk and previewWorkloads parameters (install the preview SDK, pin global.json to it, install the requested workloads via the shared install-dotnet-workloads.ps1 at 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 the tests_wasm_preview_linux job (consumes the native artifact; previewWorkloads=wasm-tools,android). android is required because the WASM restore still evaluates the -android TFMs of the referenced binding projects, exactly as the net10 job already does. Both paths were validated locally against real 5.0.6/st,simd natives pulled from CI artifacts: the new-EH lib runs the suite green (1180 total, 1081 passed, 0 failed, 99 skipped), and the legacy-EH lib fails with the CompileError above and takes the job red via the runner's 300s timeout — a bounded failure, not a hang or a silent pass. Note: the preview .NET workload set, its manifests, and the emscripten 5.0.6 and android packs are not on the dnceng public feeds by default (preview/late-leg builds move to internal feeds), so the exact pinned versions were mirrored to dotnet-public to make the pinned install reproducible in CI. Co-authored-by: Matthew Leibowitz <[email protected]> Co-authored-by: Copilot App <[email protected]>
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. We will need to wait for updated NuGet packages in order to address the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. We will need to wait for updated NuGet packages in order to address the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With a quick sed later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' and an update to `run-netcore-mobile-template-tests.ps1`, we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With some quick **sed(1)**s later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' git grep -l net10.0 build/test-scripts/run*template*.ps1 | xargs sed -i '' 's/net10\.0/net11.0/g' we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With some quick **sed(1)**s later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' git grep -l net10.0 build/test-scripts/run*template*.ps1 | xargs sed -i '' 's/net10\.0/net11.0/g' we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With some quick **sed(1)**s later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' git grep -l net10.0 build/test-scripts/run*template*.ps1 | xargs sed -i '' 's/net10\.0/net11.0/g' we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Context: #23626 Context: unoplatform/uno.icu#27 Context: mono/SkiaSharp#4459 Context: mono/SkiaSharp#4487 Context: https://github.com/mono/SkiaSharp/releases/tag/v4.151.0-rc.1.1 The "chore: Update to .NET 11 Preview 6" commit mentioned: > Context: dotnet/macios#25867 > … > TODO: > > * Update **Tests - Templates** to build for and run on .NET 11. > Now that dotnet/macios#25867 has been fixed, this should now be > possible. With some quick **sed(1)**s later: git grep -l net10.0 src/SolutionTemplate | xargs sed -i '' 's/net10\.0/net11.0/g' git grep -l net10.0 build/test-scripts/run*template*.ps1 | xargs sed -i '' 's/net10\.0/net11.0/g' we see that many tests pass, but anything related to WebAssembly fails: error : undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code)) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : Aborting compilation due to previous errors [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] error : '/agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Node.linux-x64/11.0.0-preview.6.26359.118/tools/bin/node /agent/_work/1/s/.dotnet/packs/Microsoft.NET.Runtime.Emscripten.5.0.6.Sdk.linux-x64/11.0.0-preview.6.26359.118/tools/emscripten/tools/compiler.mjs -' failed (returned 1) [/agent/_work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0-browserwasm] This is because Emscripten/LLVM broke ABI; see also #23626. unoplatform/uno.icu#27 contains fixes for the Uno.icu-wasm NuGet, but we also require changes to SkiaSharp by way of (at least) mono/SkiaSharp#4459 and mono/SkiaSharp#4487. Bump to Uno.icu* 77.3.0-dev.4 and SkiaSharp 4.151.0-rc.1.1 to get the Emscripten fixes and fix the above WebAssembly-related errors.
Problem
A .NET 11 Blazor WebAssembly app referencing SkiaSharp links fine (PR #4459 routes net11.0+ to the emsdk 5.0.6 static lib) but fails at runtime in a modern browser:
.NET 11 (preview 6+) links WASM apps with the new exnref exception-handling model (
WASM_LEGACY_EXCEPTIONS=0→try_table/throw_ref). SkiaSharp's emsdk 5.0.6libSkiaSharp.a/libHarfBuzzSharp.aare compiled with-fwasm-exceptionsbut without pinning the instruction variant, so they emit the legacy wasm-EH instructions (try/catch). V8 refuses to compile a module that mixes both schemes → the error.Fix
Compile the 5.0.6 (net11) variant only with the new EH instruction set so it matches .NET 11:
native/wasm/build.cake: add a_newexcemscripten feature that appends-s WASM_LEGACY_EXCEPTIONS=0toextra_cflagsandextra_cflags_cc(a compile-time codegen flag — required both for C++ exceptions and for the wasm setjmp/longjmp in the C deps like libjpeg-turbo/libpng). Emscripten'ssettings.jsdocuments that codegen-affecting settings must be passed at compile time when wasm object files are produced, which the.abuild does.scripts/azure-templates-stages-native-wasm.yml: add_newexcto the four 5.0.6 matrix entries only.net8 (3.1.34) and net9/net10 (3.1.56) stay on legacy EH to match their runtimes — those emsdks predate the exnref proposal. No packaging/targets changes are needed (
_-prefixed feature tokens are excluded from the artifact path, and the net11.0+ → 5.0.6 selection already exists from #4459).Verification
Rebuilt the emsdk 5.0.6
standst,simdlibraries from source with this change and confirmed on a net11.0 Blazor WASM app in a modern browser:4.151.0-preview.3.2(legacy EH)CompileError … mix of legacy and new exception handling instructions5.0.6/st+st,simd(new EH)native OK)3.1.56(legacy EH)Link flags confirm the split: net11 links
-mllvm -wasm-use-legacy-eh=0+-lc++-wasmexcept; net10 links-lc++-exceptwith no-wasm-use-legacy-eh=0. The rebuilt.adisassembles to the newtry_table/throw_refinstructions with no legacytry-block/delegate/rethrow. CI (build 1517651) is green: the four nativeWASM (5.0.6*)jobs build with the flag and all net8/9/10 stages are unchanged.Follow-up
Automated net11 WASM regression coverage (running the real WASM test suite on net11) is tracked as a separate stacked PR to keep this change focused on the build fix.