[Lldb-commits] [PATCH] D67583: Fix swig python package path

Hal Gentz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 19 00:38:31 PDT 2019


ZeGentzy added a comment.

In D67583#1674912 <https://reviews.llvm.org/D67583#1674912>, @hhb wrote:

> I don't have the right environment to try your command. But I didn't see anything obviously problematic.
>
> Can you try the following:
>
>   cd /src/llvm-project/lldb/scripts/Python
>
>
> Then run the following python program:
>
>   import sys
>   sys.path.append('/src/llvm-project/lldb/scripts/Python')
>   import finishSwigPythonLLDB
>   vDictArgs = {"--srcRoot": "/src/llvm-project/lldb",
>                "--targetDir": "/src/out/./lib32",
>                "--cfgBldDir": "/src/out/tools/lldb/scripts",
>                "--prefix": "/src/out",
>                "--cmakeBuildConfiguration": ".",
>                "--lldbLibDir": "lib32",
>                "-m": None,
>   }
>   finishSwigPythonLLDB.get_framework_python_dir(vDictArgs)
>
>
> For me the output is:
>
>   (True, '/src/out/./lib/python2.7/site-packages/lldb', '')
>
>
> Notice that the lib part don't have 32 suffix, even we specified that in parameters.
>
> I kind of feeling that we should change this script to simply return targetDir. There's no good reason to use get_python_lib() and depend on python's implementation. But I don't know enough to make this decision...


Unfortunately, the script does not seam to be functional:

  $ python a.py         
  Traceback (most recent call last):
    File "a.py", line 3, in <module>
      import finishSwigPythonLLDB
    File "/home/gentz/Documents/aur/gfx/backups/second/llvm-git-gentz/llvm-git-gentz/src/llvm-project32/lldb/scripts/Python/finishSwigPythonLLDB.py", line 47, in <module>
      import utilsOsType      # Determine the OS type this script is running on
  ModuleNotFoundError: No module named 'utilsOsType'
  
  $ python2 a.py                  
  Traceback (most recent call last):
    File "a.py", line 3, in <module>
      import finishSwigPythonLLDB
    File "/home/gentz/Documents/aur/gfx/backups/second/llvm-git-gentz/llvm-git-gentz/src/llvm-project32/lldb/scripts/Python/finishSwigPythonLLDB.py", line 47, in <module>
      import utilsOsType      # Determine the OS type this script is running on
  ImportError: No module named utilsOsType
  
  $ pwd         
  /home/gentz/Documents/aur/gfx/backups/second/llvm-git-gentz/llvm-git-gentz/src/llvm-project32/lldb/scripts/Python


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67583/new/

https://reviews.llvm.org/D67583





More information about the lldb-commits mailing list