From 526b9537a947cb385f64be70d2d5a731fc3d71fd Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 19 Feb 2026 15:51:01 +0500 Subject: [PATCH] build_pyodide.sh - allow executing multiple times --- pyodide/build_pyodide.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyodide/build_pyodide.sh b/pyodide/build_pyodide.sh index 2994a44ae6..20ad946162 100755 --- a/pyodide/build_pyodide.sh +++ b/pyodide/build_pyodide.sh @@ -1,9 +1,12 @@ #!/usr/bin/bash set -ex +# 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. + # Install uv. curl -LsSf https://astral.sh/uv/install.sh | sh -uv venv --python 3.13 +uv venv --python 3.13 --clear source .venv/bin/activate # Install pyodide cross build environment. @@ -13,7 +16,9 @@ uv pip install pyodide-build uv run pyodide xbuildenv install # Emscripten doesn't come with xbuildenv. -git clone https://github.com/emscripten-core/emsdk +if [ ! -d emsdk ]; then + git clone https://github.com/emscripten-core/emsdk +fi pushd emsdk PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) ./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION}