Skip to content

Commit

Permalink
chore(cargo): update target name to wasm32-wasip1
Browse files Browse the repository at this point in the history
  • Loading branch information
flrgh committed Sep 24, 2024
1 parent 98ffa68 commit cad366b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build]
target = "wasm32-wasi"
target = "wasm32-wasip1"
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
toolchain: stable
override: true
components: cargo
target: wasm32-wasi
target: wasm32-wasip1

- name: install wasm-opt optimizer
uses: actions-rs/cargo@v1
Expand All @@ -37,4 +37,4 @@ runs:
uses: actions-rs/cargo@v1
with:
command: build
args: --target wasm32-wasi
args: --target wasm32-wasip1
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:

- name: optimize
run: |
if ! test -f target/wasm32-wasi/release/datakit.wasm; then
if ! test -f target/wasm32-wasip1/release/datakit.wasm; then
echo "missing output binary"
exit 1
fi
wasm-opt -O4 \
./target/wasm32-wasi/release/datakit.wasm \
./target/wasm32-wasip1/release/datakit.wasm \
-o ./datakit.wasm
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: cargo test
# for some reason cargo won't run unit tests against the default wasm32-wasi target
# for some reason cargo won't run unit tests against the default wasm32-wasip1 target
run: cargo test --target x86_64-unknown-linux-gnu

check:
Expand Down
4 changes: 2 additions & 2 deletions test/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ message "Building the filter using cargo..."

(
cd ..
cargo build --target=wasm32-wasi --release || exit 1
cargo build --target=wasm32-wasip1 --release || exit 1
) || exit 1

### Copy filter to wasm/ #######################################################

mkdir -p wasm

cp -a ../target/wasm32-wasi/release/*.wasm wasm/
cp -a ../target/wasm32-wasip1/release/*.wasm wasm/
cp ../*.meta.json wasm/

script_dir=$(dirname $(realpath $0))
Expand Down

0 comments on commit cad366b

Please sign in to comment.