Uh oh!
There was an error while loading. Please reload this page.
[wasm] Use lightweight marshal for enums - #118991
Conversation
Tagging subscribers to 'arch-wasm': @lewing |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Larry Ewing <lewing@microsoft.com>
There was a problem hiding this comment.
Pull Request Overview
This PR enables lightweight marshalling for enum types in WebAssembly builds. The fix addresses a runtime marshalling issue where enums were not being recognized as supported types by the lightweight marshaller, even though they were marked as marshallable during the build process.
Key changes:
- Updated runtime marshalling logic to recognize enums as lightweight-marshallable types
- Added test coverage for enum marshalling through ZipArchive interop functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mono/mono/component/marshal-ilgen-stub.c | Added enum type check to allow lightweight marshalling for enums |
| src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs | Added test class that exercises enum marshalling through ZipArchive operations |
| src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js | Added test case entry point for ZipArchiveInteropTest |
| src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs | Added test method to verify ZipArchive enum marshalling functionality |
Uh oh!
There was an error while loading. Please reload this page.
…pTest.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
maraf
commented
Sep 3, 2025
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17425549273 |
* Use lightweight marshal for enums * Wasm build test * Fix * Fix test app build * Fix test app build * Fix test asserts * Fix test case * Build tests are not JS bundler friendly * Update src/mono/mono/component/marshal-ilgen-stub.c Co-authored-by: Larry Ewing <lewing@microsoft.com> * Update src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Larry Ewing <lewing@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Based on
MinimalMarshalingTypeCompatibilityProvider.cswe mark enums as marshallable by lightweight marshaller on build.We were missing enums when checking for supported types in
marshal-ilgen-stub.con runtime.Fixes#115780
Contributes to #94187