Skip to content

sysconfig.get_path(...) returns wrong paths for Python 3.14 on Android #139758

@XuehaiPan

Description

@XuehaiPan

Bug report

Bug description:

I'm trying to build Python 3.14 wheels for Android with cibuildwheels@3.2, which newly adds cp314-android support.

However, when I add an extra item to the build matrix (without changing anything else), CMake fails to find the Python Development.Module. Note that everything works fine with Python 3.13 on Android.

- CMake Error at /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
    Could NOT find Python (missing: Development.Module) (found suitable version
    "3.14.0", minimum required is "3.8")
  
        Reason given by package: 
            Development: Cannot find the directory "/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/include/python3.14"
  
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.31/Modules/FindPython/Support.cmake:4002 (find_package_handle_standard_args)
    /usr/local/share/cmake-3.31/Modules/FindPython.cmake:631 (include)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11NewTools.cmake:54 (find_package)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11Common.cmake:204 (include)
    /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages/pybind11/share/cmake/pybind11/pybind11Config.cmake:257 (include)
    CMakeLists.txt:261 (find_package)

I found the above directory (i.e., sysconfig.get_path('platinclude')) does not exist in the venv.

The build log diffs between Python 3.13 and Python 3.14 on Android:

Python 3.13: https://github.com/metaopt/optree/actions/runs/18335313182/job/52218210396?pr=242#step:11:577

Python executable: /tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv/bin/python (3.13.7 (main, Sep 18 2025, 19:47:49) [Clang 20.1.4 ])
Python platform: android-24-arm64_v8a (android-24-arm64_v8a)
Python sysconfig: {
    'ABIFLAGS': '',
    'EXT_SUFFIX': '.cpython-313-aarch64-linux-android.so',
    'INCLUDEDIR': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/include',
    'INCLUDEPY': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/include/python3.13',
    'LIBDEST': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/lib/python3.13',
    'LIBDIR': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/lib',
    'LIBPYTHON': '-L. -lpython3.13',
    'LIBRARY_DEPS': 'libpython3.13.so libpython3.so',
    'LIBRARY': 'libpython3.13.a',
    'LIBS': '-ldl  -llog',
    'SOABI': 'cpython-313-aarch64-linux-android',
}
Python paths: {
    'stdlib': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/lib/python3.13',
    'platstdlib': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv/lib/python3.13',
    'purelib': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv/lib/python3.13/site-packages',
    'platlib': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv/lib/python3.13/site-packages',
    'include': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/include/python3.13',
    'platinclude': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/python/prefix/include/python3.13',
    'scripts': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv/bin',
    'data': '/tmp/cibw-run-sntlw_f7/cp313-android_arm64_v8a/venv',
}

Python 3.14: https://github.com/metaopt/optree/actions/runs/18335313182/job/52218210389?pr=242#step:11:577

Python executable: /tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/bin/python (3.14.0rc3 (main, Sep 18 2025, 19:47:22) [Clang 20.1.4 ])
Python platform: android-24-arm64_v8a (android-24-arm64_v8a)
Python sysconfig: {
    'ABIFLAGS': '',
    'EXT_SUFFIX': '.cpython-314-aarch64-linux-android.so',
    'INCLUDEDIR': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/python/prefix/include',
    'INCLUDEPY': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/python/prefix/include/python3.14',
    'LIBDEST': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/python/prefix/lib/python3.14',
    'LIBDIR': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/python/prefix/lib',
    'LIBPYTHON': '-L. -lpython3.14',
    'LIBRARY_DEPS': 'libpython3.14.so libpython3.so',
    'LIBRARY': 'libpython3.14.a',
    'LIBS': '-ldl  -llog',
    'SOABI': 'cpython-314-aarch64-linux-android',
}
Python paths: {
    'stdlib': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14',
    'platstdlib': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14',
    'purelib': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages',
    'platlib': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/lib/python3.14/site-packages',
    'include': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/include/python3.14',
    'platinclude': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/include/python3.14',
    'scripts': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv/bin',
    'data': '/tmp/cibw-run-bewfqrm_/cp314-android_arm64_v8a/venv',
}

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions