You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Difficulties building tip of tree Python for emscripten #91388
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2022-04-05.22:33:35.926>created_at=<Date2022-04-05.19:27:14.891>labels= []
title='Difficulties building tip of tree Python for emscripten'updated_at=<Date2022-04-05.22:33:35.925>user='https://github.com/hoodmane'
I am trying to build tot Python for Emscripten to test recent changes and having trouble. The problem is caused by recent changes since 3.11.0a6 to sre. I build a build Python 3.11 from tot, and provided it to ./configure --with-build-python=$(HOSTBUILDDIR)/python. However, I still see invocations to the system Python 3.11 at /usr/local/bin/python3.11.
The problem seems to be that the generated Makefile has a bunch of stuff collapsed into one line:
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
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.
hoodmane commented on Apr 5, 2022
hoodmanemannequin
MannequinAuthor
More actions
Okay I got it working. I was making several mistakes that each caused the same symptoms so it was hard to track them all down.
Activity
hoodmane commentedon Apr 5, 2022
I am trying to build tot Python for Emscripten to test recent changes and having trouble. The problem is caused by recent changes since 3.11.0a6 to
sre. I build a build Python 3.11 from tot, and provided it to./configure --with-build-python=$(HOSTBUILDDIR)/python. However, I still see invocations to the system Python 3.11 at/usr/local/bin/python3.11.The problem seems to be that the generated
Makefilehas a bunch of stuff collapsed into one line:manually fixing this to:
fixes the problem.
My configure invocation is as follows:
hoodmane commentedon Apr 5, 2022
Okay I found the problem. Elsewhere in my Makefiles
PYTHON_FOR_BUILDwas getting overwritten.hoodmane commentedon Apr 5, 2022
I take it back, I am still having this problem.
tiran commentedon Apr 5, 2022
Please attach config.log and Makefile from the builddir.
hoodmane commentedon Apr 5, 2022
config.log is apparently 1.7 MB and when I try to upload I get "Error 413: Entity Too Large". I've attached the Makefile.
hoodmane commentedon Apr 5, 2022
There is still a pretty good change I am making some dumb mistake.
tiran commentedon Apr 5, 2022
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.
hoodmane commentedon Apr 5, 2022
Okay I got it working. I was making several mistakes that each caused the same symptoms so it was hard to track them all down.
Thanks again for your help!