[clang] [clang][python] Don't add check-clang-python to check-all if cross-compiling (PR #111657)

Alex Bradbury via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 04:00:12 PDT 2024


================
@@ -47,6 +47,14 @@ if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$")
   set(RUN_PYTHON_TESTS FALSE)
 endif()
 
+# Tests will fail if cross-compiling for a different target, as tests will try
+# to use the host Python3_EXECUTABLE and make FFI calls to functions in target
+# libraries.
+if(CMAKE_CROSS_COMPILING)
----------------
asb wrote:

I think fundamentally it can't really work. We could add a search for a python interpreter built for the target in the sysroot, and add logic to use it if we know we can execute it with qemu-user...but I'm not sure it's worth that kind of complexity and I personally prefer to minimise dependency on the sysroot as much as possible other than providing some needed libraries and headers. A FIXME could suggest adding some logic for specifying a guest python3_executable, but I'm not sure that's a path we'd want to commit to. So I'm a bit torn.

https://github.com/llvm/llvm-project/pull/111657


More information about the cfe-commits mailing list