python-build-standalone icon indicating copy to clipboard operation
python-build-standalone copied to clipboard

Android distribution

Open theCapypara opened this issue 2 years ago • 6 comments

As mentioned in the PyOxidizer issue (https://github.com/indygreg/PyOxidizer/issues/705) a distribution for Android would be great and I'll try and see if I can get something basic to work.

theCapypara avatar Jun 20 '23 17:06 theCapypara

How about trying termux?

worldxc avatar Jul 21 '23 05:07 worldxc

I would like to use pantsbuild/pants in termux, but pants uses PBS, so I need a PBS build for termux.

What would that take?

cognifloyd avatar Jun 24 '24 03:06 cognifloyd

For pants, I need python 3.9. eventually that will get bumped to 3.11.

Here are the patches termux applies to python when building it: https://github.com/termux/termux-packages/tree/master/packages/python

Several of the patches seem to deal with musl. edit: the patches copy some functions from musl where bionic, the android libc, doesn't support what's needed. So, musl is a red Herring here.

Here is my uname -a:

Linux localhost 4.19.278-g7b0944645172-ab10812814 #1 SMP PREEMPT Thu Sep 7 05:43:03 UTC 2023 aarch64 Android

So, I guess i would need this triple: ~aarch64-unknown-linux-musl~

~Or maybe~ aarch64-unknown-linux-android28

Possibly with some other patches to use the TERMUX_PREFIX which on my device is: /data/data/com.termux/files/usr

more details:

~ $ echo $HOME
/data/data/com.termux/files/home
~ $ echo $PREFIX
/data/data/com.termux/files/usr
~ $ ls /data/data/com.termux/files
home  usr
~ $ ls /data/data/com.termux/files/usr
bin  etc  include  lib  libexec  share  tmp  var

cognifloyd avatar Jun 24 '24 04:06 cognifloyd

Related:

  • ~#87~ edit: Android uses the bionic libc, not musl

cognifloyd avatar Jun 24 '24 05:06 cognifloyd

The link I posted before was to the primary termux build of python, which right now is 3.11. There are community builds of Python 3.7-3.10, I've included links to the built termux deb files for 3.9 for comparison.

cognifloyd avatar Aug 23 '24 03:08 cognifloyd

It would be very meaningful to provide android support.

  • Krita support android app but currently lack of plugin support due to difficulty in packaging python as they mentioned in their forum. Having python on android could potentially make krita-ai-diffusion plugin available.
  • I am also personally trying to build tensorflow on Termux which bazel rules_python will download a glibc python and hinder the build process. Having Android support would be very meaningful.

knyipab avatar Sep 18 '24 10:09 knyipab