[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

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!

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Christian Heimes


Christian Heimes  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

There is still a pretty good change I am making some dumb mistake.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

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.

--
Added file: https://bugs.python.org/file50723/Makefile

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Christian Heimes


Christian Heimes  added the comment:

Please attach config.log and Makefile from the builddir.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

I take it back, I am still having this problem.

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


Hood Chatham  added the comment:

Okay I found the problem. Elsewhere in my Makefiles `PYTHON_FOR_BUILD` was 
getting overwritten.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread pmp-p


Change by pmp-p :


--
nosy: +pmpp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47232] Difficulties building tip of tree Python for emscripten

2022-04-05 Thread Hood Chatham


New submission from Hood Chatham :

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:
```
PYTHON_FOR_BUILD=_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f 
pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) 
/src/cpython/build/Python-3.11.0dev0/builddir/build-host/python
```
manually fixing this to:
```
PYTHON_FOR_BUILD=/src/cpython/build/Python-3.11.0dev0/builddir/build-host/python
_PYTHON_PROJECT_BASE=$(abs_builddir) 
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) 
PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat 
pybuilddir.txt`:)$(srcdir)/Lib 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH)
```
fixes the problem.

My configure invocation is as follows:
```
( \
cd $(BUILDDIR); \
CONFIG_SITE=./config.site-wasm32-emscripten emconfigure \
  ../../configure \
  --cache-file=$(ROOT)/python.config.cache \
  CFLAGS="${PYTHON_CFLAGS}" \
  CPPFLAGS="-I$(SQLITEBUILD) -I$(BZIP2BUILD) 
-I$(ZLIBBUILD)" \
  PLATFORM_TRIPLET="$(PLATFORM_TRIPLET)" \
  --with-build-python=$(HOSTBUILDDIR)/python \
  --without-pymalloc \
  --disable-shared \
  --disable-ipv6 \
  --enable-big-digits=30 \
  --enable-optimizations \
  --host=wasm32-unknown-emscripten\
  --build=$(shell $(EXTRACTDIR)/config.guess) \
  --prefix=$(INSTALL)  \
)
```

--
messages: 416807
nosy: christian.heimes, hoodchatham
priority: normal
severity: normal
status: open
title: Difficulties building tip of tree Python for emscripten

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com