Repository navigation
feat: Add WebGL 4GB fix test and backport emscripten GL_UNPACK_ROW_LENGTH patch - #1062
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1062.eastus2.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated regression test project to validate the WebGL 4GB heap backport for emscripten’s GL_UNPACK_ROW_LENGTH handling, and introduces MSBuild targets that patch dotnet.native.*.js when -s MAXIMUM_MEMORY=4GB is used (plus CI wiring to run the test on Linux).
Changes:
- Add
Uno.Wasm.Tests.WebGL4Gbtest project (C# + a tiny native C shim) to force-link WebGL glue and validate patch behavior for both build and publish outputs. - Backport the emscripten #21980 fix by in-place patching of
_framework/dotnet.native.*.jsfor 4GB builds (build + publish variants). - Run the new WebGL 4GB validation script in the Linux CI test stage.
Issue link: Not provided in the metadata. Please add a Fixes/Closes/Related to https://github.com/unoplatform/Uno.Wasm.Bootstrap/issues/#<issue_number> line to the PR description (or the “no issue by design” note per repo guidelines).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Uno.Wasm.Tests.WebGL4Gb/webgl-force-link.c |
Forces WebGL symbol usage so emscripten links library_webgl.js into dotnet.native.js for a meaningful patch validation. |
src/Uno.Wasm.Tests.WebGL4Gb/Uno.Wasm.Tests.WebGL4Gb.csproj |
Adds a WebAssembly test app with an opt-in 4GB build flag and native file reference. |
src/Uno.Wasm.Tests.WebGL4Gb/test-webgl-4gb.sh |
Script that asserts the patch is applied for 4GB builds/publish and not applied when the flag is disabled. |
src/Uno.Wasm.Tests.WebGL4Gb/Program.cs |
Minimal test entrypoint for the dedicated WebGL 4GB test app. |
src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets |
Adds MSBuild targets that patch dotnet.native.*.js for 4GB builds and remove stale compressed siblings in publish output. |
src/Uno.Wasm.Bootstrap.sln |
Registers the new Uno.Wasm.Tests.WebGL4Gb project in the solution. |
build/ci/stage-build-linux-tests.yml |
Runs the new WebGL 4GB test script as part of Linux tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…alidation for native JS files
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1062.eastus2.1.azurestaticapps.net |
…nce and improve JavaScript validity checks
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1062.eastus2.1.azurestaticapps.net |
…ling and stale compressed file checks
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1062.eastus2.1.azurestaticapps.net |
| Condition="'@(WasmShellExtraEmccFlags)' != '' AND '$(WasmBuildingForNestedPublish)' != 'true'"> | ||
|
|
||
| <!-- | ||
| Item references (@(...)) are NOT expanded inside a property-function | ||
| string argument, so the 4GB flag cannot be detected with | ||
| [System.String]::Copy('@(WasmShellExtraEmccFlags)').Contains(...). | ||
| Flatten the flags into a property first, then test that property. | ||
| --> | ||
| <PropertyGroup> | ||
| <_UnoExtraEmccFlagsFlat>@(WasmShellExtraEmccFlags)</_UnoExtraEmccFlagsFlat> | ||
| <_UnoPatchWebGLFor4Gb>$(_UnoExtraEmccFlagsFlat.Contains('MAXIMUM_MEMORY=4GB'))</_UnoPatchWebGLFor4Gb> | ||
| </PropertyGroup> |
| Condition="'@(WasmShellExtraEmccFlags)' != '' AND '$(WasmBuildingForNestedPublish)' != 'true'"> | ||
|
|
||
| <!-- See the build-output target above for why the 4GB flag is detected via a flattened property. --> | ||
| <PropertyGroup> | ||
| <_UnoExtraEmccFlagsFlat>@(WasmShellExtraEmccFlags)</_UnoExtraEmccFlagsFlat> | ||
| <_UnoPatchWebGLFor4Gb>$(_UnoExtraEmccFlagsFlat.Contains('MAXIMUM_MEMORY=4GB'))</_UnoPatchWebGLFor4Gb> | ||
| </PropertyGroup> |
Fix for unoplatform/uno#23368