wizer: support init func as a wave function call (components only)#13582
Merged
pchickey merged 8 commits intoJun 8, 2026
Merged
Conversation
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "wizer"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
73ce7f0 to
0f52f6e
Compare
dicej
approved these changes
Jun 8, 2026
| .await | ||
| .with_context(|| format!("the initialization function trapped"))?; | ||
|
|
||
| // TODO: do we want some way to report the values of `rets` back up? |
Contributor
There was a problem hiding this comment.
Not a blocker for this PR, but it would be nice to return them from Wizer::run_component and, in the case of the CLI, print them to stdout.
Contributor
Author
There was a problem hiding this comment.
Agreed, and already done :) They actually already print to stdout in the cli because its using the run --invoke code under the hood in there -- command/wizer.rs is integrated so nicely with command/run.rs! great work @alexcrichton it was a joy to realize how little I had to do to benefit from that.
766dc52 to
cf7ba32
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.
Wizer now supports wave function call expressions being used as an init func for components, e.g.
local:local/init.add-string@0.1.0("hello, world")This works from both the crate interface and the wasmtime-cli interface.
When
wasmtime wizer --init-func (func expr)is used with a component, it will print the function results in wave to stdout. This opens up a clever mode where you can use a component on disk as a stateful rpc server with wave encoding for the request and response.The diff for the change is straightforward. New test-program to exercise, and a test exercising this functionality has been added to the wizer crate and wasmtime-cli.
Docs for the wasmtime-cli options were updated, including a case I missed from
run --invokein #13564