Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] New ebuild metadata variables for filtering of binary package soname dependencies (analogous to Fedora __provides_exclude and __requires_exclude)
Date: Mon, 29 Dec 2014 21:23:03
Message-Id: 54A1C62E.4050807@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] New ebuild metadata variables for filtering of binary package soname dependencies (analogous to Fedora __provides_exclude and __requires_exclude) by Matthias Maier
1 On 12/29/2014 03:28 AM, Matthias Maier wrote:
2 >
3 > Am 29. Dec 2014, 09:46 schrieb Zac Medico <zmedico@g.o>:
4 >
5 >> In order to implement something like this for Gentoo, we could add
6 >> PROVIDES_EXCLUDE and REQUIRES_EXCLUDE ebuild metadata variables. These
7 >> variables would be used to automatically generate PROVIDES and REQUIRES
8 >> data for binary packages, based on the output of scanelf. The resulting
9 >> PROVIDES and REQUIRES data would simply contain lists of sonames (and
10 >> their corresponding ABIs, for multilib support), which would be used to
11 >> resolve dependencies of binary packages. For example, the resulting
12 >> REQUIRES and PROVIDES data for sys-libs/zlib-1.2.8-r1 built with
13 >> ABI_X86="32 64" might look something like this:
14 >>
15 >> REQUIRES: X86_64: libc.so.6 386: libc.so.6
16 >>
17 >> PROVIDES: X86_64: libz.so.1 386: libz.so.1
18 >
19 > So this basically shifts information that is available only after a
20 > merge (and e.g. checked in the preserved-libs feature) to the metadata
21 > of the binary package?
22
23 Right.
24
25 >> For libz, the new PROVIDES_EXCLUDE and REQUIRES_EXCLUDE ebuild variables
26 >> would not be needed. However, for things like python and perl modules,
27 >> these variables would be used to exclude unwanted sonames from REQUIRES
28 >> and PROVIDES.
29 >
30 > How do you intend to use the new metadata in detail?
31
32 The REQUIRES and PROVIDES data will supplement *DEPEND when resolving
33 dependencies for binary packages.
34
35 There is some overlap in information between EAPI 5 slot-operator
36 dependencies and REQUIRES/PROVIDES. That's a good thing though, for at
37 least the following 3 reasons:
38
39 1) Slot-operator dependencies have not reached 100% adoption, so
40 REQUIRES/PROVIDES soname dependencies will provide information for all
41 packages, regardless of EAPI 5 slot-operator and sub-slot adoption. We
42 can enable PROVIDES_EXCLUDE and REQUIRES_EXCLUDE support for all
43 existing EAPIs, so that migrating packages to a new EAPI will not be a
44 barrier to adoption of PROVIDES_EXCLUDE and REQUIRES_EXCLUDE.
45
46 2) Gentoo has a long-standing policy of omitting system packages from
47 dependencies. This leads to unspecified dependencies that might never be
48 specified with slot-operators and sub-slots. For these unspecified
49 dependencies, REQUIRES/PROVIDES soname dependencies will provide
50 dependency information that is not currently available by any other means.
51
52 3) REQUIRES/PROVIDES soname dependencies can be used to implement QA
53 checks for dependencies that have been accidentally omitted from *DEPEND
54 variables.
55
56 > Is it planned to introduce this as another dependency constraint on
57 > binary merges? Will this become a 'hard' or 'soft' dependency?
58
59 It should be considered a 'hard' dependency. Of course, we could provide
60 an option to make it 'soft', but I do not anticipate a need for this.
61
62 I think we should add something like the
63 --ignore-built-slot-operator-deps option which will allow the user to
64 explicitly disable rebuilds triggered by soname changes. We could even
65 re-purpose --ignore-built-slot-operator-deps so that it also applies to
66 rebuilds triggered by REQUIRES/PROVIDES data, but it's probably better
67 to use a separate option.
68
69 > E.g. consider two packages, libfoo-1 (soname libfoo-1) and bar linking
70 > against libfoo. And libfoo-2 (with new soname libfoo-2) emerged
71 > replacing version 1 on the binhost replacing libfoo-1, bar not rebuild.
72 > We now have on the binhost:
73 > libfoo-1 (soname libfoo-1)
74 > libfoo-2 (soname libfoo-2)
75 > bar (dynamically linked to libfoo-1)
76 >
77 > (i) Currently, an update on a client (using the binhost) will upgrade
78 > libfoo-1 to libfoo-2 and the preserved-libs feature will preserve
79 > the necessary shared library libfoo-1 for bar.
80
81 This behavior will remain the same as long as FEATURES=preserve-libs is
82 enabled on the client.
83
84 > (ii) What should happen with above metadata?
85
86 Any libraries preserved by preserve-libs will have no effect on the
87 REQUIRES/PROVIDES data. So, the metadata will be exactly the same,
88 regardless of preserve-libs settings on either the client or server. You
89 can consider preserve-libs as being beyond the scope of the whole
90 proposal, and essentially irrelevant to it.
91
92 > Shall an update only resolve to libfoo-1 and bar?
93
94 It depends on the state of the client and its configuration settings.
95 Under the most common usage scenario, the client should be configured to
96 skip the libfoo-2 update until the binhost has rebuilt bar to link
97 against libfoo-2. Of course, the client would also have the option to
98 pull in the libfoo-1 update and rebuild bar itself. If bar uses a
99 slot-operator dependency and libfoo uses sub-slots, the usual
100 slot-operator mechanism would trigger rebuild on the client. If libfoo
101 has not adopted sub-slots, then the PROVIDES data of libfoo-2 and the
102 REQUIRES data of the installed bar instance would serve as an
103 alternative mechanism to trigger rebuild on the client.
104
105 > (iii) What if libfoo-1 is removed from the binhost? If libfoo-1 is
106 > already merged on the client an update wrt (i) is still possible.
107 > So, shall the preserved-libs feature be used as a fall back then?
108
109 The client should try to eliminate any preserved-libs at the earliest
110 opportunity. Therefore the most common usage scenario would be
111 essentially the same as described above with respect to (i).
112
113 > (iv) If bar is rebuild on the binhost - which it should be nowadays -
114 > above metadata information could be used to automatically remerge
115 > bar on the client - but couldn't this already be done with a
116 > slot-operator dependency?
117
118 Yes, but we should also consider the 3 reasons that I have enumerated
119 above, which make REQUIRES/PROVIDES data extremely useful for plenty of
120 cases that are not currently covered by slot-operator dependencies (and
121 will not be covered for the foreseeable future).
122
123 > Further, we currently have multiple approaches for ensuring consistency
124 > of dynamic linkage, the "poor man's approach" revdep-rebuild, language
125 > specific update scripts (for python, perl, haskell,...), the
126 > preserved-libs feature and, finally, slot-operators.
127 > This would be another iteration of a solution, this time for binary
128 > merges. Can you give me an example where your proposed approach is the
129 > only way to ensure consistency of dynamic linkage, or is conceptually
130 > cleaner?
131
132 Conceptually, slot-operators are the cleanest solution. The
133 preserve-libs feature complements slot-operators by temporarily
134 satisfying soname dependencies during the process of updating packages.
135
136 However, due to the 3 reasons that I have enumerated above,
137 REQUIRES/PROVIDES data is extremely useful for plenty of cases that are
138 not currently covered by slot-operator dependencies (and will not be
139 covered for the foreseeable future).
140
141 > I, for my part, like the fact that such metadata generation would be
142 > completely automatic.
143
144 Yes, I think that this proposal represents a very practical way to
145 integrate binary soname dependencies with Gentoo, so that binary package
146 support will be more competitive with binary distros.
147 --
148 Thanks,
149 Zac

Replies