Linux lldb releases with python?

I've noticed that the lldb in the official Ubuntu 16.04 tarballs is missing all the python scripting support.

We've got a couple of formatters, synthetic providers that we really want to use.

Is there a way to cobble together the python support from anywhere? Would rebuilding from source contain the python support or is it just not functional on Linux?

LLDB's python binding 100% works on Linux — see all the bots on https://ci.swift.org that build it and run the tests. Are you referring to the tarballs on swift.org or on the packages in Ubuntu?

I've tried the Docker image and Ubuntu16.04 tarball (from Swift.org - Download Swift and Docker Hub).

Below I've pasted a run from the official docker image for Swift 5.2.3, but the 5.2.4 tarball acts the same.

Take this error 'No module named lldb.embedded_interpreter'. When I compare what's shipped with Xcode that's defined in the 'embedded_intepreter.py' file shipped within the LLDB.framework.

On Linux neither the 'lldb' Python module or any thing that looks like 'liblldbPluginScriptInterpreterPython.dylib/so' is part of the tarball or Docker image.

Perhaps these are getting built on ci.swift.org but not getting packaged up by whatever builds the tarballs/images?

$ docker run -it swift lldb
(lldb) version
lldb version 7.0.0 (git@github.com:apple/llvm-project.git revision c2133f2b08047708b17230b598cb789062143650)
Swift version 5.2.3 (swift-5.2.3-RELEASE)
(lldb) script
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named lldb.embedded_interpreter
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_python_interpreter' is not defined
(lldb)

@JDevlieghere do you happen to know what this indicates?

Just want to revive this thread. Currently, the suggestion is to use Swift for TensorFlow packaged LLDB that has Python support: GitHub - google/swift-jupyter. However, Swift's LLDB can be compiled with Python support out of box: GitHub - liuliu/swift-jupyter: This is a fork of google/swift-jupyter. It is made possible to use Jupyterlab (as well as Jupyter Notebook) with most up-to-date Swift toolchain.. So the question is, what work left for us to simply package LLDB with Python support into swift.org's distribution? If someone would clarify what work involved, we can have some more meaningful discussion what would take to make that hapen. Thanks!

Indeed, this sounds like a packaging issue. It sounds like Python is enabled when we build lldb, otherwise script would return an error saying there's no Python script interpreter.

I looked at the tarball from swift.org and indeed, the Python files are just not there. Looking at the build log I'm sure they're generated, so I'm suspecting the script that packages things up is ignoring them.

1 Like

@JDevlieghere what can we go from here? Do you see any path to help remedy this issue? I am not sure about the Swift contribution process and how can we contribute back changes to the Swift packaging script.

Hi all,

I'm getting similar errors when trying to use CodeLLDB in VSCode under Ubuntu 20. It seems the lldb python package is not found. I'm not entirely sure it's related to the issues described here, but the errors are almost completely identical to the ones @kuwerty describes. Is there any way to fix these errors and get CodeLLDB to work?

kind regards,

Tim

P.s. I followed the instructions by @svanimpe here and pointed vscode to the correct swift lldb lib, but I'm still getting these errors afterwards.