Skip to content

Commit 0331886

Browse files
committed
fix: use absolute path for wasmtime WASI directory mapping
- Change --dir=. to --dir=$PWD_PATH for proper WASI sandbox access - Fixes 'errno 2' file not found errors in regression detection - WASI sandboxing requires explicit absolute paths for directory access - Update both baseline and PR benchmark commands
1 parent c1b2525 commit 0331886

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/performance.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ jobs:
439439
440440
# Test wasmtime command first to ensure it works
441441
echo "Testing wasmtime command..."
442-
wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt || {
442+
PWD_PATH=$(pwd)
443+
wasmtime run --dir=$PWD_PATH bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt || {
443444
echo "ERROR: wasmtime command failed"
444445
exit 1
445446
}
@@ -451,7 +452,7 @@ jobs:
451452
hyperfine --export-json baseline_results/baseline_benchmark.json \
452453
--warmup 3 \
453454
--show-output \
454-
'wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt'
455+
"wasmtime run --dir=$PWD_PATH bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest baseline_copy.txt"
455456
456457
- name: Checkout PR Branch
457458
run: |
@@ -464,7 +465,8 @@ jobs:
464465
465466
# Test wasmtime command first
466467
echo "Testing wasmtime command on PR branch..."
467-
wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt || {
468+
PWD_PATH=$(pwd)
469+
wasmtime run --dir=$PWD_PATH bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt || {
468470
echo "ERROR: wasmtime command failed on PR branch"
469471
exit 1
470472
}
@@ -476,7 +478,7 @@ jobs:
476478
hyperfine --export-json pr_results/pr_benchmark.json \
477479
--warmup 3 \
478480
--show-output \
479-
'wasmtime run --dir=. bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt'
481+
"wasmtime run --dir=$PWD_PATH bazel-bin/tinygo/file_ops_component.wasm copy_file --src baseline_test.txt --dest pr_copy.txt"
480482
481483
- name: Analyze Performance Regression
482484
run: |

0 commit comments

Comments
 (0)