[Lldb-commits] [PATCH] D67866: [lldb] Unify python site-packages path

Haibo Huang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 20 14:55:23 PDT 2019


hhb created this revision.
hhb added a reviewer: labath.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.

Before this change, the procedure of installing and loading python
modules are as follow:

1. finishSwigPythonLLDB.py writes necessary files to

${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/distutils.sysconfig.get_python_lib()

2. lldb/scripts/CMakeLists.txt installs them to lib${LLVM_LIBDIR_SUFFIX}

3. ScriptInterpreterPython.cpp adds the right path into PYTHONPATH.

(XCode is using a different path but that's not changed here.)

The issue is that get_python_lib() is platform dependent. It is
difficult to guess the right path in cmake. And it is impossible to be
right when cross compiling.

This change updates finishSwigPythonLLDB.py to output to ${liblldb_build_dir}.
Since cmake will always install them into lib${LLVM_LIBDIR_SUFFIX} , this change
Also updates ScriptInterpreterPython.cpp to load from
${liblldb_path}/../lib${LLVM_LIBDIR_SUFFIX}/site-packages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67866

Files:
  lldb/CMakeLists.txt
  lldb/scripts/CMakeLists.txt
  lldb/scripts/Python/finishSwigPythonLLDB.py
  lldb/scripts/finishSwigWrapperClasses.py
  lldb/scripts/get_relative_lib_dir.py
  lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67866.221121.patch
Type: text/x-patch
Size: 15546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190920/cba993e5/attachment-0001.bin>


More information about the lldb-commits mailing list