Skip to content

Commit

Permalink
get emscripten version from pyodide
Browse files Browse the repository at this point in the history
  • Loading branch information
joemarshall committed Jun 27, 2024
1 parent 6d92807 commit f803100
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions ci/docker/conda-python-emscripten.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ FROM ${repo}:${arch}-conda-python-${python}

ARG selenium_version="4.15.2"
ARG pyodide_version="0.26.0"
ARG emscripten_version="3.1.58"
ARG chrome_version="latest"
ARG required_python_min="(3,12)"
# fail if python version < 3.12
Expand All @@ -35,18 +34,20 @@ SHELL ["/bin/bash", "--login", "-c", "-o", "pipefail"]

RUN python -m pip install --no-cache-dir selenium==${selenium_version} &&\
python -m pip install --no-cache-dir --upgrade --pre pyodide-build==${pyodide_version}

COPY ci/scripts/install_emscripten.sh /arrow/ci/scripts/
RUN bash /arrow/ci/scripts/install_emscripten.sh ~ "${emscripten_version}"

# make sure zlib is cached in the EMSDK folder
RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib

# install pyodide dist directory to /pyodide
WORKDIR /
RUN pyodide_dist_url="https://github.com/pyodide/pyodide/releases/download/${pyodide_version}/pyodide-${pyodide_version}.tar.bz2" && \
wget -q "${pyodide_dist_url}" -O- |tar -xj

# install correct version of emscripten for this pyodide
COPY ci/scripts/install_emscripten.sh /arrow/ci/scripts/
RUN bash /arrow/ci/scripts/install_emscripten.sh ~ /pyodide

# make sure zlib is cached in the EMSDK folder
RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib


# install chrome for testing browser based runner
# zip needed for chrome, libpthread stubs installs pthread module to cmake, build-essential makes
# sure that unix make is available in isolated python environments
Expand Down
9 changes: 6 additions & 3 deletions ci/scripts/install_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@
# specific language governing permissions and limitations
# under the License.

# install emscripten sdk version $2 to directory $2/emsdk
# install emscripten sdk version to match pyodide in $2 to directory $1/emsdk

set -e

target_path=$1
emscripten_version=$2
pyodide_path=$2

emscripten_version=$(${pyodide_path}/python -c "import sys;print(*sys._emscripten_info.emscripten_version,sep='.')")

cd ${target_path}
ls emsdk || git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${emscripten_version}
./emsdk activate ${emscripten_version}
echo "Installed emsdk to: $1"
echo "Installed emsdk to: ${target_path}"
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,6 @@ services:
arch: ${ARCH}
clang_tools: ${CLANG_TOOLS}
llvm: ${LLVM}
emscripten_version: "3.1.58" # must use correct emscripten for pyodide version
pyodide_version: "0.26.0"
chrome_version: "122"
selenium_version: "4.15.2"
Expand Down

0 comments on commit f803100

Please sign in to comment.