From 6abafb6e1219464a24868d70c847700a914eb698 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 29 Jun 2026 11:42:47 -0700 Subject: [PATCH] Build armeabi-v7a (32-bit ARM) for Python 3.13/3.14 CPython's official Android/android.py lists arm-linux-androideabi in its supported HOSTS for both 3.13 and 3.14, and beeware's cpython-android-source-deps publishes the matching 32-bit dependency tarballs. PEP 738 makes 64-bit Android the *tested* Tier-3 configuration; it does not prevent building 32-bit ARM. So the only blocker was a self-imposed ABI gate in build.sh. - build.sh: allow armeabi-v7a through the 3.13+ official-build ABI case. - build-all.sh: read android_abis from manifest.json (same source the CI packaging step uses) instead of a separate hardcoded version gate, so the build set and package set stay in lockstep. - manifest.json: add armeabi-v7a to 3.13 and 3.14. - README/android/README: correct the "3.13+ are 64-bit-only" note. Validated locally: 3.14.6 and 3.13.14 both build via android.py and package into Dart tarballs; libpython and extension modules are ELF32/ARM with no import failures. --- README.md | 7 +++++-- android/README.md | 5 ++--- android/build-all.sh | 16 ++++++++++------ android/build.sh | 4 ++-- manifest.json | 4 ++-- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 914eb29..d15bd79 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,11 @@ Schema: ``` `android_abis` lists the ABIs `package-for-dart.sh` builds for this minor — -64-bit first, then `armeabi-v7a` if the minor still supports 32-bit Android. -3.12 carries all three; 3.13+ are 64-bit-only ([PEP 738](https://peps.python.org/pep-0738/)). +64-bit (`arm64-v8a`, `x86_64`) plus 32-bit `armeabi-v7a`. [PEP 738](https://peps.python.org/pep-0738/) +makes 64-bit Android the *tested* Tier-3 configuration, but CPython's official +`Android/android.py` still builds 32-bit ARM (it's in its supported `HOSTS`), so +all three minors carry `armeabi-v7a`. Drop an ABI from a minor's list to stop +building it. The committed file omits `release`; the publish step injects it. diff --git a/android/README.md b/android/README.md index f33053f..6607c32 100644 --- a/android/README.md +++ b/android/README.md @@ -21,9 +21,8 @@ To build all ABIs: ./build-all.sh 3.13.12 ``` -ABI support: -* Python 3.12: `arm64-v8a`, `armeabi-v7a`, `x86_64` -* Python 3.13+: `arm64-v8a`, `x86_64` +ABI support (all minors): `arm64-v8a`, `x86_64`, `armeabi-v7a`. The exact set +built per minor is driven by `android_abis` in the top-level `manifest.json`. ## Credits diff --git a/android/build-all.sh b/android/build-all.sh index 673ff98..c1d5954 100755 --- a/android/build-all.sh +++ b/android/build-all.sh @@ -5,14 +5,18 @@ python_version=${1:?} read version_major version_minor < <( echo "$python_version" | sed -E 's/^([0-9]+)\.([0-9]+).*/\1 \2/' ) -version_int=$((version_major * 100 + version_minor)) +short="$version_major.$version_minor" -if [ $version_int -ge 313 ]; then - abis="arm64-v8a x86_64" -else - abis="arm64-v8a armeabi-v7a x86_64" +# ABIs come from the manifest (`pythons..android_abis`), the same source +# the CI packaging step reads — keep them in lockstep so a minor's ABI set is +# edited in exactly one place. +manifest="$(dirname "$(realpath "$0")")/../manifest.json" +abis=$(jq -r --arg s "$short" '.pythons[$s].android_abis[]' "$manifest") +if [ -z "$abis" ]; then + echo "manifest.json has no .pythons[\"$short\"].android_abis" >&2 + exit 1 fi for abi in $abis; do - bash ./build.sh $python_version $abi + bash ./build.sh "$python_version" "$abi" done diff --git a/android/build.sh b/android/build.sh index ef6d2ff..b1870f7 100755 --- a/android/build.sh +++ b/android/build.sh @@ -148,10 +148,10 @@ if [ $version_int -le 312 ]; then sed -i -e "s/_PYTHON_HOST_PLATFORM=.*/_PYTHON_HOST_PLATFORM=android-$api_level-$abi/" $PREFIX/lib/python$version_short/config-$version_short/Makefile else case "$abi" in - arm64-v8a|x86_64) + arm64-v8a|x86_64|armeabi-v7a) ;; *) - echo "Python $version_short official Android build supports only: arm64-v8a, x86_64" + echo "Python $version_short official Android build supports only: arm64-v8a, x86_64, armeabi-v7a" exit 1 ;; esac diff --git a/manifest.json b/manifest.json index ab1c54c..985b075 100644 --- a/manifest.json +++ b/manifest.json @@ -15,7 +15,7 @@ "standalone_release_date": "20260623", "pyodide_version": "0.29.4", "pyodide_platform_tag": "pyemscripten-2025.0-wasm32", - "android_abis": ["arm64-v8a", "x86_64"], + "android_abis": ["arm64-v8a", "x86_64", "armeabi-v7a"], "prerelease": false }, "3.14": { @@ -23,7 +23,7 @@ "standalone_release_date": "20260623", "pyodide_version": "314.0.1", "pyodide_platform_tag": "pyemscripten-2026.0-wasm32", - "android_abis": ["arm64-v8a", "x86_64"], + "android_abis": ["arm64-v8a", "x86_64", "armeabi-v7a"], "prerelease": false } }