pyodide: RuntimeError: Incorrect Emscripten version 3.1.27. Need Emscripten version 3.1.32

🐛 Bug

I’m building pylibjpeg-openjpeg to allow pydicom (pure Python works in Pyodide already) to read Jpeg2000 encoded DICOM images.

To Reproduce

mkdir pyodide_builds
cd pyodide_builds
pyenv local 3.11.2
python -m venv venv
source venv/bin/activate
python -m pip install pyodide-build
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
./emsdk install ${PYODIDE_EMSCRIPTEN_VERSION}
./emsdk activate ${PYODIDE_EMSCRIPTEN_VERSION}
source emsdk_env.sh
cd ..
git clone --recurse-submodules https://github.com/pydicom/pylibjpeg-openjpeg
cd pylibjpeg-openjpeg
pyodide build

This works perfectly and builds a wheel (pylibjpeg_openjpeg-1.3.2-cp311-cp311-emscripten_3_1_32_wasm32.whl). However it won’t load in JupyterLite or Pyscript because they all use Emscripten 3.2.27. They error with:

ValueError: Wheel was built with Emscripten v3.1.32 but Pyodide was built with Emscripten v3.1.27

So I attempted to change the build instructions to use PYODIDE_EMSCRIPTEN_VERSION=3.1.27 instead of PYODIDE_EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) but I attempt to run pyodide build this fails with:

RuntimeError: Incorrect Emscripten version 3.1.27. Need Emscripten version 3.1.32

So how can I build pyodide packages with older versions of Emscripten?

Thanks

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

too lazy

There’s so many different things to do!

Though I’d like to enable wasm-exceptions in Pyodide 0.24.0 which would be an ABI break anyways…

I think we need to make a Emscripten version compatibility table before releasing the next version. I always had that in my mind but I was too lazy.