Skip to content

deprecate [Typed]Func::post_return[_async] and make them no-ops#12498

Merged
dicej merged 6 commits intobytecodealliance:mainfrom
dicej:deprecate-post-return
Feb 3, 2026
Merged

deprecate [Typed]Func::post_return[_async] and make them no-ops#12498
dicej merged 6 commits intobytecodealliance:mainfrom
dicej:deprecate-post-return

Conversation

@dicej
Copy link
Copy Markdown
Contributor

@dicej dicej commented Feb 2, 2026

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.

@dicej dicej requested a review from alexcrichton February 2, 2026 22:34
@dicej dicej requested review from a team as code owners February 2, 2026 22:34
@github-actions github-actions bot added fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. wizer Issues related to Wizer snapshotting, pre-initialization, and the `wasmtime wizer` subcommand labels Feb 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

Subscribe to Label Action

cc @fitzgen

Details This 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:

  • fitzgen: fuzzing, wizer

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Copy Markdown
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.

For the "Monolith checks" CI job if you rebase on main that'll resolve that error

dicej added 2 commits February 3, 2026 07:20
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.
@dicej dicej force-pushed the deprecate-post-return branch from 21934a4 to bef631c Compare February 3, 2026 16:51
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`
@dicej dicej force-pushed the deprecate-post-return branch from d82cb50 to fbb4ce3 Compare February 3, 2026 17:52
@dicej dicej requested a review from alexcrichton February 3, 2026 18:47
@dicej
Copy link
Copy Markdown
Contributor Author

dicej commented Feb 3, 2026

@alexcrichton thanks for the feedback as always. I believe I've addressed everything, including removing the obsolete functions, flags, fields, and parameters.

Now that post-return calls are handled internally without requiring explicit
action by the embedder, we can avoid unnecessary bookkeeping.
@dicej dicej force-pushed the deprecate-post-return branch from 98c166d to 72d8304 Compare February 3, 2026 18:57
@dicej dicej enabled auto-merge February 3, 2026 18:58
@dicej dicej added this pull request to the merge queue Feb 3, 2026
Merged via the queue into bytecodealliance:main with commit c09aa38 Feb 3, 2026
49 checks passed
@dicej dicej deleted the deprecate-post-return branch February 3, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. wizer Issues related to Wizer snapshotting, pre-initialization, and the `wasmtime wizer` subcommand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants