Skip to content

Commit 8532197

Browse files
authored
Merge pull request #22 from dp-mason/main
wasm32-wasi -> wasm32-wasip1
2 parents f833994 + 6e7d9d3 commit 8532197

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions-rs/toolchain@v1
3838
with:
3939
toolchain: stable
40-
target: wasm32-wasi
40+
target: wasm32-wasip1
4141

4242
- name: Check Rust Version
4343
run: rustc --version

bindgen-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ case $1 in
3333
echo "building '$PLUGIN_NAME'..."
3434
xtp plugin build --path $PLUGIN_NAME
3535
echo "testing '$PLUGIN_NAME'..."
36-
xtp plugin test $PLUGIN_NAME/target/wasm32-wasi/release/plugin.wasm --with test.wasm --mock-host mock.wasm
36+
xtp plugin test $PLUGIN_NAME/target/wasm32-wasip1/release/plugin.wasm --with test.wasm --mock-host mock.wasm
3737
;;
3838
esac

template/.cargo/config.toml.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
target = "wasm32-wasi"
2+
target = "wasm32-wasip1"

template/prepare.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ if ! (command_exists cargo); then
2828
echo ""
2929
fi
3030

31+
if ! (command_exists rustup); then
32+
missing_deps=1
33+
echo "❌ rustup is missing. Check your rust installation."
34+
echo ""
35+
fi
36+
3137
# Exit with a bad exit code if any dependencies are missing
3238
if [ "$missing_deps" -ne 0 ]; then
3339
echo "Install the missing dependencies and ensure they are on your path. Then run this command again."
@@ -36,5 +42,17 @@ if [ "$missing_deps" -ne 0 ]; then
3642
exit 1
3743
fi
3844

45+
if ! (rustup target list --installed | grep -q '^wasm32-wasip1$'); then
46+
if ! (rustup target add wasm32-wasip1); then
47+
echo "❌ error encountered while adding target \"wasm32-wasip1\""
48+
echo ""
49+
echo "Update rustup with:"
50+
echo "👉 rustup update"
51+
echo ""
52+
exit 1
53+
fi
54+
fi
3955

40-
56+
if ! (rustup target list --installed | grep -q '^wasm32-unknown-unknown$'); then
57+
rustup target add wasm32-unknown-unknown
58+
fi

template/xtp.toml.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
app_id = "<%= project.appId %>"
22

33
# This is where 'xtp plugin push' expects to find the wasm file after the build script has run.
4-
bin = "target/wasm32-wasi/release/plugin.wasm"
4+
bin = "target/wasm32-wasip1/release/plugin.wasm"
55
extension_point_id = "<%= project.extensionPointId %>"
66
# This is the 'binding' name used for the plugin.
77
name = "<%= project.name %>"
88

99
[scripts]
1010
# xtp plugin build runs this script to generate the wasm file
11-
build = "cargo build --release --target wasm32-wasi"
11+
build = "cargo build --release --target wasm32-wasip1"
1212

1313
# xtp plugin init runs this script to format the code
1414
format = "cargo fmt"

0 commit comments

Comments
 (0)