From e02f7c0585c74820920d6c6d3986f1e1d8117b18 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 19 Nov 2025 10:14:05 -0800 Subject: [PATCH 1/2] Move wasmtime details entirely into the install script It should help with remembering to bump the wasmtime version when changing the WASI SDK. --- wasicontainer/Dockerfile | 6 ------ wasicontainer/install-wasi.sh | 14 ++++++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wasicontainer/Dockerfile b/wasicontainer/Dockerfile index 2f995e2..3a0cf1b 100644 --- a/wasicontainer/Dockerfile +++ b/wasicontainer/Dockerfile @@ -11,12 +11,6 @@ LABEL org.opencontainers.image.documentation="https://github.com/python/cpython- ARG TARGETARCH -# WASI SDK versions are controlled in install-wasi.sh. -ENV WASI_SDK_ROOT=/opt - -ENV WASMTIME_VERSION=38.0.2 -ENV WASMTIME_HOME=/opt/wasmtime - RUN mkdir -p /opt/cpython-devcontainer/bin COPY --chmod=755 install-wasi.sh /opt/cpython-devcontainer/bin/ diff --git a/wasicontainer/install-wasi.sh b/wasicontainer/install-wasi.sh index 2e6130c..ae053bb 100644 --- a/wasicontainer/install-wasi.sh +++ b/wasicontainer/install-wasi.sh @@ -1,5 +1,14 @@ #! /bin/bash -ex +WASI_SDK_VERSIONS=( + # 16 for 3.11 & 3.12 is special-cased below. + 24 # 3.13 (w/ special symlinking below), 3.14 + 29 # 3.15 +) +WASMTIME_VERSION="38.0.4" + +ENV WASI_SDK_ROOT=/opt + mkdir --parents ${WASI_SDK_ROOT} # For 3.11, 3.12. @@ -15,10 +24,6 @@ case "${TARGETARCH}" in *) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; esac && \ -WASI_SDK_VERSIONS=( - 24 # 3.13, 3.14 - 29 # 3.15 -) for VERSION in "${WASI_SDK_VERSIONS[@]}"; do # The URL format only works for WASI SDK >= 23. URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION}/wasi-sdk-${VERSION}.0-${WASI_ARCH}-linux.tar.gz @@ -28,6 +33,7 @@ done # For Python 3.13 as Tools/wasm/wasi.py expects /opt/wasi-sdk by default. ln -s ${WASI_SDK_ROOT}/wasi-sdk-24.0*/ /opt/wasi-sdk +WASMTIME_HOME="/opt/wasmtime" mkdir --parents ${WASMTIME_HOME} From d78bb13a5a1593012282f04fcc55d695063701ba Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 19 Nov 2025 10:23:24 -0800 Subject: [PATCH 2/2] Fix error from copy-and-paste from Dockerfile --- wasicontainer/install-wasi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wasicontainer/install-wasi.sh b/wasicontainer/install-wasi.sh index ae053bb..469409b 100644 --- a/wasicontainer/install-wasi.sh +++ b/wasicontainer/install-wasi.sh @@ -7,7 +7,7 @@ WASI_SDK_VERSIONS=( ) WASMTIME_VERSION="38.0.4" -ENV WASI_SDK_ROOT=/opt +WASI_SDK_ROOT=/opt mkdir --parents ${WASI_SDK_ROOT}