Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Feb 16, 2024

This PR is the first significant step towards implementing Android support as specified in PEP 738. It includes:

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be more comfortable if we could do the fixes in separate PRs:

  1. fix Cross Compile for Android and issues with PyExc_OSError #111225
  2. then add the adjustments/refactorings (your middle bullet)
  3. add the README and the build script

Comment on lines +100 to +103
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"]:
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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)

@mhsmith
Copy link
Member Author

mhsmith commented Feb 21, 2024

I would be more comfortable if we could do the fixes in separate PRs:

OK, I'll do that. Here is the first one:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cross Compile for Android and issues with PyExc_OSError
3 participants