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:58:09
Message-Id: 9F7EF01F-2E40-4CC0-9AB5-49AB5D9C0754@gentoo.org
In Reply to: Re: [gentoo-dev] The inherit-EXPORT_FUNCTIONS ordering problem by "Michał Górny"
1 > On 29 Aug 2021, at 19:44, Michał Górny <mgorny@g.o> wrote:
2 >
3 > On Sun, 2021-08-29 at 14:41 -0400, Ionen Wolkens wrote:
4 >>> [snip]
5 >>
6 >> If anything I'd personally prefer the rough opposite of this, in the
7 >> event multiple eclass export the same, have the package manager merge
8 >> them.
9 >>
10 >> e.g. rather than have `inherit cmake xdg` run xdg_src_prepare over
11 >> cmake's, would export:
12 >>
13 >> src_prepare() {
14 >> cmake_src_prepare
15 >> xdg_src_prepare
16 >> }
17 >>
18 >> unless the ebuild redefines it (which I imagine would often be because
19 >> of optional support, e.g. use lua &&, or occasional incompatibilities)
20 >>
21 >> Some ebuilds have special needs, but then there's all those generic
22 >> ebuilds that should stay nearly empty.
23 >
24 > What about transitive inherits? Say, foo.eclass inherits bar.eclass.
25 > Does that imply that the ebuild calls foo_src_prepare
26 > and bar_src_prepare, and the eclass has no way of overriding this? What
27 > if the eclass needs bar_src_prepare called explicitly before or after
28 > its own src_prepare?
29
30 My expectation would be that the ebuild only called depth=1 exported
31 functions and it would be the responsibility of each eclass to call its own
32 inherits. But this becomes a problem with repeated inherits given our
33 phases aren't usually idempotent.
34
35 best,
36 sam

Attachments

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