From: hasufell <hasufell@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] rfc: calling all eclass phase functions by default
Date: Mon, 18 Aug 2014 20:23:35 +0000 [thread overview]
Message-ID: <53F260C7.30302@gentoo.org> (raw)
In-Reply-To: <d2221097-0cdf-42a3-a183-a7ef3e399c8c@email.android.com>
Chris Reffett:
>
>
> On August 18, 2014 11:11:56 AM EDT, "Michał Górny" <mgorny@gentoo.org> wrote:
>> Dnia 2014-08-18, o godz. 09:22:46
>> Chris Reffett <creffett@gentoo.org> napisał(a):
>>
>>> On 8/18/2014 8:56 AM, hasufell wrote:
>>>> Almost forgot, of course this does not work if you expect
>>>> unpacker_src_unpacker() to run:
>>>> inherit unpacker games base
>>>>
>>>> as well as
>>>> inherit unpacker base games
>>>>
>>>> however
>>>> inherit games unpacker base
>>>>
>>>> will work.
>>>>
>>>> And now... guess why the games herd made it a policy to always
>> inherit
>>>> games.eclass last. Because of the unpredictability of eclasses and
>> that
>>>> they may randomly add exported phase functions. It's a bit
>> paranoid, but
>>>> understandable, since we don't have any real rules here.
>>>>
>>>> So in the end 3 eclasses all tell you "inherit me last! really!".
>> Good
>>>> luck with figuring out how to make a gnome game with python and
>> multilib
>>>> support work together. I can predict the days such a review would
>> take
>>>> in #gentoo-sunrise. Not less than 3.
>>>>
>>> Would it be feasible to add a repoman check for situations like this,
>>> where the behavior of a phase is dependent on inherit order? If so,
>> it
>>> seems reasonable to me to require explicit calls to eclass functions
>> in
>>> these cases to make it clear what's being called when.
>>
>> Right now, we have no kind of repoman for eclasses. If you have time to
>> work on such a thing, please do. Otherwise, all we can do is put more
>> checks in ebuilds but that triggers the warning for the wrong people...
>
> I was thinking more ebuild-side. Example: my ebuild inherits both cmake-utils and games eclasses, and I don't explicitly define src_compile, repoman full could pop up a warning like "src_compile is ambiguous between cmake-utils_src_compile and games_src_compile, please explicitly define this phase and call the appropriate eclass function." I imagine that this would pop up a lot of warnings, but I feel like it would improve readability and make it explicit what should be going on where. I concede that it could make a lot more boilerplate code in ebuilds, so that's a potential issue, mostly just throwing out an idea here.
>
> Chris Reffett
>
I don't want to code against warning tools, but against a reliable API.
That said, EXPORT_FUNCTIONS in eclasses should be definite and
non-recursive. Currently, people have to track down the actual exported
functions themselves through the endless list of indirect inheritance
which may:
* randomly change
* be highly dependant on the inherit order in the eclass and of those
indirectly inheriting others...
So to pick up the proposal again, I think this could make sense:
* disable exported functions from indirectly inherited eclasses
* have eclass authors do these things explicitly, so they have to export
ALL functions themselves and may have to adjust their eclasses, as in:
games_src_prepare() { base_src_prepare ; } (I know that base.eclass is
deprecated, this is an example)
* include the exported functions automatically in the generated eclass
manpages
next prev parent reply other threads:[~2014-08-18 20:23 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-16 21:54 [gentoo-dev] rfc: calling all eclass phase functions by default William Hubbs
2014-08-16 22:32 ` Kent Fredric
2014-08-16 23:01 ` William Hubbs
2014-08-17 3:11 ` [gentoo-dev] " Duncan
2014-08-17 7:03 ` [gentoo-dev] " Michał Górny
2014-08-17 8:49 ` Kent Fredric
2014-08-17 7:06 ` "Paweł Hajdan, Jr."
2014-08-17 7:18 ` Michał Górny
2014-08-17 7:23 ` "Paweł Hajdan, Jr."
2014-08-16 22:54 ` Michał Górny
2014-08-16 23:30 ` William Hubbs
2014-08-17 6:54 ` Ulrich Mueller
2014-08-17 12:24 ` Rich Freeman
2014-08-18 8:54 ` Sergey Popov
2014-08-18 10:44 ` Rich Freeman
2014-08-18 12:21 ` Sergey Popov
2014-08-18 13:27 ` Rich Freeman
2014-08-18 12:04 ` hasufell
2014-08-18 12:19 ` Sergey Popov
2014-08-18 12:30 ` hasufell
2014-08-18 12:41 ` hasufell
2014-08-18 12:52 ` Michał Górny
2014-08-18 12:56 ` hasufell
2014-08-18 13:22 ` Chris Reffett
2014-08-18 13:27 ` hasufell
2014-08-18 15:11 ` Michał Górny
2014-08-18 19:37 ` Chris Reffett
2014-08-18 20:08 ` Michał Górny
2014-08-18 20:23 ` hasufell [this message]
2014-08-19 7:02 ` Sergey Popov
2014-08-18 14:13 ` Rich Freeman
2014-08-19 6:58 ` Sergey Popov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F260C7.30302@gentoo.org \
--to=hasufell@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox