Skip to content

Problem building Python 3.12 #1143

Closed

Description

@FeodorFitsner

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!

Activity

  1. mhsmith commented on Apr 22, 2024

    @mhsmith
    Member

    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.

  2. added this to the 15.1 milestone on Apr 22, 2024
  3. changed the title [-]Problem building Python 3.12 in CI job[/-] [+]Problem building Python 3.12[/+] on Apr 22, 2024
  4. FeodorFitsner commented on Apr 22, 2024

    @FeodorFitsner
    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

  5. mhsmith commented on Apr 22, 2024

    @mhsmith
    Member

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

  6. FeodorFitsner commented on Apr 22, 2024

    @FeodorFitsner
    Author

    Thank you!

  7. mhsmith commented on Sep 30, 2024

    @mhsmith
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions