Bug 268437 - devel/llvm1[45]: lldb can't find _lldb.cpython-39.so
Summary: devel/llvm1[45]: lldb can't find _lldb.cpython-39.so
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-18 04:21 UTC by Joel Rodriguez
Modified: 2023-07-11 23:03 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (brooks)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Rodriguez 2022-12-18 04:21:43 UTC
FreeBSD 12.3-RELEASE-p6 GENERIC

both ports are missing python3.9/site-packages/lldb

_lldb.cpython-39.so:No such file or directory

===>   Registering installation for llvm14-14.0.6
pkg-static: Unable to access file /usr/ports/devel/llvm14/work/stage/usr/local/llvm14/lib/python3.9/site-pack\
ages/lldb/_lldb.cpython-39.so:No such file or directory
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/llvm14
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/llvm14
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2022-12-19 17:55:58 UTC
These build fine on the ports cluster so there's something about your environment that differs from standard. Are your python and python3 ports up to date and pointing to 3.9?  Please check your STAGEDIR different python directories.
Comment 2 Joel Rodriguez 2022-12-19 19:45:31 UTC
I am under the impression that :
"LLDB has a Python scripting capability and supplies its own Python module named lldb."

LLVM10, LLVM11, LLVM12, AND LLVM13 all build correctly.

root@tahoestores:/usr/local # find . -name lldb -print
./llvm12/include/lldb
./llvm12/bin/lldb
./llvm12/lib/python3.9/site-packages/lldb
./llvm11/bin/lldb
./llvm11/include/lldb
./llvm11/lib/python3.9/site-packages/lldb
./share/doc/llvm10/lldb
./share/doc/llvm11/lldb
./llvm13/include/lldb
./llvm13/bin/lldb
./llvm13/lib/python3.9/site-packages/lldb
./llvm10/bin/lldb
./llvm10/lib/python3.9/site-packages/lldb
./llvm10/include/lldb

There are no LLVM14/LLVM15 directories because the build failed to install them from the local working directories which are reported by the build make as to not exist. 

I'll go ahead are rebuild those ports(again) just to verify.

Please advise.
Comment 3 Joel Rodriguez 2022-12-20 00:41:29 UTC
OK, here is llvm13

root@tahoestores:/usr/ports/devel/llvm13 # ls -lat ./work/stage/usr/local/llvm13/lib/python3.9/site-packages/lldb/
total 237
drwxr-xr-x  5 root  wheel       9 Dec 19 13:56 .
lrwxr-xr-x  1 root  wheel      30 Dec 19 13:56 lldb-argdumper -> ../../../../bin/lldb-argdumper
drwxr-xr-x  2 root  wheel       4 Dec 19 13:56 plugins
drwxr-xr-x  3 root  wheel       9 Dec 19 13:56 formatters
lrwxr-xr-x  1 root  wheel      19 Dec 19 13:56 _lldb.so -> ../../../liblldb.so
drwxr-xr-x  2 root  wheel       5 Dec 19 13:56 utils
drwxr-xr-x  4 root  wheel       5 Dec 19 13:56 ..
-rw-r--r--  1 root  wheel  667720 Dec 19 13:55 __init__.py
-rw-r--r--  1 root  wheel    4415 Dec 19 13:55 embedded_interpreter.py

here is llvm14 (the link is bad)


root@tahoestores:/usr/ports/devel/llvm14 # ls -lat ./work/stage/usr/local/llvm14/lib/python3.9/site-packages/lldb
total 237
drwxr-xr-x  2 root  wheel       5 Dec 19 16:11 utils
drwxr-xr-x  5 root  wheel       9 Dec 19 16:11 .
lrwxr-xr-x  1 root  wheel      30 Dec 19 16:11 lldb-argdumper -> ../../../../bin/lldb-argdumper
drwxr-xr-x  2 root  wheel       4 Dec 19 16:11 plugins
drwxr-xr-x  3 root  wheel       9 Dec 19 16:11 formatters
lrwxr-xr-x  1 root  wheel      19 Dec 19 16:11 _lldb.cpython-39d.so -> ../../../liblldb.so
drwxr-xr-x  4 root  wheel       5 Dec 19 16:11 ..
-rw-r--r--  1 root  wheel  669843 Dec 19 16:10 __init__.py
-rw-r--r--  1 root  wheel    4415 Dec 19 16:10 embedded_interpreter.py

