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 https://swift.org/download/#releases and https://hub.docker.com/_/swift).

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: https://github.com/google/swift-jupyter#option-1-using-a-swift-for-tensorflow-toolchain-and-virtualenv. However, Swift's LLDB can be compiled with Python support out of box: https://github.com/liuliu/swift-jupyter/#optional-building-lldb-python3-support-without-swift-for-tensorflow. 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.

Terms of Service

Privacy Policy

Cookie Policy