1 |
On Mon, 19 Oct 2015 15:49:06 -0400 |
2 |
Rich Freeman <rich0@g.o> wrote: |
3 |
|
4 |
> On Mon, Oct 19, 2015 at 2:28 PM, Alexis Ballier <aballier@g.o> |
5 |
> wrote: |
6 |
> > |
7 |
> > However, as you say, putting it in cmake-utils needs to be properly |
8 |
> > thought so that it doesn't conflict with other eclasses: Hence the |
9 |
> > need to properly define what eclasses should call eapply_user and |
10 |
> > apply patches and what should not. |
11 |
> > |
12 |
> |
13 |
> That is my main concern. Maybe a package uses cmake and ant. Patches |
14 |
> could affect either. With an automagic design you might have to run |
15 |
> half of each src_configure, then apply patches, then run the other |
16 |
> half of each src_configure. |
17 |
|
18 |
This is my concern too and where I am fearing crappy code :) |
19 |
|
20 |
|
21 |
> > Your initial argument was very convincing, but under those |
22 |
> > conditions, it seems way much saner to make eapply_user idempotent |
23 |
> > and be done. (and maybe in addition require informally that |
24 |
> > eapply_user is called after applying patches, but that'd fall under |
25 |
> > good practices rather than rules) |
26 |
> |
27 |
> The only danger here is that later phase functions to run would be |
28 |
> operating on already-patched sources, when they expect to be running |
29 |
> on unpatched sources. I imagine that usually wouldn't be a problem, |
30 |
> but it of course could be one. |
31 |
> |
32 |
> I do get your analogy to eapply_user not being in the default phase |
33 |
> function. |
34 |
> |
35 |
> This all falls into that general category of correctness vs |
36 |
> convenience. It is more convenient if you can just call eapply_user |
37 |
> at a suboptimal point and not have to mess with your ebuilds. The |
38 |
> same argument could be made for running all the inherited eclass phase |
39 |
> functions and not just one of them. The issue is that this can break |
40 |
> in lots of hard-to-predict ways. I'd rather see things refactored to |
41 |
> deal with this in a more sane manner. |
42 |
|
43 |
It's not about correctness vs convenience: eapply_user idempotent |
44 |
doesn't prevent from doing it correctly. It makes it possible to do it |
45 |
incorrectly though, just like any turing-complete language actually, but |
46 |
it is not clear at all what would be the ratio of "incorrect convenient |
47 |
usage" vs "correct convenient usage": if 99.9% of the tree is fine, |
48 |
then convenience is clearly worth it instead of changing everything to |
49 |
accommodate the remaining 0.1%. |
50 |
eapply_user dying on second call, defined in PMS, OTOH, prevents |
51 |
such flexibility and thus raises a lot of design questions that, as seen |
52 |
here, don't seem to have a clear answer yet and for which it could |
53 |
indeed be worth refactoring. |
54 |
|
55 |
|
56 |
I can't find an example of where the guideline "apply ebuild |
57 |
patches before eapply_user" would not be sufficient: After all, |
58 |
all subsequent phases will also run on user-patched sources and there |
59 |
are millions of ways to make a patch break a package. |
60 |
|
61 |
> That actually makes me wonder if the better solution is to add another |
62 |
> phase - such as src_postprepare or something like that, where you'd |
63 |
> run autotools or whatever. If that were done then you could also make |
64 |
> hasufell happy by just having the PM do the patching after |
65 |
> src_prepare. Maybe that can go in EAPI7. :) |
66 |
|
67 |
src_patch ? :) |