-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
gh-71052: Add Android build script #115576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A README and build script, both based on the existing WASI build process from Tools/wasm/wasi.py.
- A number of fixes to the configure script and Makefile, which I'll explain in more detail below.
- Fixes Cross Compile for Android and issues with PyExc_OSError #111225
I would be more comfortable if we could do the fixes in separate PRs:
- fix Cross Compile for Android and issues with PyExc_OSError #111225
- then add the adjustments/refactorings (your middle bullet)
- add the README and the build script
def unpack_deps(host): | ||
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download" | ||
for name_ver in ["bzip2-1.0.8-1", "libffi-3.4.4-1", "openssl-3.0.13-0", | ||
"sqlite-3.45.1-0", "xz-5.4.6-0"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these dependencies patched? Could you use https://github.com/python/cpython-source-deps/ instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have a couple of small patches, which are in the cpython-android-source-deps repository along with build scripts for each library.
cpython-source-deps and cpython-bin-deps are currently focused only on the Windows releases for python.org. But we're not planning to make such a release for Android, at least not in the Python 3.13 cycle. The main purposes of the android.py script are:
- to be used by the Android buildbot, and
- to provide a guide for anyone who wants to do the build themselves.
So I don't think we need to follow the same level of rigor around the dependencies as we do for Windows. Anyone who doesn't want to use the BeeWare binary releases is free to examine the scripts and build the libraries from source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right that cpython-source-deps
is currently being used by the Windows installer only, but there's been talk about using it for WASM and/or macOS as well.
Anyone who doesn't want to use the BeeWare binary releases is free to examine the scripts and build the libraries from source.
That also true for both macOS and Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: I've got an analogous project for iOS binary dependencies. There are some small patches for libFFI (which may not be required any more with the release of 3.4.5), XZ, and OpenSSL; the real complication is the build process itself, because of the need to produce fat binaries. libFFI is the only dependency that ships with explicit iOS build tooling, and even then, it requires a lot more work than ./configure && make
It hasn't come up in the iOS patch process yet; but for the PEP 730 work, these dependencies are only required as part of the buildbot, so my intention was to avoid the issue with a Jedi-mind-trick-esque "you'll need a build of libFFI etc" in the docs - essentially treating these artefacts are part of the tooling producing BeeWare artefacts, which is used for builedbot validation process. My thinking was if/when we get to the point where CPython is producing official iOS binaries the BeeWare repo would be donated upstream (or retooled to fit into the existing cpython-source-deps/cpython-bin-deps repos)
OK, I'll do that. Here is the first one: |
This PR is the first significant step towards implementing Android support as specified in PEP 738. It includes: