asdf-community / asdf-community/asdf-python

preferred way to export `libpython3.so` to ldd?

Offen
#168 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
729
Forks
65
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Provide environment information

```bash
OS:
Linux TG02 6.5.0-stock #1 SMP PREEMPT_DYNAMIC Wed Aug 30 11:09:37 KST 2023 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
fish, version 3.6.1

ASDF VERSION:
v0.11.1-27c8a10

ASDF ENVIRONMENT VARIABLES:
ASDF_DIRENV_BIN=/home/scarf/.asdf/installs/direnv/2.32.3/bin/direnv

ASDF INSTALLED PLUGINS:
direnv https://github.com/asdf-community/asdf-direnv.git master 1a140d6
golang https://github.com/kennyp/asdf-golang.git master f006a12
gradle https://github.com/rfrancis/asdf-gradle.git master e47df00
java https://github.com/halcyon/asdf-java.git master 89f431e
kotlin https://github.com/asdf-community/asdf-kotlin.git master af9ab2c
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4
pnpm https://github.com/jonathanmorley/asdf-pnpm.git master ea033db
python https://github.com/danhper/asdf-python.git master 8505457
```

### To Reproduce

```sh
!  ~/l/t/perf  ldd (which perf) 2023년 08월 30일 (수) 오전 11시 49분 21초 linux-vdso.so.1 (0x00007ffebadd4000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f82cb317000)
libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007f82cbe9f000)
libdw.so.1 => /lib/x86_64-linux-gnu/libdw.so.1 (0x00007f82cbdf4000)
libunwind-x86_64.so.8 => /lib/x86_64-linux-gnu/libunwind-x86_64.so.8 (0x00007f82cb2fb000)
libunwind.so.8 => /lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f82cb2df000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f82cb2ad000)
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f82cae00000)
libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f82caa00000)
libperl.so.5.36 => /lib/x86_64-linux-gnu/libperl.so.5.36 (0x00007f82ca600000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f82ca200000)
libpython3.12.so.1.0 => not found
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f82c9e00000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f82cb28f000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f82ca54c000)
libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f82cbde4000)
libnuma.so.1 => /lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f82cb282000)
libbabeltrace-ctf.so.1 => /lib/x86_64-linux-gnu/libbabeltrace-ctf.so.1 (0x00007f82cadb5000)
libpfm.so.4 => /lib/x86_64-linux-gnu/libpfm.so.4 (0x00007f82c9a00000)
libtraceevent.so.1 => /lib/x86_64-linux-gnu/libtraceevent.so.1 (0x00007f82cb259000)
/lib64/ld-linux-x86-64.so.2 (0x00007f82cbee6000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f82ca9ed000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f82ca9b3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f82ca528000)
libbabeltrace.so.1 => /lib/x86_64-linux-gnu/libbabeltrace.so.1 (0x00007f82ca9a4000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f82cadac000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f82ca0b9000)
libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f82ca48e000)
```

### Describe the Bug

`perf` tool could not find `libpython3.12.so.1.0`.

```sh
~/l/t/perf  perf 118ms  2023년 08월 30일 (수) 오전 11시 49분 11초perf: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
```

### Expected Behaviour

asdf installs has
```sh
~/l/t/perf  lsd -al ~/.asdf/installs/python/3.12.0b3/lib/
drwxr-xr-x scarf scarf 4.0 KB 2023-06-23 금 16:26:22  .
drwxr-xr-x scarf scarf 4.0 KB 2023-07-20 목 20:22:20  ..
lrwxrwxrwx scarf scarf 20 B 2023-06-23 금 16:26:17  libpython3.12.so ⇒ libpython3.12.so.1.0
.rwxr-xr-x scarf scarf 29 MB 2023-06-23 금 16:26:17  libpython3.12.so.1.0
.rwxr-xr-x scarf scarf 15 KB 2023-06-23 금 16:26:17  libpython3.so
drwxr-xr-x scarf scarf 4.0 KB 2023-06-23 금 16:26:22  pkgconfig
drwxr-xr-x scarf scarf 4.0 KB 2023-06-23 금 16:26:22  python3.12
```
however `asdf reshim python` will not add shared objects to `~/.asdf/shims/python`. i could just add `~/.asdf/installs/python/3.12.0b3/lib/` to `LD_LIBRARY_PATH`, but this would be fragile when version changes.

would there be a better way to manage this problem?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, die von ldd und dem perf loader gemeldete fehlende libpython3.12.so.1.0 zu reproduzieren, und untersuche anschließend, wie `asdf reshim python` Shims erstellt und mit `~/.asdf/installs/python/.../lib/` umgeht. Als erledigt gilt die Aufgabe, wenn eine versionssichere Möglichkeit identifiziert und dokumentiert ist, die Shared Library auffindbar zu machen, ohne einen manuell versionierten LD_LIBRARY_PATH zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, shell
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.