Skip to content

Fix Android tests #23

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

Merged
merged 2 commits into from
Jun 12, 2025

Conversation

mhsmith
Copy link

@mhsmith mhsmith commented Jun 11, 2025

For context, see:

I'll add some inline notes below.

@mhsmith mhsmith requested a review from henryiii as a code owner June 11, 2025 22:21
Comment on lines 246 to 247
# Older versions of CMake don't know that Android requires modules to link to
# libpython, so they generate Python::Module as an INTERFACE library.
Copy link
Author

Choose a reason for hiding this comment

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

I'll submit a PR in the next couple of days to fix this upstream in CMake. The necessary change in FindPython/Support.cmake is quite simple:

@@ -1515,13 +1515,13 @@ unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS)
 unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_SABIMODULE_ARTIFACTS)
 unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_EMBED_ARTIFACTS)
 if ("Development.Module" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS)
-  if (CMAKE_SYSTEM_NAME MATCHES "^(Windows.*|CYGWIN|MSYS)$")
+  if (CMAKE_SYSTEM_NAME MATCHES "^(Windows.*|CYGWIN|MSYS|Android)$")
     list (APPEND _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS "LIBRARY")
   endif()
   list (APPEND _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS "INCLUDE_DIR")
 endif()
 if ("Development.SABIModule" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS)
-  if (CMAKE_SYSTEM_NAME MATCHES "^(Windows.*|CYGWIN|MSYS)$")
+  if (CMAKE_SYSTEM_NAME MATCHES "^(Windows.*|CYGWIN|MSYS|Android)$")
     list (APPEND _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_SABIMODULE_ARTIFACTS "SABI_LIBRARY")
   endif()
   list (APPEND _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_SABIMODULE_ARTIFACTS "INCLUDE_DIR")

Comment on lines -36 to -37
android.test-groups = ["numpy"]
android.xbuild-tools = ["cmake", "ninja"]
Copy link
Author

Choose a reason for hiding this comment

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

android.test-groups = ["numpy"]

Unfortunately the Chaquopy NumPy wheel won't work with the CPython testbed, as it packages OpenBLAS in a Chaquopy-specific location.

android.xbuild-tools = ["cmake", "ninja"]

xbuild-tools is not implemented on Android: pypa/cibuildwheel#2349 (comment)

@@ -76,7 +76,7 @@ def test_cross_module_exceptions(msg):

# TODO: FIXME
@pytest.mark.xfail(
"env.MACOS and env.PYPY",
"(env.MACOS and env.PYPY) or env.ANDROID",
Copy link
Author

Choose a reason for hiding this comment

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

I don't understand what's going on here, but going by the linked issues and PRs, neither do the pybind11 maintainers, so I don't feel too bad.

@henryiii henryiii merged commit 75a86b8 into henryiii:henryiii/ci/android Jun 12, 2025
75 of 77 checks passed
henryiii pushed a commit that referenced this pull request Jun 12, 2025
* Android tests working

* Clarifications
@henryiii
Copy link
Owner

I get "wheel" missing. Going to see if I can inject it.

henryiii pushed a commit that referenced this pull request Jun 18, 2025
* Android tests working

* Clarifications
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.

2 participants