1 |
17.08.2014 01:54, William Hubbs пишет: |
2 |
> All, |
3 |
> |
4 |
> there is an ongoing discussion about how we handle eclass phase |
5 |
> functions by default [1]. |
6 |
> |
7 |
> Currently, EXPORT_FUNCTIONS is called in eclasses, and because of the |
8 |
> way this works, the phase function that is exported last in the chain of |
9 |
> inherited eclasses is the one that is called for a given phase, |
10 |
> overriding the PMS default phase function. |
11 |
> |
12 |
> The initial proposal is to change this behaviour so that the PMS default |
13 |
> phase functions call all matching phase functions from inherited |
14 |
> eclasses in sequence. |
15 |
> |
16 |
> For example: |
17 |
> |
18 |
> - your ebuild inherits foo and bar and each of them have src_unpack |
19 |
> functions. With this new behaviour, the default src_unpack would run |
20 |
> foo_src_unpack, bar_src_unpack, then perform its own actions. |
21 |
> |
22 |
> I strongly oppose this change, because I feel it will make our |
23 |
> entire tree very unpredictable at best. I realize this might eliminate |
24 |
> boilerplating from our tree. Weighing that against the possible |
25 |
> ramifications in this big of a change in automagic behaviour, I think |
26 |
> the cost is much higher than the gain. |
27 |
> |
28 |
> I am also not very comfortable with our current state, because it has |
29 |
> a lot of uncertainty in terms of how the eclass phase functions are |
30 |
> called. |
31 |
> |
32 |
> My counter proposal to this is that we stop calling eclass phase |
33 |
> functions automatically, and to minimize the amount of boilerplating |
34 |
> we would have to do, we use a variable, such as ECLASS_PHASES which |
35 |
> would be defined at the ebuild level and contain a list of the eclass |
36 |
> phase functions we want to run automatically. |
37 |
> |
38 |
> Going back to my previous example, say your ebuild does the following: |
39 |
> |
40 |
> -- code begins here -- |
41 |
> |
42 |
> inherit foo bar |
43 |
> |
44 |
> # Foo and bar both have src_unpack and src_install functions. |
45 |
> # we want foo's src_unpack and bar's src_install: |
46 |
> |
47 |
> ECLASS_PHASES="foo_src_unpack |
48 |
> bar_src_install" |
49 |
> |
50 |
> -- code ends here --- |
51 |
> |
52 |
> If ECLASS_PHASES is undefined, I think the default should be to not run |
53 |
> the eclass phase functions. |
54 |
> |
55 |
> Yes, this means there is some boilerplating. However, there are some |
56 |
> strong advantages: |
57 |
> |
58 |
> - this is no longer dependent on order of inheritance. |
59 |
> - The ebuild author knows exactly which eclass phase functions will |
60 |
> be run. |
61 |
> |
62 |
> Thoughts? |
63 |
> |
64 |
> William |
65 |
> |
66 |
> [1] https://bugs.gentoo.org/show_bugs.cgi?id=516014 |
67 |
> |
68 |
|
69 |
You have my strong opposition on such change as well. It will turn |
70 |
ebuilds into unreadable and undpredictable mess, please do not do that |
71 |
|
72 |
-- |
73 |
Best regards, Sergey Popov |
74 |
Gentoo developer |
75 |
Gentoo Desktop Effects project lead |
76 |
Gentoo Proxy maintainers project lead |