From 223d6da3b159ef0c497eb0eed4c79c58907755ba Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 14 Aug 2026 10:49:32 +0500 Subject: [PATCH] Reapply "build_pyodide: try more recent `pyodide-build`" This reverts commit 1a931ddfd9b4c71f5efc5e0f1a0674f5ab2a5198. --- pyodide/build_pyodide.sh | 10 +++++----- pyodide/requirements.txt | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 pyodide/requirements.txt diff --git a/pyodide/build_pyodide.sh b/pyodide/build_pyodide.sh index b19f621f50..638c20dac5 100755 --- a/pyodide/build_pyodide.sh +++ b/pyodide/build_pyodide.sh @@ -2,9 +2,7 @@ set -ex PYODIDE_VERSION=0.29.3 -PYODIDE_BUILD_VERSION=0.33.0 -PYODIDE_XBUILDENV_ROOT="${HOME}/.cache/.pyodide-xbuildenv-${PYODIDE_BUILD_VERSION}" -PYODIDE_XBUILDENV="${PYODIDE_XBUILDENV_ROOT}/${PYODIDE_VERSION}" +SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # Script is assuming that it will be possible to execute it multiple times # therefore we're clearing venv each time and ignoring existing 'emsdk' folder. @@ -16,12 +14,14 @@ source .venv/bin/activate # Install pyodide cross build environment. # Instructions: https://pyodide.org/en/stable/development/building-packages.html -uv pip install "pyodide-build==${PYODIDE_BUILD_VERSION}" +uv pip install -r "${SCRIPT_DIR}/requirements.txt" # `uv run` is required, so xbuildenv would skip using `pip`. uv run pyodide xbuildenv install "${PYODIDE_VERSION}" uv run pyodide xbuildenv install-emscripten -EMSDK_ROOT="${PYODIDE_XBUILDENV}/emsdk" +# Cache path includes a hash segment that varies by pyodide-build version, +# so query it instead of constructing it manually. +EMSDK_ROOT=$(uv run pyodide config get emsdk_dir) [ -f "${EMSDK_ROOT}/emsdk_env.sh" ] && source "${EMSDK_ROOT}/emsdk_env.sh" [ -f "${EMSDK_ROOT}/../../emsdk_env.sh" ] && source "${EMSDK_ROOT}/../../emsdk_env.sh" which emcc diff --git a/pyodide/requirements.txt b/pyodide/requirements.txt new file mode 100644 index 0000000000..efa200e7e5 --- /dev/null +++ b/pyodide/requirements.txt @@ -0,0 +1 @@ +pyodide-build==0.39.0