lldb --python-path prints the worng path

Bug #1951477 reported by Lawrence D'Anna
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
llvm-toolchain-13 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

lldb --python-path prints the wrong path.

It prints /usr/lib/lib/python3/dist-packages, but it should be

/usr/lib/python3/dist-package
or perhaps
/usr/lib/llvm-13/lib/python3/dist-packages/

This is because debian packaging scripts built it with

-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-13

So lldb expects that liblldb will be installed at /usr/lib/llvm-13/lib/liblldb.so.1
but this has been moved to /lib/x86_64-linux-gnu/liblldb-13.so.1 and replaced with a symlink.

The way lldb finds its python path is essentially
$(dirname $(dirname $path_to_liblldb))/lib/python3/dist-packages

see: ScriptInterpreterPython::ComputePythonDir, ScriptInterpreterPython::GetPythonDir
https://github.com/llvm/llvm-project/blob/7c5ecc8b7e1bcd1b02eafeba9bbf3d5bc50d72c5/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp#L394

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: lldb-13 1:13.0.0-2
ProcVersionSignature: Ubuntu 5.13.0-21.21-generic 5.13.18
Uname: Linux 5.13.0-21-generic x86_64
ApportVersion: 2.20.11-0ubuntu71
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Thu Nov 18 14:43:08 2021
InstallationDate: Installed on 2017-04-13 (1680 days ago)
InstallationMedia: Ubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2)
SourcePackage: llvm-toolchain-13
UpgradeStatus: Upgraded to impish on 2021-11-09 (9 days ago)

Revision history for this message
Lawrence D'Anna (larry-elder-gods) wrote :
Revision history for this message
Sylvestre Ledru (sylvestre) wrote :

don't hesitate to provide patch for this. I am not sure I will have time to work on it soon.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in llvm-toolchain-13 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.