Skip to content

Commit

Permalink
Merge pull request #115 from extism/update-wasi-sdk
Browse files Browse the repository at this point in the history
Bump wasi-sdk to 24
  • Loading branch information
bhelx authored Dec 5, 2024
2 parents 4ce7895 + e8ec1d3 commit 7deee64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions install-wasi-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if ($env:QUICKJS_WASM_SYS_WASI_SDK_PATH) {

$PATH_TO_SDK = "wasi-sdk"
if (-Not (Test-Path -Path $PATH_TO_SDK)) {
$VERSION_MAJOR = "12"
$VERSION_MAJOR = "24"
$VERSION_MINOR = "0"
$url = "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$VERSION_MAJOR/wasi-sdk-$VERSION_MAJOR.$VERSION_MINOR-mingw.tar.gz"
Invoke-WebRequest -Uri $url -OutFile "$tempPath\wasi-sdk-$VERSION_MAJOR.$VERSION_MINOR-mingw.tar.gz"
Expand All @@ -40,4 +40,4 @@ if (-Not (Test-Path -Path $PATH_TO_SDK)) {
Remove-Item -Path "$tempPath\wasi-sdk-$VERSION_MAJOR.$VERSION_MINOR-mingw.tar" -Recurse -Force | Out-Null
Remove-Item -Path "$tempPath\wasi-sdk-$VERSION_MAJOR.$VERSION_MINOR-mingw.tar.gz" -Recurse -Force | Out-Null

}
}
13 changes: 10 additions & 3 deletions install-wasi-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,22 @@ if [[ -n "$QUICKJS_WASM_SYS_WASI_SDK_PATH" ]]; then
fi
set -u

ARCH=`uname -m`
case "$ARCH" in
ix86*|x86_64*) ARCH="x86_64" ;;
arm64*|aarch64*) ARCH="arm64" ;;
*) echo "unknown arch: $ARCH" && exit 1 ;;
esac

PATH_TO_SDK="wasi-sdk"
if [[ ! -d $PATH_TO_SDK ]]; then
TMPGZ=$(mktemp)
VERSION_MAJOR="12"
VERSION_MAJOR="24"
VERSION_MINOR="0"
if [[ "$(uname -s)" == "Darwin" ]]; then
curl --fail --location --silent https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION_MAJOR}/wasi-sdk-${VERSION_MAJOR}.${VERSION_MINOR}-macos.tar.gz --output $TMPGZ
curl --fail --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION_MAJOR}/wasi-sdk-${VERSION_MAJOR}.${VERSION_MINOR}-${ARCH}-macos.tar.gz --output $TMPGZ
else
curl --fail --location --silent https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION_MAJOR}/wasi-sdk-${VERSION_MAJOR}.${VERSION_MINOR}-linux.tar.gz --output $TMPGZ
curl --fail --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION_MAJOR}/wasi-sdk-${VERSION_MAJOR}.${VERSION_MINOR}-${ARCH}-linux.tar.gz --output $TMPGZ
fi
mkdir $PATH_TO_SDK
tar xf $TMPGZ -C $PATH_TO_SDK --strip-components=1
Expand Down

0 comments on commit 7deee64

Please sign in to comment.