Repository navigation
Implementation of wasi:cli@0.2.12 - #70
Merged
Merged
Conversation
jeremyg484
requested changes
Oct 21, 2026
jeremyg484
left a comment
Collaborator
There was a problem hiding this comment.
Looking great!
I've reviewed it mainly with an eye towards compatibility with my in-progress wasi:sockets, and noted (mostly for myself since this will likely merge first) one case in the error handling in bindgen that will need to be handled carefully when we merge sockets.
A few other potential issues were caught with an AI review that feel like they're worth addressing in some form.
jeremyg484
approved these changes
Oct 27, 2026
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.
Implements
wasi:cli@0.2.12, the last interfaces a typical Rustwasm32-wasip2program needs.resultused as a value (a parameter, or inside another type) now maps to a newrun.endive.cm.runtime.Result<T, E>, lifted and lowered like tuples.exit: func(status: result)needs it. Results returned by a function keep their current mapping.deps/wasi_cli@0.2.12.witis printed like the other deps, including itsimportsandcommandworlds, and theendive:wasiworld is nowinclude wasi:cli/imports@0.2.12.run.endive.cm.wasi.p2.cli):exitandexit-with-code, which throwWasiExitException;PrintStreamsuch as a brokenSystem.outpipe reported to the guest;withArguments,withEnvironment,withStdin/withStdout/withStderr(each optionally with a TTY flag) andinheritSystemStreams.int run(ComponentStore, WasmComponent)calls the guest'swasi:cli/runexport, matched to 0.2 by the same compatible-version rule as imports (Link guests importing semver-compatible interface versions #69), and returns its exit code.inheritSystemStreamscounts them as terminals when the JVM has a console, which JDK 22 to 24 report even for redirected streams, as its Javadoc says.Tests:
CliGuestTest(12 end to end, WAT guest), unit tests for each host, the bindgenResultValuesTest, a bindgen test of an error type one interface returns and another takes as a value (with #73's shared exceptions), and a virtual-threadruntest inwasi-p2-loom-tests.