From 937149a7249693e483a989a21dd0e788f9b8ac33 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 4 Feb 2026 15:08:14 -0800 Subject: [PATCH 1/3] Get the WASI SDK version to install in CI via the official action and `Platforms/WASI/config.toml` --- .github/workflows/reusable-wasi.yml | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/reusable-wasi.yml b/.github/workflows/reusable-wasi.yml index 3c81f6ef82dc8c..00fa3a9cf49cc4 100644 --- a/.github/workflows/reusable-wasi.yml +++ b/.github/workflows/reusable-wasi.yml @@ -13,8 +13,6 @@ jobs: timeout-minutes: 60 env: WASMTIME_VERSION: 38.0.3 - WASI_SDK_VERSION: 29 - WASI_SDK_PATH: /opt/wasi-sdk CROSS_BUILD_PYTHON: cross-build/build CROSS_BUILD_WASI: cross-build/wasm32-wasip1 steps: @@ -26,18 +24,22 @@ jobs: uses: bytecodealliance/actions/wasmtime/setup@v1 with: version: ${{ env.WASMTIME_VERSION }} - - name: "Restore WASI SDK" - id: cache-wasi-sdk - uses: actions/cache@v5 - with: - path: ${{ env.WASI_SDK_PATH }} - key: ${{ runner.os }}-wasi-sdk-${{ env.WASI_SDK_VERSION }} - - name: "Install WASI SDK" # Hard-coded to x64. - if: steps.cache-wasi-sdk.outputs.cache-hit != 'true' + - name: "Read WASI SDK version" + id: wasi-sdk-version run: | - mkdir "${WASI_SDK_PATH}" && \ - curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-arm64-linux.tar.gz" | \ - tar --strip-components 1 --directory "${WASI_SDK_PATH}" --extract --gunzip + import tomllib + from pathlib import Path + import os + config = tomllib.loads(Path("Platforms/WASI/config.toml").read_text()) + version = config["targets"]["wasi-sdk"] + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"version={version}\n") + shell: python + - name: "Install WASI SDK" + id: install-wasi-sdk + uses: bytecodealliance/setup-wasi-sdk-action@v3 + with: + version: ${{ steps.wasi-sdk-version.outputs.version }} - name: "Add ccache to PATH" run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV" - name: "Install Python" @@ -53,6 +55,8 @@ jobs: - name: "Configure host" # `--with-pydebug` inferred from configure-build-python run: python3 Platforms/WASI configure-host -- --config-cache + env: + WASI_SDK_PATH: ${{ steps.install-wasi-sdk.outputs.wasi-sdk-path }} - name: "Make host" run: python3 Platforms/WASI make-host - name: "Display build info" From 277cf9d537020deaf726791fae6cfe17f9bbd5d0 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 4 Feb 2026 15:11:01 -0800 Subject: [PATCH 2/3] Fix the action version --- .github/workflows/reusable-wasi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-wasi.yml b/.github/workflows/reusable-wasi.yml index 00fa3a9cf49cc4..115b714cbc11bf 100644 --- a/.github/workflows/reusable-wasi.yml +++ b/.github/workflows/reusable-wasi.yml @@ -37,7 +37,7 @@ jobs: shell: python - name: "Install WASI SDK" id: install-wasi-sdk - uses: bytecodealliance/setup-wasi-sdk-action@v3 + uses: bytecodealliance/setup-wasi-sdk-action@v1 with: version: ${{ steps.wasi-sdk-version.outputs.version }} - name: "Add ccache to PATH" From 01571086a92992aaa9cbb207f48f4041d4f0b892 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 4 Feb 2026 15:19:17 -0800 Subject: [PATCH 3/3] Use a commit hash for the action version --- .github/workflows/reusable-wasi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-wasi.yml b/.github/workflows/reusable-wasi.yml index 115b714cbc11bf..e9565e41b98afa 100644 --- a/.github/workflows/reusable-wasi.yml +++ b/.github/workflows/reusable-wasi.yml @@ -37,7 +37,7 @@ jobs: shell: python - name: "Install WASI SDK" id: install-wasi-sdk - uses: bytecodealliance/setup-wasi-sdk-action@v1 + uses: bytecodealliance/setup-wasi-sdk-action@dcd040abc428fe35253676ef0e6379fba9bf8f9f with: version: ${{ steps.wasi-sdk-version.outputs.version }} - name: "Add ccache to PATH"