I'll rebuild llvm15 next
Comment 4 Brooks Davis freebsd_committer freebsd_triage 2022-12-20 00:52:46 UTC
Hmm. _lldb.cpython-39d.so seems vaguely familiar.
                   ^^^

What is the output of: python-config --abiflags
Comment 5 Joel Rodriguez 2022-12-20 02:27:00 UTC
OK, exact same issue with llvm15

root@tahoestores:/usr/ports/devel/llvm15/work/stage/usr/local # ls -lat llvm15/lib/python3.9/site-packages/lldb/
total 237
drwxr-xr-x  4 root  wheel       5 Dec 19 18:20 ..
drwxr-xr-x  3 root  wheel       9 Dec 19 18:20 formatters
drwxr-xr-x  5 root  wheel       9 Dec 19 18:20 .
lrwxr-xr-x  1 root  wheel      30 Dec 19 18:20 lldb-argdumper -> ../../../../bin/lldb-argdumper
lrwxr-xr-x  1 root  wheel      19 Dec 19 18:20 _lldb.cpython-39d.so -> ../../../liblldb.so
drwxr-xr-x  2 root  wheel       5 Dec 19 18:20 utils
drwxr-xr-x  2 root  wheel       4 Dec 19 18:20 plugins
-rw-r--r--  1 root  wheel  674171 Dec 19 18:19 __init__.py
-rw-r--r--  1 root  wheel    4032 Dec 19 18:19 embedded_interpreter.py

I am not sure how to run python-config --abiflags, but if I am add a link without the "d" in it, all is well.

It is clear that the Makefile expects something different than what is generated for that particular link.
Comment 6 Brooks Davis freebsd_committer freebsd_triage 2022-12-20 23:32:08 UTC
Literally run `python-config --abiflags` at the shell prompt. On my main test system pkg which says:

/usr/local/bin/python-config was installed by package python-3.9_3,2

and I see the following when I run it (that's a single empty line):

$ python-config --abiflags

$
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-01-27 23:54:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=aeb2ce7f4b401deff1b71280d147f3d2c2b5fafd

commit aeb2ce7f4b401deff1b71280d147f3d2c2b5fafd
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-01-27 23:53:39 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-01-27 23:53:40 +0000

    devel/llvm-devel: fix packaging with debug python

    The actual suffix if python extensions (at least as built by the LLVM
    infrastructure) is ${PYTHON_EXT_SUFFIX}${PYTHON_ABIVER} not merely the
    former.

    PR:             268437
    Sponsored by:   DARPA

 devel/llvm-devel/Makefile  | 3 ++-
 devel/llvm-devel/pkg-plist | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-01-30 23:40:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c16e3dc045cfe2485d4021ad205d58be276dba02

commit c16e3dc045cfe2485d4021ad205d58be276dba02
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-01-30 23:38:37 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-01-30 23:39:26 +0000

    devel/llvm14: fix packaging with debug python

    The actual suffix if python extensions (at least as built by the LLVM
    infrastructure) is ${PYTHON_EXT_SUFFIX}${PYTHON_ABIVER} not merely the
    former.

    PR:             268437
    Sponsored by:   DARPA

 devel/llvm14/Makefile  | 3 ++-
 devel/llvm14/pkg-plist | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2023-01-30 23:40:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6629f8d3d65b6f010d2bd1012c847c47ab66f242

commit 6629f8d3d65b6f010d2bd1012c847c47ab66f242
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-01-30 23:38:36 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-01-30 23:38:36 +0000

    devel/llvm15: fix packaging with debug python

    The actual suffix if python extensions (at least as built by the LLVM
    infrastructure) is ${PYTHON_EXT_SUFFIX}${PYTHON_ABIVER} not merely the
    former.

    PR:             268437
    Sponsored by:   DARPA

 devel/llvm15/Makefile  | 3 ++-
 devel/llvm15/pkg-plist | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Comment 10 Brooks Davis freebsd_committer freebsd_triage 2023-07-11 23:03:12 UTC
AFACT this is fixed