ballistica icon indicating copy to clipboard operation
ballistica copied to clipboard

Android python builds from cpython source

Open Loup-Garou911XD opened this issue 4 months ago • 5 comments

Description

Recently cpython upstream added support for building python for android https://github.com/python/cpython/tree/main/Android Bombsquad should switch to this for getting python as this will be better supported and will also help when the java layer is eventually open-sourced

Loup-Garou911XD avatar Aug 31 '25 23:08 Loup-Garou911XD

i havent tried it myself but the instructions seem pretty straight forward

Loup-Garou911XD avatar Aug 31 '25 23:08 Loup-Garou911XD

I think the build scripts I'm using in pybuild.py (which come from https://github.com/GRRedWings/python3-android) are effectively taking advantage of this native support already. It used to be that these builds would consider themselves to be 'linux' (if you poke around in the platform module) but they now show up as 'android'.

There are also a number of external libraries (OpenSSL, zlib, sqlite, etc) which need to be compiled for Python to be happy, and the above repo build scripts also takes care of those.

If there is ever a more 'out of the box' solution that gives us all those libs plus python libs for all Android architectures then I'm open to switching to that (I recently did essentially that for Apple builds) - but I don't think Python itself provides that even though Android is now an officially supported platform (please correct me if I'm wrong).

efroemling avatar Sep 01 '25 00:09 efroemling

There are also a number of external libraries (OpenSSL, zlib, sqlite, etc) which need to be compiled for Python to be happy, and the above repo build scripts also takes care of those.

The readme states that we can pass configuration parameters like --enable-loadable-sqlite-extensions which should add those modules ig

Loup-Garou911XD avatar Sep 01 '25 00:09 Loup-Garou911XD

And they already have a workflow for building it https://github.com/python/cpython/actions/runs/17364133231/job/49288271656 So u could modify it to see if it can fit the needs

Loup-Garou911XD avatar Sep 01 '25 00:09 Loup-Garou911XD

The repository @efroemling mentioned got deprecated a month ago for the same reason So ig you'll have to switch to the cpython upstream for pi-thon3.14

Loup-Garou911XD avatar Dec 04 '25 17:12 Loup-Garou911XD