Skip to content

Conversation

@charles-zablit
Copy link
Contributor

#140443 makes use of the CMake variable Python3_EXECUTABLE_DEBUG, which was introduced in CMake version 3.30. On systems with an inferior version of cmake, the lit tests will try to run with an empty config.python_executable.

This PR adds a warning and falls back to using Python3_EXECUTABLE if the CMake version is less than 3.30.

@charles-zablit charles-zablit requested review from Nerixyz and removed request for JDevlieghere October 21, 2025 00:23
@charles-zablit charles-zablit self-assigned this Oct 21, 2025
@llvmbot llvmbot added the lldb label Oct 21, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 21, 2025

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

Changes

#140443 makes use of the CMake variable Python3_EXECUTABLE_DEBUG, which was introduced in CMake version 3.30. On systems with an inferior version of cmake, the lit tests will try to run with an empty config.python_executable.

This PR adds a warning and falls back to using Python3_EXECUTABLE if the CMake version is less than 3.30.


Full diff: https://github.com/llvm/llvm-project/pull/164346.diff

1 Files Affected:

  • (modified) lldb/test/API/CMakeLists.txt (+6-1)
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index b1ace6296f46a..e3bffbc73c394 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -140,7 +140,12 @@ if(CMAKE_HOST_APPLE)
 endif()
 
 if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL Debug)
-  set(LLDB_PYTHON_API_TEST_EXECUTABLE "${Python3_EXECUTABLE_DEBUG}")
+  if(${CMAKE_VERSION} VERSION_LESS "3.30")
+    message(WARNING "CMake version is inferior to 3.30. Some lldb tests will fail.")
+    set(LLDB_PYTHON_API_TEST_EXECUTABLE "${Python3_EXECUTABLE}")
+  else()
+    set(LLDB_PYTHON_API_TEST_EXECUTABLE "${Python3_EXECUTABLE_DEBUG}")
+  endif()
 else()
   set(LLDB_PYTHON_API_TEST_EXECUTABLE "${Python3_EXECUTABLE}")
 endif()

Copy link
Contributor

@Nerixyz Nerixyz left a comment

Choose a reason for hiding this comment

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

Change LGTM.

I just noticed that my change from #140443 is incompatible with multi-config generators, but I don't know CMake that well to fix this (nor did I ever use a multi-config generator intentionally). There seems to be the Python3::InterpreterMultiConfig target in 3.30.

@charles-zablit charles-zablit merged commit d4713ec into llvm:main Oct 21, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants