Skip to content

Commit 823f79d

Browse files
committed
fix: grant write permissions to perf_test_data directory for wasmtime benchmarks
The benchmarks were failing because wasmtime needs explicit --dir permissions to write output files. Tested locally and confirmed the fix works. Changes: - Add --dir=perf_test_data to all wasmtime run commands - Applies to both regular and AOT component benchmarks
1 parent cc33333 commit 823f79d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/performance.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ jobs:
144144
if command -v wasmtime &> /dev/null; then
145145
# Test the command first to see if it works
146146
echo "Testing WASM component execution..."
147-
if wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_copy.txt; then
147+
if wasmtime run --dir=. --dir=perf_test_data bazel-bin/tinygo/file_ops_component.wasm copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_copy.txt; then
148148
echo "✅ WASM component test passed, running benchmarks..."
149149
150150
# Run benchmark with proper error handling
151151
hyperfine --export-json tinygo_wasm_benchmark.json \
152152
--warmup 3 \
153153
--show-output \
154-
'wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_copy.txt' \
154+
'wasmtime run --dir=. --dir=perf_test_data bazel-bin/tinygo/file_ops_component.wasm copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_copy.txt' \
155155
|| echo "⚠️ Benchmark failed but continuing" >> perf_results.md
156156
157157
echo "✅ TinyGo component benchmarks completed" >> perf_results.md
@@ -185,7 +185,7 @@ jobs:
185185
if command -v wasmtime &> /dev/null; then
186186
# Test the AOT precompiled component first
187187
echo "Testing AOT precompiled component execution..."
188-
if wasmtime run --allow-precompiled --dir=. "$AOT_FILE" copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_aot_copy.txt; then
188+
if wasmtime run --allow-precompiled --dir=. --dir=perf_test_data "$AOT_FILE" copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_aot_copy.txt; then
189189
echo "✅ AOT component test passed, running benchmarks..."
190190
191191
# Run benchmark comparing regular vs AOT
@@ -195,7 +195,7 @@ jobs:
195195
hyperfine --export-json tinygo_aot_benchmark.json \
196196
--warmup 3 \
197197
--show-output \
198-
"wasmtime run --allow-precompiled --dir=. $AOT_FILE copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_aot_copy.txt" \
198+
"wasmtime run --allow-precompiled --dir=. --dir=perf_test_data $AOT_FILE copy_file --src perf_test_data/small.txt --dest perf_test_data/wasm_aot_copy.txt" \
199199
|| echo "⚠️ AOT benchmark failed but continuing" >> perf_results.md
200200
201201
# Extract and compare results

0 commit comments

Comments
 (0)