Skip to content

Commit

Permalink
don't accidentally use old files
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Sep 27, 2024
1 parent d9c9ec3 commit ece3335
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bench-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ if [ -z "$BENCH_NAME" ]; then
exit 1
fi

# Function to delete any old .wasm files related to the current benchmark
cleanup_old_wasm_files() {
WASM_FILES=$(find target/wasm32-wasi/release/deps/ -type f -name "*$BENCH_NAME*.wasm")

if [ -n "$WASM_FILES" ]; then
echo "Cleaning up old WASM files for benchmark '$BENCH_NAME'..."
rm -f $WASM_FILES
else
echo "No old WASM files found for benchmark '$BENCH_NAME'."
fi
}

# Call the cleanup function
cleanup_old_wasm_files

# Build the WASM benchmark with cargo-wasi
echo "Building benchmark '$BENCH_NAME' with cargo-wasi..."
cargo wasi build --bench="$BENCH_NAME" --release
Expand Down

0 comments on commit ece3335

Please sign in to comment.