HomePhabricator

Build CPython in depends (Linux only)

Description

Build CPython in depends (Linux only)

Summary:
This adds 2 new packages:

  • native_cpython: build cpython for the host. Only the python binary is built, it's required for building the cross cpython
  • cpython: cross build cpython. The (limited) feature set is found in the Setup.local file. Note that it requires sock support from openssl. The hashlib library relies on HACL that we need to copy also so it can later be linked against.

After this diff we end up with 3 different python when cross compiling:

  • The host python, which is the one we rely on to access all the python libraries (including the external ones like lief)
  • The native python, which is only there to boostrap the cross python build
  • The cross python that we want to link against in order to deliver a working binary with chronik plugins support.

The main CMakeLists.txt is updated to reflect this as we should always use the python host interpreter. Because python doesn't support cmake's config mode, we can't use the extended find_package signature to specify which location to search. So we manually disable the cross compilation global variables to work around this limitation.

Note that one can disable openssl in the depends, which will fail the build for cpython. There are other similar issues already (e.g. Qt will fail as well) and this is a very advanced feature, so I think it's fine as-is.

Test Plan:

cd depends
make build-linux64
make build-linux-aarch64

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK, Mengerian

Differential Revision: https://reviews.bitcoinabc.org/D16954

Details

Provenance
FabienAuthored on Oct 21 2024, 16:24
FabienPushed on Oct 23 2024, 09:56
Reviewer
Restricted Project
Differential Revision
D16954: Build CPython in depends (Linux only)
Parents
rABC275733139d7e: [Cashtab] Parse agora ad prep txs in tx history
Branches
Unknown
Tags
Unknown