Skip to content

Commit afd9488

Browse files
committed
[clang][python] Don't add check-clang-python to check-all if cross-compiling
Consistent with other cases for these tests, we opt not to add the target to check-all if they're known to fail. The tests fail when cross compiling for a different architecture because the host Python3_EXECUTABLE is used to run them, and FFI calls will of course fail against the libraries compiled for the target. This is an alternate take on <llvm#111367>.
1 parent ced15cd commit afd9488

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clang/bindings/python/tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|Sparc|SystemZ)$")
4747
set(RUN_PYTHON_TESTS FALSE)
4848
endif()
4949

50+
# Tests will fail if cross-compiling for a different target, as tests will try
51+
# to use the host Python3_EXECUTABLE and make FFI calls to functions in target
52+
# libraries.
53+
if(CMAKE_CROSS_COMPILING)
54+
message(WARNING "check-clang-python-tests not added to check-all as they fail in a cross-build setup")
55+
set(RUN_PYTHON_TESTS FALSE)
56+
endif()
57+
5058
if(RUN_PYTHON_TESTS)
5159
set_property(GLOBAL APPEND PROPERTY
5260
LLVM_ALL_ADDITIONAL_TEST_TARGETS check-clang-python)

0 commit comments

Comments
 (0)