Gentoo Archives: gentoo-portage-dev

From: Michael 'veremitz' Everitt <gentoo@×××××××.xyz>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Add QA check for unresolved soname dependencies (bug 704320)
Date: Mon, 06 Jan 2020 06:48:18
Message-Id: 843b62f4-a25c-a34c-c038-488c1e84c586@veremit.xyz
In Reply to: [gentoo-portage-dev] [PATCH] Add QA check for unresolved soname dependencies (bug 704320) by Zac Medico
1 On 06/01/20 06:38, Zac Medico wrote:
2 > Example output for maven-bin-3.6.2 (bug 704618):
3 >
4 > * QA Notice: Unresolved soname dependencies:
5 > *
6 > * /usr/share/maven-bin-3.6/lib/jansi-native/freebsd32/libjansi.so: libc.so.7 libutil.so.9
7 > * /usr/share/maven-bin-3.6/lib/jansi-native/freebsd64/libjansi.so: libc.so.7 libutil.so.9
8 > *
9 >
10 > This warning comes up when a library or executable has one or
11 > more soname dependencies (found in its NEEDED.ELF.2 metadata)
12 > that could not be resolved by usual means. If you run ldd
13 > on files like these then it will report a "not found" error
14 > for each unresolved soname dependency. In order to correct
15 > problems with soname dependency resolution, use one or more
16 > of the approaches described in the following sections.
17 >
18 > Content of the NEEDED.ELF.2 metadata file may be useful
19 > for debugging purposes. Find the NEEDED.ELF.2 file in the
20 > ${D}/../build-info/ directory after the ebuild src_install
21 > phase completes, or in the /var/db/pkg/*/*/ directory for an
22 > installed package. Each line of the NEEDED.ELF.2 file contains
23 > semicolon separated values for a single ELF file. The soname
24 > dependencies are found in the DT_NEEDED column:
25 >
26 > E_MACHINE;path;DT_SONAME;DT_RUNPATH;DT_NEEDED;multilib category
27 >
28 > External dependencies
29 >
30 > For packages that install pre-built binaries, it may be possible
31 > to resolve soname dependencies simply by adding dependencies
32 > for one or more other packages that are known to provide the
33 > needed sonames.
34 >
35 > Removal of unecessary files
36 >
37 > For packages that install pre-built binaries, it may be possible
38 > to resolve soname dependencies simply by removing unnecessary
39 > files which have unresolved soname dependencies. For example,
40 > some pre-built binary packages include binaries intended for
41 > irrelevant architectures or operating systems, and these files
42 > can simply be removed because they are unnecessary.
43 >
44 > Addition of DT_RUNPATH entries
45 >
46 > If the relevant dependencies are installed in a location that
47 > is not included in the dynamic linker search path, then it's
48 > necessary for files to include a DT_RUNPATH entry which refers
49 > to the appropriate directory. The special $ORIGIN value can
50 > be used to create a relative path reference in DT_RUNPATH,
51 > where $ORIGIN is a placeholder for the directory where the
52 > file having the DT_RUNPATH entry is located.
53 >
54 > For pre-built binaries, it may be necessary to fix up
55 > DT_RUNPATH using patchelf --set-rpath. For example, use
56 > patchelf --set-rpath '$ORIGIN' if a given binary should link
57 > to libraries found in the same directory as the binary itself,
58 > or use patchelf --set-rpath '$ORIGIN/libs' if a given binary
59 > should link to libraries found in a subdirectory named libs
60 > found in the same directory as the binary itself.
61 >
62 > For binaries built from source, a flag like
63 > -Wl,-rpath,/path/of/directory/containing/libs will create
64 > binaries with the desired DT_RUNPATH entry.
65 >
66 > Bug: https://bugs.gentoo.org/704320
67 > Signed-off-by: Zac Medico <zmedico@g.o>
68 > ---
69 <snip>
70
71 Looks awesome!
72
73 One comment: would it be helpful for developers/maintainers to have some
74 indication of what's going on here, and what attempts portage is making in
75 this regard? Something like a 'verbose' option that would spit out some
76 debugging info so that /if/ something goes wrong, or the outcome wasn't
77 what was intended, then this can be picked up and corrected somehow else?
78
79 I think automation is great for picking these issues up, and shining a
80 light on where/why something goes wrong, but sometimes it needs a few
81 minutes of human intervention to achieve the sane outcome in many
82 circumstances.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies