Gentoo Archives: gentoo-dev

From: Kent Fredric <kentfredric@×××××.com>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: calling all eclass phase functions by default
Date: Sun, 17 Aug 2014 08:49:44
Message-Id: CAATnKFCREvG1z+ZTf0L0NP6opK9NnX3ykb7B_dNAyJTL=7v_dw@mail.gmail.com
In Reply to: Re: [gentoo-dev] rfc: calling all eclass phase functions by default by "Michał Górny"
1 On 17 August 2014 19:03, Michał Górny <mgorny@g.o> wrote:
2
3 >
4 > > So if you could sculpt it to be broader by default and have less scope
5 > for
6 > > developer error, that'd be an improvement.
7 > >
8 > > --- code start --
9 > > ECLASS_EXCLUDE="foo_src_unpack bar_src_unpack"
10 > > inherit foo bar baz
11 > >
12 > >
13 > > --- code end ---
14 > >
15 > > here, src_unpack would be baz_src_unpack *regardless* of composition
16 > order
17 > > because "foo" and "bar" were barred from being used, and baz took
18 > > precedence as a result.
19 >
20 > Wow, so you suggest replacing a solution where you have to re-declare
21 > all the phases with one in which you have to opt-out of all phases of
22 > all eclasses...
23 >
24 > This thread spreads more great ideas every minute. Soon enough, we will
25 > ban eclasses and require every ebuild to write everything inline just
26 > to be sure. Preferably using kernel calls from assembly to avoid as much
27 > middleware as possible, and make ebuilds as verbose as possible.
28
29
30
31 Indeed, I think I shall recall my suggestion, because the number of times
32 you *ever* want to express that in eclasses is rare and none.
33
34 Either you want to expressly say "I want these phases to run in this order,
35 regardless of the import ordering", or "I want some sensible default to
36 take place based on import ordering"
37
38 Saying "I want this subset of possible phases to not happen, but we might
39 anticipate that somebody creates a function later that breaks our class and
40 that be ok"
41
42 Who ever does that. Seriously.
43
44 You would literally be enumerating ( @INHERITED - THEONEIWANT ) every
45 time when you could simply declare the one you want by doing " function(){
46 THEONEIWANT }".
47
48 In short, "Just override the function if you need to" is about as simple
49 and straight forward and not mental gymnastics as you're going to get.
50
51 Otherwise we're just paving a superhighway with good-intention-tiles.
52
53 --
54 Kent
55
56 *KENTNL* - https://metacpan.org/author/KENTNL