Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] The inherit-EXPORT_FUNCTIONS ordering problem
Date: Sun, 29 Aug 2021 18:44:25
Message-Id: ACCD52FD-959E-4447-B225-42D8E791472C@gentoo.org
In Reply to: Re: [gentoo-dev] The inherit-EXPORT_FUNCTIONS ordering problem by Ionen Wolkens
1 > On 29 Aug 2021, at 19:41, Ionen Wolkens <ionen@g.o> wrote:
2 >
3 > On Sun, Aug 29, 2021 at 12:23:22PM -0500, William Hubbs wrote:
4 >> On Sat, Aug 28, 2021 at 06:35:06PM +0200, Michał Górny wrote:
5 >>> Hi,
6 >>>
7 >>> I've been informed of a slight inconsistency in package manager behavior
8 >>> that affects combining EXPORT_FUNCTIONS with inherit (by ionic, thanks
9 >>> for the report!). Please consider the three following snippets:
10 >>
11 >> ...
12 >>
13 >>> 1. I'd like to propose that we explicitly require all inherits to happen
14 >>> before EXPORT_FUNCTIONS. This will ensure consistent behavior across
15 >>> all package managers.
16 >>>
17 >>> 2. I'd like to ask your opinion whether we should:
18 >>>
19 >>> a. revert the Portage behavior to be consistent with PkgCore/Paludis
20 >>>
21 >>> b. update PMS to identify the behavior as 'undefined', i.e. either
22 >>> solution is correct.
23 >>
24 >> I would go with 1 and 2 b, but I also propose another option for the
25 >> next eapi which may be a bit controversial.
26 >>
27 >> Starting with eapi 9, make export_functions a noop (you can't remove it
28 >> until all eclasses/ebuilds only support eapis that don't require it).
29 >>
30 >> I understand that this is controversial, because it would require a lot
31 >> of work to convert ebuilds to eapi 9, but it would eliminate this
32 >> ambiguity/inconsistency in the future because it would require all
33 >> ebuilds to have phase functions unless they can use the default phases
34 >> the eapis provide.
35 >>
36 >> Thoughts?
37 >
38 > If anything I'd personally prefer the rough opposite of this, in the
39 > event multiple eclass export the same, have the package manager merge
40 > them.
41
42 This is my preference too, if we're to go this route.
43
44 It's similar to what was proposed in https://bugs.gentoo.org/516014, although
45 this topic tends to lead to lots of different ideas (sometimes solving different
46 problems!)
47
48 >
49 > e.g. rather than have `inherit cmake xdg` run xdg_src_prepare over
50 > cmake's, would export:
51 >
52 > src_prepare() {
53 > cmake_src_prepare
54 > xdg_src_prepare
55 > }
56 >
57 > unless the ebuild redefines it (which I imagine would often be because
58 > of optional support, e.g. use lua &&, or occasional incompatibilities)
59 >
60 > Some ebuilds have special needs, but then there's all those generic
61 > ebuilds that should stay nearly empty.
62
63 best,
64 sam

Attachments

File name MIME type
signature.asc application/pgp-signature