-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[lldb] fix python extension debug suffix on Win #89037
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
Conversation
@llvm/pr-subscribers-lldb Author: Alexander M. (amordo) Changesae389b2 change doesn't cover "_d" suffix for Debug build on Windows. Fixed #87381. Full diff: https://github.com/llvm/llvm-project/pull/89037.diff 1 Files Affected:
diff --git a/lldb/bindings/python/CMakeLists.txt b/lldb/bindings/python/CMakeLists.txt
index 73b1239495e22e..183cee9ea64a06 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/lldb/bindings/python/CMakeLists.txt
@@ -136,7 +136,11 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
else()
set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
- set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb${LLDB_PYTHON_EXT_SUFFIX}")
+ if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL Debug)
+ set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb_d${LLDB_PYTHON_EXT_SUFFIX}")
+ else()
+ set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb${LLDB_PYTHON_EXT_SUFFIX}")
+ endif()
create_relative_symlink(${swig_target} ${LIBLLDB_SYMLINK_DEST}
${lldb_python_target_dir} ${LIBLLDB_SYMLINK_OUTPUT_FILE})
|
Looks fine but can you just confirm what
I assume this does not include |
The best docs I can find are https://peps.python.org/pep-0720/: Which is less than helpful. https://peps.python.org/pep-3149/ mentions Windows uses a different format. But anyway, just curious exactly what your interpreter returns. |
Now I suppose the problem comes from
where |
This PR fixes debug lldb -> release Python, but if I configured against a debug Python then the suffix would be Debug lldb/release Python is a valid config I think, and likely what 99% of people want anyway. So can we add a check whether the suffix already has |
f9aa019
to
1a2ae41
Compare
Applied @DavidSpickett's remark |
1a2ae41
to
afb03ec
Compare
ae389b2 relies on LLDB_PYTHON_EXT_SUFFIX of Python3_EXECUTABLE for naming the result lldb python lib. Debug python is used in Debug LLDB on Windows, so the result lib name requires "_d". LLDB_PYTHON_EXT_SUFFIX doesn't start with "_d" if Python3_EXECUTABLE wasn't set to Debug executable explicitly. Perhaps a better solution can be found after solving "debug python executable is not currently handled" issue (https://gitlab.kitware.com/cmake/cmake/-/issues/25874#note_1506658).
afb03ec
to
3711ce6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I can merge this for you if you don't have commit access, otherwise go ahead and merge it yourself.
@DavidSpickett I have no write privilege, so, please, merge it:) |
ae389b2 change doesn't cover "_d" suffix for Debug build on Windows.
Fixed #87381.