public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: calling all eclass phase functions by default
@ 2014-08-16 21:54 William Hubbs
  2014-08-16 22:32 ` Kent Fredric
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: William Hubbs @ 2014-08-16 21:54 UTC (permalink / raw
  To: gentoo development

[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]

All,

there is an ongoing discussion about how we handle eclass phase
functions by default [1].

Currently, EXPORT_FUNCTIONS is called in eclasses, and because of the
way this works, the phase function that is exported last in the chain of
inherited eclasses is the one that is called for a given phase,
overriding the PMS default phase function.

The initial proposal is to change this behaviour so that the PMS default
phase functions call all matching phase functions from inherited
eclasses in sequence.

For example:

- your ebuild inherits foo and bar and each of them have src_unpack
  functions. With this new behaviour, the default src_unpack would run
  foo_src_unpack, bar_src_unpack, then perform its own actions.

I strongly oppose this change, because I feel it will make our
entire tree very unpredictable at best. I realize this might eliminate
boilerplating from our tree. Weighing that against the possible
ramifications in this big of a change in automagic behaviour, I think
the cost is much higher than the gain.

I am also not very comfortable with our current state, because it has
a lot of uncertainty in terms of how the eclass phase functions are
called.

My counter proposal to this is that we stop calling eclass phase
functions automatically, and to minimize the amount of boilerplating
  we would have to do, we use a variable, such as ECLASS_PHASES  which
  would be defined at the ebuild level and contain a list of the eclass
  phase functions we want to run automatically.

Going back to my previous example, say your ebuild does the following:

-- code begins here --

inherit foo bar

# Foo and bar both have src_unpack and src_install functions.
# we want foo's src_unpack and bar's src_install:

ECLASS_PHASES="foo_src_unpack
	bar_src_install"

-- code ends here ---

If ECLASS_PHASES is undefined, I think the default should be to not run
the eclass phase functions.

Yes, this means there is some boilerplating. However, there are some
strong advantages:

- this is no longer dependent on order of inheritance.
- The ebuild author knows exactly which eclass phase functions will
  be run.

Thoughts?

William

[1] https://bugs.gentoo.org/show_bugs.cgi?id=516014

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2014-08-19  7:02 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-08-19  7:02                     ` Sergey Popov
2014-08-18 14:13             ` Rich Freeman
2014-08-19  6:58             ` Sergey Popov

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