Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: Eclasses and EAPI
Date: Mon, 05 Sep 2016 16:05:06
Message-Id: 20160905180446.5be46ec1@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: Eclasses and EAPI by Mike Gilbert
1 On Mon, 5 Sep 2016 10:45:30 -0400
2 Mike Gilbert <floppym@g.o> wrote:
3
4 > On Mon, Sep 5, 2016 at 5:20 AM, Alexis Ballier <aballier@g.o>
5 > wrote:
6 > > On Fri, 2 Sep 2016 19:19:16 +0200
7 > > Kristian Fiskerstrand <k_f@g.o> wrote:
8 > >
9 > >> On 09/02/2016 07:17 PM, Rich Freeman wrote:
10 > >> > On Fri, Sep 2, 2016 at 12:53 PM, Alexis Ballier
11 > >> > <aballier@g.o> wrote:
12 > >> >> On Fri, 2 Sep 2016 18:13:20 +0200
13 > >> >> Kristian Fiskerstrand <k_f@g.o> wrote:
14 > >> >>
15 > >> >>> Hi Devs,
16 > >> >>>
17 > >> >>> I'm wondering whether it wouldn't make sense to require
18 > >> >>> eclasses (or strongly encourage) to include an explicit list
19 > >> >>> of EAPIs it has been tested for in order to ease testing when
20 > >> >>> introducing new EAPIs.
21 > >> >>>
22 > >> >>> We have seen some issues already with EAPI6 bump related to
23 > >> >>> get_libdir and people updating EAPI in ebuild without properly
24 > >> >>> testing the inherited eclasses. having a whitelist in place and
25 > >> >>> die if eclass is not updated to handle it solves it.
26 > >> >>>
27 > >> >>> Thoughts? comments? cookies? threats?
28 > >> >>>
29 > >> >>
30 > >> >> Never liked to wait for a whole eclass update for a new eapi
31 > >> >> when I only use a couple functions from it that I have tested
32 > >> >> when updating an ebuild.
33 > >> >>
34 > >> >
35 > >> > I think the idea is a sound one though. And there is no reason
36 > >> > it couldn't be tweaked to give the option to set it at the
37 > >> > function level and not the eclass level. This is also an
38 > >> > argument for simplifying eclasses when it makes sense (I realize
39 > >> > this will never be 100%).
40 > >>
41 > >> If specific functions can be useful there is also a case to be made
42 > >> for refactoring of the code
43 > >>
44 > >
45 > >
46 > > Well, let's say we have an eapi that introduces usedeps and
47 > > src_configure. Let's say we have an ebuild with a few
48 > > built_with_use || die calls that could benefit from usedeps. Let's
49 > > call this ebuild vlc. Let's say this ebuild inherits an eclass for
50 > > updating the icon cache and redefines all other ebuild phases.
51 > > Let's call this eclass gnome2. Let's assume this eclass is widely
52 > > used by tens of packages that do actually use the exported
53 > > functions from it. It makes a lot of sense to ban this new eapi in
54 > > this eclass until it is ported. However, porting it takes months
55 > > and we are stick with those built_with_use || die calls.
56 > >
57 > > Of course, the best solution is to port the eclass. The second
58 > > option is to drop the inherit from the ebuild and call the relevant
59 > > functions by defining ebuild phases. This duplicates a bit of code
60 > > but works well. However, it seems to me it is more practical to
61 > > have an eclass not dying and letting ebuild writers deal with their
62 > > crap if something goes wrong.
63 > >
64 >
65 > I think this is a good argument for keeping utility functions and
66 > phase functions in separate eclasses, regardless of EAPI gating.
67
68
69 Probably. But this is not an argument at all: it is just an example of
70 when what is proposed is perfectly valid, for good reasons, but also
71 impractical. In the end, it depends where one wants to draw the line.