Spawn through the wasip3_task_vtable - #1721
Merged
alexcrichton merged 2 commits intoSep 25, 2026
Merged
Conversation
This commit adds hooks in the C ABI portion of this crate to spawn Rust tasks. This fixes the issue where spawned tasks by any particular version of `wit-bindgen` weren't guaranteed to get picked up by whatever `wit-bindgen` happened to be running exports. This still isn't a great solution because it'll take time to roll out and it'll additionally require that both imports and exports have the `async-spawn` cargo feature enabled, but it's about the best that can be done for now and at least now there's a panic indicating that a spawned task won't get polled because it's not looked at on the exported side. Closes bytecodealliance#1305
dicej
approved these changes
Sep 25, 2026
Comment on lines
+204
to
+208
| /// Drops and deallocates the provided pointer previously created by a | ||
| /// call to the `clone` callback above. | ||
| /// | ||
| /// This must not be called on the `ptr` value within `wasip3_task::ptr` as | ||
| /// that's not managed with this lifetime. |
Collaborator
There was a problem hiding this comment.
This comment appears to be cut-and-pasted and unrelated to the function it documents.
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.
This commit adds hooks in the C ABI portion of this crate to spawn Rust tasks. This fixes the issue where spawned tasks by any particular version of
wit-bindgenweren't guaranteed to get picked up by whateverwit-bindgenhappened to be running exports. This still isn't a great solution because it'll take time to roll out and it'll additionally require that both imports and exports have theasync-spawncargo feature enabled, but it's about the best that can be done for now and at least now there's a panic indicating that a spawned task won't get polled because it's not looked at on the exported side.Closes #1305