Files
sausage/userland/spawn

World process library

sausage-spawn starts WASI components through sausage:process/host@0.1.0. It uses wit-bindgen 0.46.0 and the canonical host/wit/process.wit. It adds no host interface.

use sausage_spawn::Command;
let status = Command::new("printenv").arg("FOO").env("FOO", "1").status()?;
assert_eq!(status, 0);
# Ok::<(), std::io::Error>(())

A command inherits the environment, cwd, and all three streams. Stdio::Pipe exposes the generated WASI stream resource on Child. Stdio::Null discards output or supplies EOF. Drop piped stdin to supply EOF. Drain both output pipes before wait to prevent a bounded-pipe deadlock. try_wait returns the numeric status when the child finishes. kill stops every process in the child's group through the process interface. Use Command::new_group before spawn when the caller must survive a child kill. timeout uses a separate child group. Drop does not kill the child.

Run nix develop -c nu userland/spawn/check-imports.nu to inspect the release components. The script keeps the complete WIT output and checks each import.