Skip to content
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

implement std.Progress IPC for WASI #20104

Open
Tracked by #20059
andrewrk opened this issue May 29, 2024 · 0 comments
Open
Tracked by #20059

implement std.Progress IPC for WASI #20104

andrewrk opened this issue May 29, 2024 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-wasi standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #20059.

The Zig Progress ABI uses a POSIX pipe for the file descriptor passed to the child process for reporting progress. WASI does not support POSIX but it does have a mechanism we can use for this purpose which is a "preopen".

Let's define /ZIG_PROGRESS as a special preopen name that can be used for WASI applications to send progress updates over. WASI applications would not support being the parent process since they don't have the ability to output escape codes to the terminal, but they would support being the child.

This issue might be tricky because it might require features added to external projects such as wasmtime. In particular we need the ability to create a pipe, and spawn wasmtime as a child process, passing the pipe as /ZIG_PROGRESS preopen. We'll need to work with third party projects to find out the best way to accomplish this.

This issue can be closed when a parent process compiled to native machine code can spawn a third party executor such as wasmtime as a child process, which runs a zig program compiled to wasm32-wasi, and the child process communicates its progress via std.Progress to the parent.

@andrewrk andrewrk added standard library This issue involves writing Zig code for the standard library. os-wasi labels May 29, 2024
@andrewrk andrewrk added this to the 0.16.0 milestone May 29, 2024
@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label May 29, 2024
@andrewrk andrewrk mentioned this issue May 29, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-wasi standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

1 participant