-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathinstall-wasi.sh
More file actions
34 lines (23 loc) · 1.11 KB
/
install-wasi.sh
File metadata and controls
34 lines (23 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/bash -ex
# Install the WASI SDK.
# This should be portable to any Linux, but is only tested in the devcontainer.
case "${TARGETARCH}" in
amd64) WASI_ARCH="x86_64" ;;
arm64) WASI_ARCH="arm64" ;;
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;;
esac && \
URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_ARCH}-linux.tar.gz
curl --location $URL | tar --directory /opt --extract --gunzip
# For Python 3.13 as Tools/wasm/wasi.py expects /opt/wasi-sdk.
ln -s /opt/wasi-sdk-${WASI_SDK_VERSION}.0*/ /opt/wasi-sdk
mkdir --parents ${WASMTIME_HOME}
case "${TARGETARCH}" in
amd64) WASMTIME_ARCH="x86_64" ;;
arm64) WASMTIME_ARCH="aarch64" ;;
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;;
esac
URL="https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-${WASMTIME_ARCH}-linux.tar.xz"
curl --location $URL |
xz --decompress |
tar --strip-components 1 --directory ${WASMTIME_HOME} -x
ln -s ${WASMTIME_HOME}/wasmtime /usr/local/bin