Skip to content

Commit 7f3bbfc

Browse files
committed
wasm: point wasmtime's cache at the writable test tmpdir
CI passes --test_env=HOME, and linux-sandbox mounts the agent's HOME read-only, so wasmtime's default compilation cache hard-failed with 'failed to create cache directory'. Set XDG_CACHE_HOME to the test tmpdir, and stop swallowing wasmtime's stderr so failures like this are visible in the test log. Claude-Session: https://claude.ai/code/session_01SmG1kqA3qB4WsLGU2xavuJ
1 parent 18258aa commit 7f3bbfc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

examples/cross_compilation/wasm/reactor_test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ set -euo pipefail
99
wasmtime="$TEST_SRCDIR/$1"
1010
reactor="$TEST_SRCDIR/$2"
1111

12-
actual="$("$wasmtime" run --invoke greeting_length "$reactor" 2>/dev/null)"
12+
# wasmtime writes a compilation cache under XDG_CACHE_HOME (falling back to
13+
# $HOME), which can be read-only inside the test sandbox (e.g. when CI passes
14+
# --test_env=HOME); point it at the writable test tmpdir.
15+
export XDG_CACHE_HOME="${TEST_TMPDIR:-${TMPDIR:-/tmp}}"
16+
17+
actual="$("$wasmtime" run --invoke greeting_length "$reactor")"
1318
if [[ "$actual" != "30" ]]; then
1419
echo "error: expected greeting_length to return 30, got: $actual" >&2
1520
exit 1

0 commit comments

Comments
 (0)