From 799fb365e50bb7c650ffb7ebcd95c89cb2f2c2fc Mon Sep 17 00:00:00 2001 From: Robert Kirkman Date: Fri, 6 Mar 2026 20:32:05 -0600 Subject: [PATCH 1/2] gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM kernel - When Python is running on 32-bit ARM Android on a 64-bit ARM kernel, `os.uname().machine` is `armv8l`. Such devices run the same userspace code as `armv7l` devices, so apply the same `armeabi_v7a` Android ABI to them, which works. - Issue: https://github.com/python/cpython/issues/145616 --- Lib/sysconfig/__init__.py | 4 ++++ Lib/test/test_sysconfig.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py index 8ff9c99435bb1a..de3cea07b4f645 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -696,11 +696,15 @@ def get_platform(): release = get_config_var("ANDROID_API_LEVEL") # Wheel tags use the ABI names from Android's own tools. + # When Python is running on 32-bit ARM Android on a 64-bit ARM kernel, + # 'os.uname().machine' is 'armv8l'. Such devices run the same userspace + # code as 'armv7l' devices. machine = { "x86_64": "x86_64", "i686": "x86", "aarch64": "arm64_v8a", "armv7l": "armeabi_v7a", + "armv8l": "armeabi_v7a", }[machine] elif osname == "linux": # At least on Linux/Intel, 'machine' is the processor -- diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 502103ce629358..ab035215cf8f47 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -378,6 +378,7 @@ def test_get_platform(self): 'i686': 'x86', 'aarch64': 'arm64_v8a', 'armv7l': 'armeabi_v7a', + 'armv8l': 'armeabi_v7a', }.items(): with self.subTest(machine): self._set_uname(('Linux', 'localhost', '3.18.91+', @@ -586,6 +587,7 @@ def test_android_ext_suffix(self): "i686": "i686-linux-android", "aarch64": "aarch64-linux-android", "armv7l": "arm-linux-androideabi", + "armv8l": "arm-linux-androideabi", }[machine] self.assertEndsWith(suffix, f"-{expected_triplet}.so") From b01cf02415f9d9cd9e982a4661fd8a139cf43b4d Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 02:44:53 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst diff --git a/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst b/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst new file mode 100644 index 00000000000000..131570a0e03daa --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-03-07-02-44-52.gh-issue-145616.x8Mf23.rst @@ -0,0 +1 @@ +Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM kernel