Skip to content

Commit 8328add

Browse files
authored
chore: Detect if there's already a rustc installed that can target wasm32-wasi (#647)
1 parent 6a7fc8c commit 8328add

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

runtime/spidermonkey/build-engine.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ esac
6464

6565

6666
# Ensure the Rust version matches that used by Gecko, and can compile to WASI
67-
rustup target add wasm32-wasi
67+
rustc_valid=
68+
if command -v rustc > /dev/null && command -v cargo > /dev/null; then
69+
if rustc --print target-list | grep -q '^wasm32-wasi$'; then
70+
rustc_valid=1
71+
fi
72+
fi
73+
74+
if [ -z "$rustc_valid" ]; then
75+
rustup target add wasm32-wasi
76+
fi
6877

6978
# Use Gecko's build system bootstrapping to ensure all dependencies are
7079
# installed

0 commit comments

Comments
 (0)