Gentoo Archives: gentoo-dev

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

Replies

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