** Description changed:

+ [ Impact ]
+ 
+  * python3-lldb-22 contains two Python extensions as symlinks to
+    liblldb.
+    - The first works without issue:
+      
/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/_lldb.cpython-314-x86_64-linux-gnu.so
+      -> ../../../../../x86_64-linux-gnu/liblldb-22.so.1
+      = /usr/lib/x86_64-linux-gnu/liblldb-22.so.1
+    - The second symlink is broken:
+      
/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/native/_lldb.cpython-314-x86_64-linux-gnu.so
+      -> ../../../../liblldb.so
+      = /usr/lib/llvm-22/lib/liblldb.so
+ 
+  * This upload fixes this broken symlink by adding the missing 'native'
+    subdir to the paths for both the python3-lldb-22 symlinks and the
+    place which debian/rules places the Python extensions in the first
+    place.
+ 
+  * This upload is simply a cherry-pick of two Debian commits--the
+    first[1] commit fixed the symlink, and the second[2] commit fixed the
+    extension location.
+ 
+ [1]: 
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/36e8ff638f7ea8789aa1d2bd821a0f28f3669f7c
+ [2]: 
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/3a45e3eda0e442b95eb8dc86de882cf3f08c560d
+ 
+ [ Test Plan ]
+ 
+  * This bug can be reproduced, and the fix tested, by pointing the
+    Python interpreter to the lldb system Python modules and attempting
+    to load the LLDB module.
+ 
+  * The following steps were performed in a fresh 26.04 LXD container:
+    $ apt update
+    $ apt install -y python3-lldb-22 lldb-22
+    $ PYTHONPATH=`lldb-22 -P` python3 -c 'import lldb'
+ 
+  * The bugged version should produce an error message like the following:
+    Traceback (most recent call last):
+      File "/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/__init__.py", 
line 39, in <module>
+        import _lldb
+    ModuleNotFoundError: No module named '_lldb'
+    
+    During handling of the above exception, another exception occurred:
+    
+    Traceback (most recent call last):
+      File "<string>", line 1, in <module>
+        import lldb
+      File "/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/__init__.py", 
line 47, in <module>
+        from .native import _lldb
+    ImportError: cannot import name '_lldb' from 'lldb.native' 
(/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/native/__init__.py)
+ 
+  * The fixed version should produce no such error message and import the
+    LLDB module without issue.
+ 
+ [ Where problems could occur ]
+ 
+  * The biggest risk of adding these changes to a stable Ubuntu release
+    is the potential breakage of any package builds or systems which use
+    the old hardcoded path for _lldb.cpython-314-x86_64-linux-gnu.so.
+    Such cases will encounter a file-not-found error becasue the file has
+    been moved into the native/ subdirectory. There is always a risk
+    inherent to moving installed files, as it's possible someone relies
+    on the exact path in some way.
+ 
+  * One major factor mitigating regression risk is the fact that these
+    exact commits are already in Debian LLVM 22 and Stonking LLVM 22;
+    they were added in version 1:22.1.4-1, after the Resolute archive had
+    already closed.
+ 
+ [ Other Info ]
+ 
+  * Currently, amd64 and arm64 autopkgtests are failing in a PPA, while
+    the other tests pass:
+    - amd64: 
https://autopkgtest.ubuntu.com/results/autopkgtest-resolute-maxgmr-llvm-toolchains/resolute/amd64/l/llvm-toolchain-22/20260605_144759_21d6c@/log.gz
+    - arm64: 
https://autopkgtest.ubuntu.com/results/autopkgtest-resolute-maxgmr-llvm-toolchains/resolute/arm64/l/llvm-toolchain-22/20260605_145055_9aeaa@/log.gz
+    - armhf: 
https://autopkgtest.ubuntu.com/results/autopkgtest-resolute-maxgmr-llvm-toolchains/resolute/armhf/l/llvm-toolchain-22/20260605_144519_37b86@/log.gz
+    - ppc64el: 
https://autopkgtest.ubuntu.com/results/autopkgtest-resolute-maxgmr-llvm-toolchains/resolute/ppc64el/l/llvm-toolchain-22/20260605_144852_c2362@/log.gz
+    - s390x: 
https://autopkgtest.ubuntu.com/results/autopkgtest-resolute-maxgmr-llvm-toolchains/resolute/s390x/l/llvm-toolchain-22/20260605_154305_5837f@/log.gz
+ 
+  * This is not a regression. In fact, as shown by the autopkgtest page
+    (https://autopkgtest.ubuntu.com/packages/llvm-toolchain-22),
+    llvm-toolchain-22 has *never* passed an autopkgtest on *any*
+    architecture in 26.04. While we naturally want the autopkgtests to be
+    useful, fixing them is outside of the scope of this particular bug.
+ 
+ [ Original Bug Description ]
+ 
  python3-lldb-22 contains two Python extensions as symlinks to liblldb:
  
  1. 
/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/_lldb.cpython-314-x86_64-linux-gnu.so
     (-> ../../../../../x86_64-linux-gnu/liblldb-22.so.1
      = /usr/lib/x86_64-linux-gnu/liblldb-22.so.1)
  2. 
/usr/lib/llvm-22/lib/python3.14/site-packages/lldb/native/_lldb.cpython-314-x86_64-linux-gnu.so
     (-> ../../../../liblldb.so
      = /usr/lib/llvm-22/lib/liblldb.so)
  
  The first link works, but the second one is broken. /usr/lib/llvm-22/lib
  has no liblldb.so - it only has a liblldb.so.1 and liblldb-22.so.1.
  
  This causes `PYTHONPATH=`lldb-22 -P` python3 -c 'import lldb'` to fail.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2152839

Title:
  Broken symlink for python3-lldb-22

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-22/+bug/2152839/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to