Swiftly also installs lldb on Linux
I was surprised to find that swiftly also installs lldb in the PATH on Linux, when generally speaking you would want to use the lldb version that comes with your distribution. Worse still is that the version of lldb installed is linked to python 3.9 specifically (same issue the REPL has, as mentioned in #78), so if your distribution doesn't provide that specific version (mine doesn't) lldb won't run. Even if you have a fully functioning lldb install from your dist repos.
$ swiftly list
Installed release toolchains
----------------------------
Swift 6.0.3 (in use)
Installed snapshot toolchains
-----------------------------
$ which lldb
/home/johan/.local/bin/lldb
$ lldb
lldb: error while loading shared libraries: libpython3.9.so.1.0: cannot open shared object file: No such file or directory
$ /usr/bin/lldb
(lldb)
This is a tricky situation because the lldb that comes with the toolchain has the necessary extensions to debug swift code, while the system one might not have that. It's a similar problem with other tools that are in the toolchain, such as clang.
It's strange that swiftly didn't install the system dependencies needed to make its lldb work properly. What version of swiftly are you using for this?
$ swiftly --version
0.3.0
For context I am using Endeavour OS (Arch-based distribution), and just installed swift using swiftly install latest.
Is there any way the swift lldb binary could be renamed perhaps, just so it doesn't conflict with the distribution-provided one? lldb-swift? I don't know if anything has a hard-coded name for the binary to use.
The upcoming release of swiftly should be able to install the required system packages on the supported Linux distributions so the lldb should have the required python version installed. In theory it should work as good or better than the system installed lldb.
I'm not sure how best to support swift toolchain in an unsupported Linux distribution, such as Arch/Endeavour. There can be other problem areas.
This is an aspect of the toolchain the name of the lldb binary. EndeavourOS isn't a supported platform for Swift toolchain.