[wasm] Use lightweight marshal for enums#118991
Merged
lewing merged 11 commits intodotnet:mainfrom Sep 3, 2025
Merged
Conversation
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing |
This was referenced Aug 22, 2025
lewing
reviewed
Aug 26, 2025
This was referenced Aug 27, 2025
Open
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Contributor
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 |
src/mono/wasm/testassets/WasmBasicTestApp/App/ZipArchiveInteropTest.cs
Outdated
Show resolved
Hide resolved
…pTest.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pavelsavara
approved these changes
Sep 2, 2025
lewing
approved these changes
Sep 2, 2025
lewing
reviewed
Sep 2, 2025
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17425549273 |
4 tasks
filipnavara
pushed a commit
to filipnavara/runtime
that referenced
this pull request
Sep 5, 2025
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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