Gentoo Archives: gentoo-dev

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Replacing binary-only SLOTs with separate packages
Date: Sat, 19 Jan 2019 14:38:12
Message-Id: 20190119173741.0812b23065ba4a4c19a803a3@gentoo.org
In Reply to: [gentoo-dev] [RFC] Replacing binary-only SLOTs with separate packages by "Michał Górny"
1 On Fri, 18 Jan 2019 21:13:34 +0100 Michał Górny wrote:
2 > Hello,
3 >
4 > Since I've been working on the early gx86-multilib, we've been using
5 > 'binary-only SLOTs' to support providing old versions of libraries for
6 > prebuilt software. I think this was a bad idea, and I'd like to suggest
7 > replacing it with something cleaner, for the reasons outlined below.
8 >
9 >
10 > Current state
11 > =============
12 >
13 > Let's take dev-libs/openssl as an example. This package has three SLOTs
14 > right now:
15 >
16 > 0.9.8: 0.9.8z_p8-r1
17 > 1.0.0: 1.0.2q-r200
18 > 0 : 1.0.2q 1.1.0j 1.1.1a 1.1.1a-r1
19 >
20 > The real package is provided as slot :0, that includes all libraries,
21 > headers and executables. Slots 0.9.8 and 1.0.0 only install .so.N*
22 > libraries that can be used to satisfy dependencies of prebuilt packages.
23 >
24 >
25 > Problems with the current state
26 > ===============================
27 >
28 > Firstly, it is confusing to developers. Let's analyze the dependencies
29 > on dev-libs/openssl. A quick grep reveals seven patterns. They are
30 > listed below, along with occurrence counts and percentages:
31 >
32 > dev-libs/openssl 278 7.8% }
33 > dev-libs/openssl:* 49 1.4% } 14.2%
34 > dev-libs/openssl:= 178 5.0% }
35 > dev-libs/openssl:0 660 18.6%
36 > dev-libs/openssl:0= 2381 67.0%
37 > dev-libs/openssl:0/0 4 0.1%
38 > dev-libs/openssl:0/1.1 2 0.1%
39 >
40 > (note that those are rough measures, not guaranteed to be precise)
41 >
42 > So apparently 14.2% of dependencies allow any slot of OpenSSL which is
43 > most likely wrong, and 1.4% explicitly claim that's what the package
44 > wants. This could be valid only if e.g. the package supported multiple
45 > ABIs of OpenSSL libraries and used dlopen() with a few possible SONAMEs
46 > which I honestly doubt any of those packages is doing.
47 >
48 > In other words, 14.2% of dependencies on OpenSSL are plain wrong,
49 > and 6.4% are wrong in a way that isn't going to be reported by repoman.
50 > 1.4% of cases are using ':*' which probably indicates the developer
51 > decided to silence repoman without understanding how slot operators work
52 > which is a horrible thing from QA perspective.
53 >
54 > We also have a few cases that require specific OpenSSL subslot (e.g.
55 > forcing old version into :0 slot) but *none* actually using the binary
56 > compatibility slots.
57 >
58 >
59 > Secondly, it is confusing to users. If we remove old versions and only
60 > keep binary compatibility slots, users can be easily tricked into
61 > installing them and being surprised it's not a complete package. If we
62 > keep old versions, we end up having different revisions of the same
63 > version in different slots which is also easily confused.
64 >
65 >
66 > Thirdly, it is cumbersome to introduce. If we are to introduce a binary
67 > compatibility slot for a package that didn't have it, we need to update
68 > all reverse dependencies. This usually means researching whether we
69 > should use ':0' or ':0=', and if we get this wrong, we just silence
70 > repoman warning about missing slot-op.
71 >
72 >
73 > All of this considered, I can't think of a single real benefit of using
74 > slots for this purpose. They work but there's nothing really special
75 > about them.
76 >
77 >
78 > Suggested replacement
79 > =====================
80 >
81 > My suggestion is to move binary compatibility slots into separate
82 > packages. For example, dev-libs/openssl would be split into:
83 >
84 > dev-libs/openssl -- containing the actual package
85 >
86 > dev-libs/openssl-bin-compat -- containing binary compatibility slots
87 >
88 > In this case, all dependencies on dev-libs/openssl would become correct
89 > (or semi-correct, wrt missing := dep) again. Since packages are co-
90 > installable the same way slots are, there is no loss there. Since
91 > nothing depends on binary compatibility slots, we do not even need to
92 > update anything (but if we had, the update cost would be minimal both to
93 > developers and to users).
94 >
95 >
96 > What do you think?
97
98 I do not like the idea. Slots are very elegant and effective
99 mechanism and is one of the points where Gentoo outruns other
100 distributions. Proposed approach with compat packages will
101 effectively disable slots for most cases.
102
103 Also proposed change will create a lot of unneeded technical
104 difficulties in maintaining packages: there will be double ebuilds
105 to maintain instead of a single one, ${PN} references will be
106 broken without additional changes and so far and so on. A lot of
107 unnecessary rebuilds will happen due slot to package moves.
108
109 Aside from development questions for me in a role of sysadmin slots
110 are much easier and understandable to manage than zoo of *compat*
111 packages in other distributions.
112
113 Assumption that :* is always wrong is invalid, since there are
114 valid cases: there are apps supporting various API versions or
115 using tools/data files without any care from where they are coming.
116
117 Best regards,
118 Andrew Savchenko

Replies