Skip to content

Conversation

@dicej
Copy link
Collaborator

@dicej dicej commented Nov 17, 2025

Per WebAssembly/component-model#575, both wasm-tools and Wasmtime have been too permissive, allowing async lifts to optionally omit a memory canonopt if only the return type (and not the parameter types) would need one. This fixes validation to require the option in such cases.

Per WebAssembly/component-model#575, both `wasm-tools`
and Wasmtime have been too permissive, allowing async lifts to optionally omit a
memory canonopt if only the return type (and not the parameter types) would need
one.  This fixes validation to require the option in such cases.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej requested a review from alexcrichton November 17, 2025 21:08
@dicej dicej requested a review from a team as a code owner November 17, 2025 21:08
@alexcrichton
Copy link
Member

I'll work on the test failures, but can you add a test along the lines of bytecodealliance/wasmtime#11726 to ensure that wit-component correctly adds the canonical options necessary for the lift too?

@dicej dicej marked this pull request as draft November 17, 2025 21:21
@dicej
Copy link
Collaborator Author

dicej commented Nov 17, 2025

I'll work on the test failures, but can you add a test along the lines of bytecodealliance/wasmtime#11726 to ensure that wit-component correctly adds the canonical options necessary for the lift too?

Yeah, I realized there was more to do right after I opened this 🤦

@alexcrichton
Copy link
Member

Ok pushed up a commit which should resolve the test failure

@alexcrichton
Copy link
Member

Also, on second thought, shouldn't this also require realloc if the result contains a pointer? E.g. if you return a string we want the same restriction in place where the lift requires a realloc even if the params don't need it

@dicej
Copy link
Collaborator Author

dicej commented Nov 17, 2025

Also, on second thought, shouldn't this also require realloc if the result contains a pointer? E.g. if you return a string we want the same restriction in place where the lift requires a realloc even if the params don't need it

When would lifting ever require realloc? Any allocations would have already been performed by the guest by the time it calls task.return.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yes carry on, got my polarities swapped

@dicej dicej marked this pull request as ready for review November 17, 2025 22:02
@dicej dicej enabled auto-merge November 17, 2025 22:03
@dicej dicej added this pull request to the merge queue Nov 17, 2025
Merged via the queue into bytecodealliance:main with commit 01fc821 Nov 17, 2025
34 checks passed
@dicej dicej deleted the require-memory-for-async-lifts branch November 17, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants