[issue47232] Difficulties building tip of tree Python for emscripten

Christian Heimes report at bugs.python.org
Tue Apr 5 17:57:31 EDT 2022


Christian Heimes <lists at cheimes.de> added the comment:

You are building a cross-build with "--with-build-python=/usr/local/bin/python3.11". Is the interpreter up to date?

During alpha and beta phase, the build Python interpreter should be built from the exact same git commit as the sources in "../..". If the interpreter deviates from the sources in your srcdir, then Python byte code (.pyc), frozen byte code, and re engine can have mismatching magic.

I recommend that you build inside an environment that does not have Python 3.11 installed. Instead build a build Python interpreter from the same checkout that you later use for cross-compilation. "./configure && make" is sufficient. You don't have to install the build interpreter. "--with-build-python=$(pwd)/../build/python" works fine.

We use this approach in python-wasm:

mkdir -p cpython/builddir/build
pushd cpython/builddir/build
../../configure -C
make -j$(nproc)
popd

mkdir -p cpython/builddir/emscripten-browser
pushd cpython/builddir/emscripten-browser
CONFIG_SITE=../../Tools/wasm/config.site-wasm32-emscripten \
  emconfigure ../../configure -C \
    --host=wasm32-unknown-emscripten \
    --build=$(../../config.guess) \
    --with-build-python=$(pwd)/../build/python
emmake make -j$(nproc)


It's going to get easier and less painful as soon as we reach beta phase. During beta the byte code will only change when it is required for a bug fix.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47232>
_______________________________________


More information about the Python-bugs-list mailing list