From be953b78ef4049b6e52960663028f97f5cc47846 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Mar 2024 14:05:29 -0500 Subject: [PATCH] Add script for setting up WASI dependencies (#9078) This PR adds a script for setting up the WASI dependencies needed for extensions. These already get downloaded when needed when using Zed, but in the tests the HTTP client is faked out, so if you don't already have them installed the `test_extension_store_with_gleam_extension` test will fail. Release Notes: - N/A --- .github/workflows/ci.yml | 3 +++ script/setup-wasm | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 script/setup-wasm diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0691cba81d..c053610801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,6 +89,9 @@ jobs: - name: cargo clippy run: cargo xtask clippy + - name: Install WASI dependencies + run: script/setup-wasm + - name: Run tests uses: ./.github/actions/run_tests diff --git a/script/setup-wasm b/script/setup-wasm new file mode 100755 index 0000000000..a3674ba833 --- /dev/null +++ b/script/setup-wasm @@ -0,0 +1,15 @@ +#!/bin/bash + +set -eu + +WASI_ADAPTER_URL="https://github.com/bytecodealliance/wasmtime/releases/download/v18.0.2/wasi_snapshot_preview1.reactor.wasm" +WASI_SDK_URL="https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0-macos.tar.gz" + +echo "Downloading WASI adapter: $WASI_ADAPTER_URL" +curl -L $WASI_ADAPTER_URL -o target/wasi_snapshot_preview1.reactor.wasm + +echo "Downloading WASI SDK: $WASI_SDK_URL" +mkdir -p target/wasi-sdk.archive +curl -L $WASI_SDK_URL | tar -xz - -C target/wasi-sdk.archive +rm -rf target/wasi-sdk/ +mv -f target/wasi-sdk.archive/wasi-sdk-21.0/ target/wasi-sdk