Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [RFC] Moving subslot-only virtuals to a separate category to reduce confusion
Date: Sat, 30 Jan 2021 17:52:24
Message-Id: CAAr7Pr9LiwGya=nxSEg8og_9MCafU8itgwysRPUfRYupFAbxVw@mail.gmail.com
In Reply to: [gentoo-dev] [RFC] Moving subslot-only virtuals to a separate category to reduce confusion by "Michał Górny"
1 On Sat, Jan 30, 2021 at 9:36 AM Michał Górny <mgorny@g.o> wrote:
2 >
3 > Hi,
4 >
5 > TL;DR: I'd like to move virtual/libjpeg, virtual/libudev and so on to
6 > another category (e.g. lib-sover/*) to make it clear that they are used
7 > for := deps and have valid use even with a single provider.
8 >
9 >
10 > Right now we have at least a few packages that provide more than one
11 > valid consumer-intended library, each with a different SOVERSION that is
12 > bumped independently. To list a few examples:
13 >
14 > - media-libs/libjpeg-turbo: libturbojpeg.so.0, libjpeg.so.62
15 > - sys-apps/systemd: libsystemd.so.0, libudev.so.1
16 > - app-text/poppler: libpoppler.so.106, libpoppler-cpp.so.0, libpoppler-
17 > glib.so.8, libpoppler-qt5.so.1
18 >
19 > The problem is that the current subslot mechanism doesn't really provide
20 > for that. Laying aside possible future EAPI extensions (that are
21 > debatable due to added complexity to an already complex syntax), there
22 > are three commonly used possibilities here:
23 >
24 > a. bumping subslot whenever any of SOVERSIONs change -- meaning possibly
25 > unnecessary rebuilds,
26 >
27 > b. using subslot for one of the SOVERSIONs and assuming the rest stable
28 > -- this is what we do for poppler, and it's mildly confusing,
29 >
30 > c. using additional packages to represent SOVERSION of individual
31 > libraries -- this is e.g. used for libudev or libjpeg.
32 >
33 >
34 > I'd like to discuss option c. in more detail. Right now, we're creating
35 > additional packages in virtual/ category. This was mostly fine,
36 > as the libraries in question (libjpeg, libudev) had multiple providers.
37 > However, now that we've removed the old media-libs/jpeg, people get
38 > the obvious idea that the virtual is no longer necessary -- except that
39 > it is!
40 >
41 > The rough idea is that the subslot of libjpeg-turbo is supposed to
42 > represent the ABI version of libjpeg-turbo -- that is actually rarely
43 > used. On the other hand, the subslot of libjpeg is represented by
44 > virtual/jpeg. So if your package is using libjpeg.so, it should :=-
45 > depend on the latter and not on the former.
46 >
47 > The problem is that this is confusing, and if somebody doesn't know
48 > the secret, he can easily consider the virtual obsolete and depend
49 > on the library directly.
50 >
51 > To make this SOVERSION-virtual concept more visible and easily
52 > distinguishable from regular virtuals, I'd like to propose that we start
53 > moving them into a dedicated category. For example, 'lib-sover' comes
54 > to my mind. While this ofc doesn't guarantee that people will do things
55 > right, it will at least make it clear that these packages are somewhat
56 > different from regular virtuals and hopefully avoid making wrong
57 > assumptions.
58 >
59 > WDYT?
60
61 I'm not sure I understand the problem with (a). But this is partly my
62 bias here. I expect to rebuild with Gentoo; often; its literally the
63 whole point. So when the developer community is like "Well we want
64 fewer rebuilds" I sort of scoff. "This is Gentoo, rebuilds are a
65 thing." I wish I was more in sync with the community on this ;(
66
67 For (c) I'd rather see something like a linter:
68 - If I dep on libjpeg-turbo, raise a linter hint that says "hey if
69 this dep is for libjpeg.so, if you want that, swap this *DEPEND for
70 virtual/jpeg: read this wiki page for more information..."
71 - Its not meant as a QA warning (the hint will not prevent submission
72 or block CI.)
73 - But its a mechanization of this problem and solution. Instead of
74 reading some thread on -dev, there is a tool to detect instances of
75 this problem, it tells you briefly what the options are, and links
76 somewhere for more information. This sort of thing is related to an
77 earlier -core thread about how to keep developers up to date..threads
78 like this are great but they are not a system.
79
80 In short, I don't think a package naming convention is sufficient to
81 achieve your goal of making this problem happen less often.
82
83 I also have no idea how often this problem happens today (and if we
84 can lint it, we can count those too.)
85 Is the problem even a big enough deal to do anything?
86
87 -A
88
89 >
90 > --
91 > Best regards,
92 > Michał Górny
93 >
94 >
95 >