1 |
Hi, |
2 |
|
3 |
On 28-03-2022 13:05:03 +0200, Thomas Bracht Laumann Jespersen wrote: |
4 |
> Hi! |
5 |
> |
6 |
> I've been working on a new section in the devmanual regarding conditional |
7 |
> patching. In a PR [0] Sam suggested adding a section to clarify that conditional |
8 |
> patching should be avoided, because it can quickly become a maintenance and |
9 |
> testing burden. |
10 |
> |
11 |
> The devmanual PR is here: [1] |
12 |
> |
13 |
> Ulrich points out that conditional patching is actually suggested elsewhere, and |
14 |
> that actively discouraging conditional patching is a policy change, which should |
15 |
> be brought up on this list. So this is what I'm doing now. He also pointed out a |
16 |
> comment in eutils.eclass re [2] (the comment now lives in epatch.eclass). |
17 |
> |
18 |
> The overall policy (proposal, I guess) is something like: |
19 |
> |
20 |
> * Patches should be written such that they affect behaviour correctly based on |
21 |
> e.g. build time definitions or config options, rather than USE flags |
22 |
> directly. |
23 |
> |
24 |
> * They should be applied unconditionally, so that, for version bumps and other |
25 |
> development happening with a package, any failure to apply the patch will be |
26 |
> caught by the developer. |
27 |
> |
28 |
> * Patching is ideally only done to make the package in question build properly, |
29 |
> and should not be done to modify the runtime behaviour of the package. (This |
30 |
> is what USE flags and configuration options of the package are for.) |
31 |
> |
32 |
> Sam made a specific point re musl: "for e.g. musl patches, we want a portable |
33 |
> fix, not a hack which is only applied for musl" |
34 |
> |
35 |
> Feedback on this very welcome. I'm grappling a bit with the exact wording to go |
36 |
> for, so input on that is also appreciated. |
37 |
> |
38 |
> I think my question to this list is: Should it be policy that conditional |
39 |
> patching is to be avoided? |
40 |
|
41 |
We really don't want conditional patches, but I from my experience |
42 |
reality is that sometimes you have to. Therefore this should remain |
43 |
possible. I have no problems with highly discouraging conditional |
44 |
patching. |
45 |
|
46 |
About your other points, I think they are kind of debatable. Gentoo |
47 |
wants to be close to upstream, but with your set of rules, one can't |
48 |
e.g. add hpn patches to ssh, which would be really silly, as the point |
49 |
of Gentoo is that since you build from source, you can actually apply |
50 |
such patches, conditionally if they don't have a means to be disabled. |
51 |
|
52 |
In other words, I think the gist of your points is to be in an ideal |
53 |
world, but unfortunately reality is far from it. That said, repeating |
54 |
myself, nothing wrong with discouraging quick 'n' dirty, for as long as |
55 |
it remains a big fat warning and advice. |
56 |
|
57 |
My €0.02 |
58 |
Fabian |
59 |
|
60 |
> [0]: https://github.com/gentoo/gentoo/pull/24709#discussion_r832361402 |
61 |
> [1]: https://github.com/gentoo/devmanual/pull/281 |
62 |
> [2]: https://gitweb.gentoo.org/archive/repo/gentoo-2.git/tree/eclass/eutils.eclass?id=50e8beda904760c773e5c67fdfe8242255e13495#n175 |
63 |
> |
64 |
|
65 |
-- |
66 |
Fabian Groffen |
67 |
Gentoo on a different level |