Repository navigation
[wasi] Accept explicit return in WASI R2R host constant exports - #136243
Merged
Merged
Conversation
Debug builds of the WASI host compile the wasi_r2r_* accessors to `i32.const X; return; end`, which WasmModuleInfoReader rejected, so ReadyToRun composition failed with "The host does not export constant i32 function 'wasi_r2r_image_base'" for every Debug CoreCLR WASI publish. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
pavelsavara
approved these changes
Oct 22, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Debug builds of the WASI host compile the
wasi_r2r_*accessors toi32.const N; return; end(Release emitsi32.const N; end), whichWasmModuleInfoReaderrejected, so every Debug CoreCLR WASI ReadyToRun publish failed withThe host does not export constant i32 function 'wasi_r2r_image_base'. The reader now accepts an optionalreturnbeforeend.Validation (osx-arm64, wasmtime 49.0.1):
./build.sh -s clr+libs+host+packs -os wasi -arch wasm -c Debug, thendotnet publishofsrc/mono/sample/wasi/consolewith-c Debug -p:RuntimeFlavor=CoreCLR -p:PublishReadyToRun=true: fails with the error above without the fix; succeeds with it (compositeWasi.Console.Sample.r2r.wasmcomposed intocorerun), and the app runs and prints its args.-c Releaseruntime and app: publish and run still succeed.wasm-tools printof the Debugcorerunconfirms all fivewasi_r2r_*exports have thei32.const; returnshape.There are no existing unit tests for
WasmModuleInfoReader.Note
This PR was generated with GitHub Copilot.