Skip to content

Push down cpython module to the submodule #113066

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lldb/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
# Add a Post-Build Event to copy over Python files and create the symlink to
# liblldb.so for the Python API(hardlink on Windows).
add_custom_target(${swig_target} ALL VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_python_target_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${lldb_python_target_dir}/native/
DEPENDS ${lldb_python_bindings_dir}/lldb.py
COMMENT "Python script sym-linking LLDB Python API")

Expand All @@ -74,6 +74,8 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
"${LLDB_SOURCE_DIR}/source/Interpreter/embedded_interpreter.py"
"${lldb_python_target_dir}")

create_python_package(${swig_target} ${lldb_python_target_dir} "native" FILES)

# Distribute the examples as python packages.
create_python_package(
${swig_target}
Expand Down Expand Up @@ -141,7 +143,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
endif()
set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb${LLDB_PYTHON_EXT_SUFFIX}")
create_relative_symlink(${swig_target} ${LIBLLDB_SYMLINK_DEST}
${lldb_python_target_dir} ${LIBLLDB_SYMLINK_OUTPUT_FILE})
${lldb_python_target_dir}/native/ ${LIBLLDB_SYMLINK_OUTPUT_FILE})


if (NOT WIN32)
Expand Down
2 changes: 1 addition & 1 deletion lldb/bindings/python/python.swig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Older swig versions will simply ignore this setting.
import $module
except ImportError:
# Relative import should work if we are being loaded by Python.
from . import $module"
from .native import $module"
%enddef

// The name of the module to be created.
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ add_lldb_library(liblldb SHARED ${option_framework}
${option_install_prefix}
)

# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
# lib/pythonX.Y/site-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
Copy link
Member

Choose a reason for hiding this comment

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

This isn't related to this change, right? This was already the case previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it is not. I will revert it.

I looked it up and it turns out that the dist- qualification is a Debian rule. I will leave this alone for discussion on another day.

# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
# that _lldb.so can be loaded from Python.
Expand Down
Loading