Skip to content

Commit

Permalink
Add build-debug script
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshia001 committed May 31, 2024
1 parent 46d0d4b commit 210da85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/sh

set -euo pipefail
set -x

# Note: cargo-wasix automatically runs wasm-opt with -O2, which makes the resulting binary unusable.
# Instead, we use the toolchain to build (cargo +wasix instead of cargo wasix) and optimize manually.
cargo +wasix build --target wasm32-wasmer-wasi
mv target/wasm32-wasmer-wasi/debug/winterjs.wasm x.wasm
wasm-opt x.wasm -o target/wasm32-wasmer-wasi/debug/winterjs.wasm -O1 --enable-bulk-memory --enable-threads --enable-reference-types --no-validation --asyncify
rm x.wasm
wasm-strip target/wasm32-wasmer-wasi/debug/winterjs.wasm

0 comments on commit 210da85

Please sign in to comment.