deprecate [Typed]Func::post_return[_async] and make them no-ops#12498
Merged
dicej merged 6 commits intobytecodealliance:mainfrom Feb 3, 2026
Merged
deprecate [Typed]Func::post_return[_async] and make them no-ops#12498dicej merged 6 commits intobytecodealliance:mainfrom
[Typed]Func::post_return[_async] and make them no-ops#12498dicej merged 6 commits intobytecodealliance:mainfrom
Conversation
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:c-api", "wizer"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
reviewed
Feb 3, 2026
Member
alexcrichton
left a comment
There was a problem hiding this comment.
For the "Monolith checks" CI job if you rebase on main that'll resolve that error
With the advent of the Component Model concurrency ABI and it's `task.return` intrinsic, post-return functions have been informally deprecated and are expected to be removed for WASI 1.0 and the corresponding stable edition of the Component Model. Consequently, it does not make sense anymore to require embedders to explicitly call the post-return function after using `[Typed]Func::call[_async]`. As of this commit, `[Typed]Func::post_return[_async]` are no-ops. Instead, the post-return function is called automatically as part of `[Typed]Func::call[_async]` if present, which is how `[Typed]Func::call_concurrent` has worked all along. In addition, this commit fixes and tests a couple of cases where the task and/or thread was being disposed of before the post-return function was called.
21934a4 to
bef631c
Compare
Specifically, I've split the `invoke_post_return` test into multiple tests: - using `TypedFunc::call` - using `TypedFunc::call_async` with concurrency support enabled - using `TypedFunc::call_async` with concurrency support disabled - using `Func::call_async` with concurrency support disabled - using `TypedFunc::call_concurrent`
d82cb50 to
fbb4ce3
Compare
This broke the MSVC build.
Contributor
Author
|
@alexcrichton thanks for the feedback as always. I believe I've addressed everything, including removing the obsolete functions, flags, fields, and parameters. |
alexcrichton
approved these changes
Feb 3, 2026
Now that post-return calls are handled internally without requiring explicit action by the embedder, we can avoid unnecessary bookkeeping.
98c166d to
72d8304
Compare
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.
With the advent of the Component Model concurrency ABI and it's
task.returnintrinsic, post-return functions have been informally deprecated and are expected to be removed for WASI 1.0 and the corresponding stable edition of the Component Model. Consequently, it does not make sense anymore to require embedders to explicitly call the post-return function after using[Typed]Func::call[_async].As of this commit,
[Typed]Func::post_return[_async]are no-ops. Instead, the post-return function is called automatically as part of[Typed]Func::call[_async]if present, which is how[Typed]Func::call_concurrenthas worked all along. In addition, this commit fixes and tests a couple of cases where the task and/or thread was being disposed of before the post-return function was called.