Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [gentoo-dev-announce] EAPI 6 draft for review
Date: Mon, 19 Oct 2015 18:28:41
Message-Id: 20151019202816.694b344f@gentoo.org
In Reply to: Re: [gentoo-dev] Re: [gentoo-dev-announce] EAPI 6 draft for review by Rich Freeman
1 On Mon, 19 Oct 2015 13:17:13 -0400
2 Rich Freeman <rich0@g.o> wrote:
3
4 > On Mon, Oct 19, 2015 at 10:21 AM, Alexis Ballier
5 > <aballier@g.o> wrote:
6 > > On Mon, 19 Oct 2015 09:51:20 -0400
7 > > Rich Freeman <rich0@g.o> wrote:
8 > > [...]
9 > >> >
10 > >> >> I'd say the best approach for compatibility if you have an
11 > >> >> existing eclass and it already exports src_prepare is to not
12 > >> >> call eapply_user unless it firmly falls into the #2 category
13 > >> >> above.
14 > >> >
15 > >> > Replace 'not call eapply_user' by 'not export src_prepare' and
16 > >> > I'd agree with you if going a bit further by ensuring there is
17 > >> > no hidden problem:
18 > >>
19 > >> Well, taken together my recommendation does amount to:
20 > >> 1. Avoid exporting src_prepare at all.
21 > >> 2. If you do export src_prepare, then don't call eapply_user.
22 > >
23 > > 2. sucks: an ebuild inheriting that eclass will have to redefine
24 > > src_prepare in order not to break with eapi6, so there's no point
25 > > in exporting the function in the first place.
26 >
27 > No argument. I'm just saying that nothing stops us from using an
28 > existing eclass with EAPI6 without changing function names all over
29 > the tree. Non-EAPI6 ebuilds can still use the existing function
30 > automatically, and new ebuilds using EAPI6 have to work around the
31 > issue until the eclass is revisioned.
32
33 ok, or the eclass can change api with eapi6 which is quite common, and
34 preferably *before* any eapi6 ebuild uses it
35 again, history doesn't have to repeat itself, but it has shown that if
36 eclasses aren't updated properly quickly, it'd be a mess
37
38 > >
39 > > Also, since you seem to know well KDE: where would you call
40 > > eapply_user, in kde eclasses or cmake-utils ?
41 > >
42 >
43 > Definitely in a kde eclass. cmake-utils would fall into the category
44 > of a utility eclass, so it ideally shouldn't export phase functions at
45 > all. Again, I'm not proposing forcing a change on that now, and it
46 > needs more thought, but it would be a lousy place to put eapply_user
47 > since it could be used in the same ebuild as another eclass that
48 > performs a similar function.
49 >
50 > That might require having the kde eclass call the cmake-utils eclass
51 > function. Since the kde eclass is only intended to be used by kde
52 > ebuilds maintained by the same group that maintains the eclass, there
53 > isn't a problem here. The ebuilds themselves just set a bunch of
54 > variables and leave the work to the eclass.
55
56 That's what I feared... I would definitely put it in cmake-utils, since
57 the idea behind all those *-utils.eclass is that they're fed with
58 options and do all the grunt work for you. Think of them as default
59 phases for a given build system. What you propose is close to having
60 eapply_user mandatory in eapi6 but having default src_prepare not
61 calling it...
62 Following your criteria, the list I provided is very far from complete,
63 and should include all the *-utils eclass, multilib ones, and
64 probably many others I don't even dare to look for.
65
66 However, as you say, putting it in cmake-utils needs to be properly
67 thought so that it doesn't conflict with other eclasses: Hence the need
68 to properly define what eclasses should call eapply_user and apply
69 patches and what should not.
70
71 Your initial argument was very convincing, but under those conditions,
72 it seems way much saner to make eapply_user idempotent and be done.
73 (and maybe in addition require informally that eapply_user is called
74 after applying patches, but that'd fall under good practices rather
75 than rules)

Replies