Gentoo Archives: gentoo-dev

From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Policy on conditional patching
Date: Mon, 28 Mar 2022 11:05:26
Message-Id: 20220328110503.vbhtmrm3kprtvmeo@sofaking
1 Hi!
3 I've been working on a new section in the devmanual regarding conditional
4 patching. In a PR [0] Sam suggested adding a section to clarify that conditional
5 patching should be avoided, because it can quickly become a maintenance and
6 testing burden.
8 The devmanual PR is here: [1]
10 Ulrich points out that conditional patching is actually suggested elsewhere, and
11 that actively discouraging conditional patching is a policy change, which should
12 be brought up on this list. So this is what I'm doing now. He also pointed out a
13 comment in eutils.eclass re [2] (the comment now lives in epatch.eclass).
15 The overall policy (proposal, I guess) is something like:
17 * Patches should be written such that they affect behaviour correctly based on
18 e.g. build time definitions or config options, rather than USE flags
19 directly.
21 * They should be applied unconditionally, so that, for version bumps and other
22 development happening with a package, any failure to apply the patch will be
23 caught by the developer.
25 * Patching is ideally only done to make the package in question build properly,
26 and should not be done to modify the runtime behaviour of the package. (This
27 is what USE flags and configuration options of the package are for.)
29 Sam made a specific point re musl: "for e.g. musl patches, we want a portable
30 fix, not a hack which is only applied for musl"
32 Feedback on this very welcome. I'm grappling a bit with the exact wording to go
33 for, so input on that is also appreciated.
35 I think my question to this list is: Should it be policy that conditional
36 patching is to be avoided?
38 All the best,
39 -- Thomas
41 [0]:
42 [1]:
43 [2]:


Subject Author
Re: [gentoo-dev] Policy on conditional patching Fabian Groffen <grobian@g.o>
Re: [gentoo-dev] Policy on conditional patching Sam James <sam@g.o>