public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Policy on conditional patching
@ 2022-03-28 11:05 Thomas Bracht Laumann Jespersen
  2022-03-28 11:13 ` Fabian Groffen
  2022-03-29  3:43 ` Sam James
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Bracht Laumann Jespersen @ 2022-03-28 11:05 UTC (permalink / raw
  To: gentoo-dev

Hi!

I've been working on a new section in the devmanual regarding conditional
patching. In a PR [0] Sam suggested adding a section to clarify that conditional
patching should be avoided, because it can quickly become a maintenance and
testing burden.

The devmanual PR is here: [1]

Ulrich points out that conditional patching is actually suggested elsewhere, and
that actively discouraging conditional patching is a policy change, which should
be brought up on this list. So this is what I'm doing now. He also pointed out a
comment in eutils.eclass re [2] (the comment now lives in epatch.eclass).

The overall policy (proposal, I guess) is something like:

 * Patches should be written such that they affect behaviour correctly based on
   e.g. build time definitions or config options, rather than USE flags
   directly.

 * They should be applied unconditionally, so that, for version bumps and other
   development happening with a package, any failure to apply the patch will be
   caught by the developer.

 * Patching is ideally only done to make the package in question build properly,
   and should not be done to modify the runtime behaviour of the package. (This
   is what USE flags and configuration options of the package are for.)

Sam made a specific point re musl: "for e.g. musl patches, we want a portable
fix, not a hack which is only applied for musl"

Feedback on this very welcome. I'm grappling a bit with the exact wording to go
for, so input on that is also appreciated.

I think my question to this list is: Should it be policy that conditional
patching is to be avoided?

All the best,
-- Thomas

[0]: https://github.com/gentoo/gentoo/pull/24709#discussion_r832361402
[1]: https://github.com/gentoo/devmanual/pull/281
[2]: https://gitweb.gentoo.org/archive/repo/gentoo-2.git/tree/eclass/eutils.eclass?id=50e8beda904760c773e5c67fdfe8242255e13495#n175


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-29  3:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-28 11:05 [gentoo-dev] Policy on conditional patching Thomas Bracht Laumann Jespersen
2022-03-28 11:13 ` Fabian Groffen
2022-03-28 12:09   ` Thomas Bracht Laumann Jespersen
2022-03-29  3:36   ` Sam James
2022-03-29  3:43 ` Sam James
2022-03-29  3:43   ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox