Skip to content

Revert "[lldb] Use the Python limited API with SWIG 4.2 or later" #153327

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 1 commit into from
Aug 13, 2025

Conversation

JDevlieghere
Copy link
Member

Reverts #153119 because with LLDB_USE_LIBEDIT_READLINE_COMPAT_MODULE, we're using PyImport_Inittab which isn't part of the stable API.

@JDevlieghere JDevlieghere enabled auto-merge (squash) August 13, 2025 01:09
@llvmbot llvmbot added the lldb label Aug 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 13, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Reverts llvm/llvm-project#153119 because with LLDB_USE_LIBEDIT_READLINE_COMPAT_MODULE, we're using PyImport_Inittab which isn't part of the stable API.


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

1 Files Affected:

  • (modified) lldb/cmake/modules/LLDBConfig.cmake (+1-8)
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index ca574a142b9dd..a9679d63e010d 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -68,6 +68,7 @@ add_optional_dependency(LLDB_ENABLE_FBSDVMCORE "Enable libfbsdvmcore support in
 option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" ON)
 option(LLDB_BUILD_FRAMEWORK "Build LLDB.framework (Darwin only)" OFF)
 option(LLDB_ENABLE_PROTOCOL_SERVERS "Enable protocol servers (e.g. MCP) in LLDB" ON)
+option(LLDB_ENABLE_PYTHON_LIMITED_API "Force LLDB to only use the Python Limited API (requires SWIG 4.2 or later)" OFF)
 option(LLDB_NO_INSTALL_DEFAULT_RPATH "Disable default RPATH settings in binaries" OFF)
 option(LLDB_USE_SYSTEM_DEBUGSERVER "Use the system's debugserver for testing (Darwin only)." OFF)
 option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing lldb." OFF)
@@ -172,14 +173,6 @@ if (LLDB_ENABLE_PYTHON)
     "Embed PYTHONHOME in the binary. If set to OFF, PYTHONHOME environment variable will be used to to locate Python."
     ${default_embed_python_home})
 
-  if (SWIG_VERSION VERSION_GREATER_EQUAL "4.2")
-    set(default_enable_python_limited_api ON)
-  else()
-    set(default_enable_python_limited_api OFF)
-  endif()
-  option(LLDB_ENABLE_PYTHON_LIMITED_API "Force LLDB to only use the Python Limited API (requires SWIG 4.2 or later)"
-    ${default_enable_python_limited_api})
-
   include_directories(${Python3_INCLUDE_DIRS})
   if (LLDB_EMBED_PYTHON_HOME)
     get_filename_component(PYTHON_HOME "${Python3_EXECUTABLE}" DIRECTORY)

@JDevlieghere JDevlieghere merged commit c681149 into main Aug 13, 2025
11 checks passed
@JDevlieghere JDevlieghere deleted the revert-153119-use-limited-api branch August 13, 2025 01:13
@JDevlieghere
Copy link
Member Author

Remove PyImport_Inittab usage: #153329

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.

2 participants