Skip to content

Commit

Permalink
build-wasm32-wasi.sh: fix wapm build
Browse files Browse the repository at this point in the history
for wapm, we still use wasi-sdk-8.0.
  • Loading branch information
yamt committed Jul 26, 2024
1 parent 56773d2 commit 15f7257
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build-wasm32-wasi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ mkdir -p ${DIST_DIR}

fetch_wasi_sdk()
{
MACHINE=$(uname -m)
UNAME=$(uname -s)
case ${UNAME} in
Darwin)
Expand All @@ -34,14 +33,20 @@ fetch_wasi_sdk()
exit 1
;;
esac
TAR=wasi-sdk-${MAJOR}.${MINOR}-${MACHINE}-${PLATFORM}.tar.gz
MACHINE=
DIR_SUFFIX=
if [ ${MAJOR} -ge 23 ]; then
MACHINE=-$(uname -m)
DIR_SUFFIX=${MACHINE}-${PLATFORM}
fi
TAR=wasi-sdk-${MAJOR}.${MINOR}${MACHINE}-${PLATFORM}.tar.gz
if [ ! -f ${DIST_DIR}/${TAR} ]; then
URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${MAJOR}/${TAR}
curl -L -o ${DIST_DIR}/${TAR} ${URL}
fi
pax -rz \
-f ${DIST_DIR}/${TAR} \
-s"!^wasi-sdk-${MAJOR}\.${MINOR}-${MACHINE}-${PLATFORM}!${WASI_SDK_DIR}!"
-s"!^wasi-sdk-${MAJOR}\.${MINOR}${DIR_SUFFIX}!${WASI_SDK_DIR}!"
}

test -d "${WASI_SDK_DIR}" || fetch_wasi_sdk
Expand Down

0 comments on commit 15f7257

Please sign in to comment.