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

Replies

Subject Author
Re: [gentoo-dev] RFC: Eclasses and EAPI "Michał Górny" <mgorny@g.o>
Re: [gentoo-dev] RFC: Eclasses and EAPI Mike Gilbert <floppym@g.o>