We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Flush, then poll on the stdout, will cause the program to hang.
The program finishes, as wasmtime's behavior.
cargo component new flush --lib && cd flush
deps.toml
wit-deps update
cli = "https://github.com/Webassembly/wasi-cli/archive/refs/tags/v0.2.0.tar.gz"
world.wit
package component:flush; /// An example world for the component to target. world example { include wasi:cli/command@0.2.0; }
Cargo.toml
[package.metadata.component.target.dependencies] "wasi:random" = { path = "wit/deps/random" } "wasi:cli" = { path = "wit/deps/cli" } "wasi:io" = { path = "wit/deps/io" } "wasi:clocks" = { path = "wit/deps/clocks" } "wasi:filesystem" = { path = "wit/deps/filesystem" } "wasi:sockets" = { path = "wit/deps/sockets" }
src/lib.rs
#[allow(warnings)] mod bindings; use bindings::wasi; use crate::bindings::exports::wasi::cli::run::Guest; struct Component; impl Guest for Component { fn run() -> Result<(), ()> { let stdout = wasi::cli::stdout::get_stdout(); stdout.flush().unwrap(); let poll = stdout.subscribe(); poll.block(); Ok(()) } } bindings::export!(Component with_types_in bindings);
cargo component build
wasmtime run target/wasm32-wasip1/debug/flush.wasm
jco run target/wasm32-wasip1/debug/flush.wasm
The text was updated successfully, but these errors were encountered:
Hey @peter-jerry-ye a bit late here, but thanks for reporting this -- will try to build it & reproduce.
Sorry, something went wrong.
No branches or pull requests
Description
Flush, then poll on the stdout, will cause the program to hang.
Expected behavior
The program finishes, as wasmtime's behavior.
Steps to reproduce:
cargo component new flush --lib && cd flush
deps.toml
and runwit-deps update
:world.wit
(anddeps.toml
) to:Cargo.toml
src/lib.rs
cargo component build
wasmtime run target/wasm32-wasip1/debug/flush.wasm
andjco run target/wasm32-wasip1/debug/flush.wasm
The text was updated successfully, but these errors were encountered: