Skip to content

implement std.Progress IPC for WASI #20104

Open
@andrewrk

Description

@andrewrk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.os-wasistandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions