Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] sys-meta/* to own and control /bin/{cpio,sh,tar,...} symlinks (alternatives-ish)
Date: Wed, 23 Nov 2022 14:38:05
Message-Id: d2e2de7d54dd268c9c7c0761cae3d4dfee9ee6e7.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] sys-meta/* to own and control /bin/{cpio,sh,tar,...} symlinks (alternatives-ish) by Michael Orlitzky
1 On Wed, 2022-11-23 at 08:47 -0500, Michael Orlitzky wrote:
2 > On Wed, 2022-11-23 at 08:38 +0100, Michał Górny wrote:
3 > > Hello, everyone.
4 > >
5 > > TL;DR: I'd like to add sys-meta/{cpio,sh,tar} to install and control
6 > > (via USE flags) /bin/{cpio,sh,tar} symlinks.
7 > >
8 > > Draft PR: https://github.com/gentoo/gentoo/pull/28390
9 > >
10 >
11 > I generally favor using the package manager in these situations, but
12 > there's a lot of user-facing documentation (and user configurations)
13 > that will need updating. We should probably have a GLEP -- and
14 > eventually a news item -- for this.
15 >
16 > A few comments:
17 >
18 > * The new category is a bit annoying. I know the PMS says that  
19 > virtuals can't install files, but having an entirely separate 
20 > category for virtuals that install a symlink feels excessive.
21 > Not that I have a better idea.
22
23 Do you have any specific concerns about having an extra category?
24 I'm not aware of any real costs involved, or real reasons to use
25 categories scarcely.
26
27 > * The name also suggests to me that it will control sys-* 
28 > implementations, but the victims so far are all app-*. Obviously,
29 > we don't want twenty *-meta categories though.
30 >
31 > * The -meta prefix is already used in a bunch of ebuilds to mean
32 > something different. The packages in sys-meta won't be 
33 > "metapackages" in the same sense.
34
35 I don't really care how it's named. I've chosen "sys-" because in my
36 PoC it happens to control tools that are part of the base system.
37 I suppose we could also want it for less important stuff like notify-
38 send (though I guess I'll lastrite that eselect anyway). I think we
39 should just use one category for all of them, and I'm open to a better
40 name.
41
42 > * Should we replace app-arch/tar with sys-meta/tar in @system?
43
44 I think that makes sense for a long-term goal, unless there's a good
45 reason to always have gtar around. It should be noted that this will
46 require adding explicitly dependencies to some packages.
47
48 >
49 > * Having to specify the relationship twice (once in the sys-meta 
50 > package and once in each implementation) is also a bit ugly, as is 
51 > having to account for the symlink not being installed (yet) in 
52 > each implementation's pkg_postinst. This made me wonder, could 
53 > the RDEPEND/PDEPEND be reversed? In other words, could (say) GNU 
54 > tar require that the symlink be present immediately, but the 
55 > metapackage only require that some implementation be merged 
56 > eventually?
57 >
58 > To answer my own question, the PMS says that PDEPENDs "must be 
59 > installed at some point before the package manager finishes the 
60 > batch of installs," which would be problematic if some later 
61 > package in the batch actually needed a tar implementation 
62 > available to build. We can't change the PMS, so installing a 
63 > symlink in the implementation ebuilds avoids the issue, but still
64 >   eventually cedes control to the sys-meta package.
65 >
66 > I guess you already thought through all of that? If so, it would be
67 > nice to have the rationale written down somewhere that we can refer
68 > back to.
69
70 Yes, I thought how to do it and I think the current implementation is
71 the best we can. The most important point is avoiding a long period
72 without system tools being available during the transition, and I think
73 pkg_postinst() approach handles that best.
74
75 > * Is it worth thinking about improvements to EAPI=? that could help 
76 > us here? By e.g. allowing virtuals to install symlinks, or by 
77 > making PDEPEND kick in sooner (after this package, but before the 
78 > rest of the batch)?
79 >
80
81 PMS doesn't say anything about (new-style) virtuals. It's a Gentoo
82 policy entirely.
83
84 Improving PDEPEND would be also helpful e.g. for clang/clang-runtime
85 cycle. Unfortunately, it's non-trivial since PDEPENDs can have their
86 own dependencies that can affect the build order in mysterious ways.
87 Dependency resolver is not really my area of expertise.
88
89 --
90 Best regards,
91 Michał Górny

Replies