Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: RFC: Eclasses and EAPI
Date: Tue, 06 Sep 2016 02:51:15
Message-Id: pan$88e0b$3290c7f5$810c2329$f48f49f8@cox.net
In Reply to: Re: [gentoo-dev] RFC: Eclasses and EAPI by Alexis Ballier
1 Alexis Ballier posted on Mon, 05 Sep 2016 15:58:54 +0200 as excerpted:
2
3 > On Mon, 5 Sep 2016 14:58:29 +0200 Michał Górny <mgorny@g.o>
4 > wrote:
5 >
6 >> On Mon, 5 Sep 2016 11:20:29 +0200 Alexis Ballier <aballier@g.o>
7 >> wrote:
8 >>
9 >> > On Fri, 2 Sep 2016 19:19:16 +0200 Kristian Fiskerstrand
10 >> > <k_f@g.o> wrote:
11 >> >
12 >> > > On 09/02/2016 07:17 PM, Rich Freeman wrote:
13 >> > > > On Fri, Sep 2, 2016 at 12:53 PM, Alexis Ballier
14 >> > > > <aballier@g.o> wrote:
15 >> > > >> On Fri, 2 Sep 2016 18:13:20 +0200 Kristian Fiskerstrand
16 >> > > >> <k_f@g.o> wrote:
17 >> > > >>
18 >> > > >>> Hi Devs,
19 >> > > >>>
20 >> > > >>> I'm wondering whether it wouldn't make sense to require
21 >> > > >>> eclasses (or strongly encourage) to include an explicit list of
22 >> > > >>> EAPIs it has been tested for in order to ease testing when
23 >> > > >>> introducing new EAPIs.
24 >> > > >>>
25 >> > > >>> We have seen some issues already with EAPI6 bump related to
26 >> > > >>> get_libdir and people updating EAPI in ebuild without properly
27 >> > > >>> testing the inherited eclasses. having a whitelist in place and
28 >> > > >>> die if eclass is not updated to handle it solves it.
29 >> > > >>>
30 >> > > >>> Thoughts? comments? cookies? threats?
31 >> > > >>>
32 >> > > >>>
33 >> > > >> Never liked to wait for a whole eclass update for a new eapi
34 >> > > >> when I only use a couple functions from it that I have tested
35 >> > > >> when updating an ebuild.
36 >> > > >>
37 >> > > >>
38 >> > > > I think the idea is a sound one though. And there is no reason
39 >> > > > it couldn't be tweaked to give the option to set it at the
40 >> > > > function level and not the eclass level. This is also an
41 >> > > > argument for simplifying eclasses when it makes sense (I realize
42 >> > > > this will never be 100%).
43 >> > >
44 >> > > If specific functions can be useful there is also a case to be made
45 >> > > for refactoring of the code
46 >> >
47 >> > Well, let's say we have an eapi that introduces usedeps and
48 >> > src_configure. Let's say we have an ebuild with a few built_with_use
49 >> > || die calls that could benefit from usedeps. Let's call this ebuild
50 >> > vlc. Let's say this ebuild inherits an eclass for updating the icon
51 >> > cache and redefines all other ebuild phases. Let's call this eclass
52 >> > gnome2. Let's assume this eclass is widely used by tens of packages
53 >> > that do actually use the exported functions from it. It makes a lot
54 >> > of sense to ban this new eapi in this eclass until it is ported.
55 >> > However, porting it takes months and we are stick with those
56 >> > built_with_use || die calls.
57 >> >
58 >> > Of course, the best solution is to port the eclass. The second option
59 >> > is to drop the inherit from the ebuild and call the relevant
60 >> > functions by defining ebuild phases. This duplicates a bit of code
61 >> > but works well. However, it seems to me it is more practical to have
62 >> > an eclass not dying and letting ebuild writers deal with their crap
63 >> > if something goes wrong.
64 >>
65 >> That's the worst argument I've heard for a long time.
66 >>
67 >> It could be pretty much summarized as 'let's commit crap and hope it
68 >> will work; worst case, things will go horribly kaboom on users'.
69 >
70 > Then you've not understood a single bit of what was written.
71
72 PMFJI, but either I'm not understanding either, or mgorny did understand,
73 but is looking at it from a different perspective, that being the eclass
74 maintainer's perspective, and thus seeing an angle/problem you didn't
75 cover in your example.
76
77 Here's the problem. If an eclass hasn't been ported to a new EAPI, then
78 it's reasonable for the eclass maintainer to assume that no ebuilds
79 inheriting it should have been ported to that EAPI either. Now if your
80 ebuild inherits that eclass before the porting, and claims the new EAPI,
81 it may be tested and work just fine at first, possibly even with that
82 ebuild being stabilized.
83
84 But the maintainer still hasn't ported the eclass to the new EAPI and is
85 working on porting under the assumption that no ebuilds inheriting it
86 will have been ported either, so the maintainer is free to implement the
87 new EAPI as desired, taking the opportunity to kill some cruft, etc, by
88 not exporting it to the new EAPI, because any ebuild using that eclass
89 porting will, from the eclass maintainer's perspective, only be ported
90 after the eclass itself is.
91
92 So now the eclass maintainer kills a function or two as from his
93 perspective they don't make sense in the new EAPI, still assuming no
94 ebuild inheriting the eclass uses the new EAPI, and that tested and
95 possibly stable ebuild that prematurely upgraded to the new EAPI before
96 that eclass it inherited did, suddenly goes BOOM, because that function
97 that was used in the ebuild suddenly disappears!
98
99 Which was perfectly logical for the eclass maintainer to do, since he
100 logically assumed that no ebuild inheriting that eclass would be EAPI-
101 upgraded before the eclass itself was, making the conditional removal for
102 only that new EAPI perfectly fine since from his perspective any ebuilds
103 inheriting that eclass and porting to the new EAPI could simply deal with
104 the missing function when they ported to the new EAPI themselves.
105
106 Which of course is yet another reason to hard-code the eclass logic to
107 die on any EAPI it isn't known to work with, since that will prevent the
108 problem in the first place, because if the ebuild tried to jump the gun
109 then, it would have immediately died and never would have passed testing,
110 let alone possibly made it to stable, in the first place.
111
112 Did I get that correct, mgorny, or am I too not understanding, aballier?
113
114 --
115 Duncan - List replies preferred. No HTML msgs.
116 "Every nonfree program has a lord, a master --
117 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-dev] Re: RFC: Eclasses and EAPI Alexis Ballier <aballier@g.o>