Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem building Python 3.12 #1143

Closed
FeodorFitsner opened this issue Apr 22, 2024 · 5 comments · Fixed by #1257
Closed

Problem building Python 3.12 #1143

FeodorFitsner opened this issue Apr 22, 2024 · 5 comments · Fixed by #1257
Labels
Milestone

Comments

@FeodorFitsner
Copy link

I'm trying to create a CI job to build Pythons using the scripts in target directory.

The build is running on Ubuntu 20.04 with pre-installed Python 3.12.2 as a "build" Python.

Build branch is based on 15.0.1 tag.

For the start I'm trying to build and package Python 3.12.0 just for arm64-v8a: https://github.com/chaquo/chaquopy/compare/master...flet-dev:chaquopy:build-python?expand=1#diff-570ac28988193a9cde9b77463ab795712f39c5ee1a90076eaffae6a04c98bd96

Here's CI build results: https://ci.appveyor.com/project/flet-dev/chaquopy/builds/49666447#L7491

It yields the following error while building Python:

ld: error: unable to find library -lpython3.12
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:2960: Modules/array.cpython-312.so] Error 1

Could you please advice what I'm doing wrong? Thank you!

@mhsmith
Copy link
Member

mhsmith commented Apr 22, 2024

Thanks; I can reproduce this too, with a parallel build on a 2-core Linux machine.

This is caused by a missing Makefile dependency: it's trying to build the array module before building libpython. This should have been fixed by python_for_build_deps.patch, which I see is being applied in the log (search for "Makefile.pre.in"). But that patch doesn't have the intended effect on Python 3.12.

As noted in 4fd0ae2, this should be fixed by backporting the build system improvements I made to Python 3.13 in the upstream CPython repository. Meanwhile, you can work around it by doing a non-parallel build – remove -j $CPU_COUNT from the bottom of python/build.sh.

And by the way, since the Python build doesn't use for-each-abi.sh, if you want to build it for just one ABI then you'll have to edit build-and-package.sh.

@mhsmith mhsmith added the bug label Apr 22, 2024
@mhsmith mhsmith added this to the 15.1 milestone Apr 22, 2024
@mhsmith mhsmith changed the title Problem building Python 3.12 in CI job Problem building Python 3.12 Apr 22, 2024
@FeodorFitsner
Copy link
Author

Thank you for the fast reply!

Indeed, it could be successfully built now without -j option: https://ci.appveyor.com/project/flet-dev/chaquopy/builds/49667256

@mhsmith
Copy link
Member

mhsmith commented Apr 22, 2024

By the way, you can get Chaquopy's pre-built Python packages from Maven Central.

@FeodorFitsner
Copy link
Author

Thank you!

@mhsmith
Copy link
Member

mhsmith commented Sep 30, 2024

As noted in 4fd0ae2, this should be fixed by backporting the build system improvements I made to Python 3.13 in the upstream CPython repository.

Try cherry-picking the following sequence of PRs onto the 3.12 branch, and using the result to replace bldlibrary.patch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants