-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A command World proposal #509
Comments
We should make sure that it supports preopened files, as well as preopened directories, as discussed here. |
(I originally opened this in wasi-filesystem by mistake; I've now transferred it to the WASI repo.) |
what does "World proposal" imply? this is a top-level proposal like wasi-filesystem? would it be called wasi-command?Besides what has been mentioned, would this be the thing that defines in fact memory is required for everything? or would each proposal (e.g. filesystem) have in their WIT that the guest needs to export that? |
Wit defines a World construct, which is a way to collect sets of interfaces. For additional background I also have a blog post about Worlds. This command World would be the first WASI proposal that contains a World rather than just being an interface. We'll likely need to do some administrative work to set this up, including updating to a newer version of the wit tooling to support this. The spec that defines how linear memory used in wit APIs is the Canonical ABI. |
This proposal should specify the meaning of the first argument, to fix WebAssembly/wasi-classic-command#7, which is also being fixed for preview1 in #510. |
Mention WebAssembly/WASI#509, which is the place to follow for now.
Mention WebAssembly/WASI#509, which is the place to follow for now.
Here's a rough sketch of what the world might look like: default world wasi-command {
import wasi-clocks: pkg.wasi-clocks
import wasi-default-clocks: pkg.wasi-clocks.wasi-default-clocks
import wasi-stderr: pkg.wasi-stderr
import wasi-filesystem: pkg.wasi-filesystem
import wasi-random: pkg.wasi-random
import wasi-poll: pkg.wasi-poll
import wasi-io: pkg.wasi-io
import wasi-sockets: pkg.wasi-sockets
import wasi-exit: pkg.wasi-exit
variant preopen {
file(descriptor),
directory(descriptor),
socket(socket)
}
export command: func(
stdin: tuple<input-stream, input-terminal>,
stdout: tuple<output-stream, output-terminal>,
args: list<string>,
env-vars: list<tuple<string, string>>,
preopens: list<tuple<preopen, string>>,
timezone: timezone,
) -> result
} |
The command world proposal is now in active development at https://github.com/WebAssembly/wasi-cli ! |
We should create a CLI command World proposal.
As has been discussed at various WASI Subgroup meetings, the idea is to have a
command
entrypoint function which has arguments for things like command-line arguments, environment variables, preopens, and stdio, and to have it include wasi-filesystem, wasi-sockets, wasi-clocks, wasi-random, and others that make up a typical CLI command environment.The text was updated successfully, but these errors were encountered: