From 9fb1e05686b870e812e23cfc26bc629a1a90ab1e Mon Sep 17 00:00:00 2001 From: Surma Date: Fri, 23 Oct 2026 09:26:12 +0100 Subject: [PATCH] sdk tests: run the wasmtime CLI without a disk cache; show its stderr on EOF The Nix sandbox has no writable home folder, so wasmtime run failed to create its cache folder. --- sdk/tests/wasi.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/tests/wasi.rs b/sdk/tests/wasi.rs index d67ebc2..a56e89c 100644 --- a/sdk/tests/wasi.rs +++ b/sdk/tests/wasi.rs @@ -32,7 +32,14 @@ impl Process { fn read(&mut self) -> Value { loop { let mut s = String::new(); - assert_ne!(self.output.read_line(&mut s).unwrap(), 0, "unexpected EOF"); + if self.output.read_line(&mut s).unwrap() == 0 { + let mut stderr = String::new(); + let _ = std::io::Read::read_to_string( + self.child.stderr.as_mut().unwrap(), + &mut stderr, + ); + panic!("unexpected EOF from wasmtime. Its stderr:\n{stderr}"); + } if let Ok(v) = sausage_plugin::serde_json::from_str::(&s) && v["jsonrpc"] == "2.0" { @@ -51,6 +58,9 @@ fn start(wasm: &Path, dir: &Path) -> Process { let mut child = Command::new("wasmtime") .args([ "run", + // Without a disk cache: the Nix sandbox has no writable home folder. + "-C", + "cache=n", "-S", "inherit-network=y", "--env",