public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: William Hubbs <williamh@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: mgorny@gentoo.org
Subject: Re: [gentoo-dev] rfc: calling all eclass phase functions by default
Date: Sat, 16 Aug 2014 18:30:30 -0500	[thread overview]
Message-ID: <20140816233030.GB11181@linux1> (raw)
In-Reply-To: <20140817005417.5106da3c@pomiot.lan>

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

On Sun, Aug 17, 2014 at 12:54:17AM +0200, Michał Górny wrote:
> Dnia 2014-08-16, o godz. 16:54:28
> William Hubbs <williamh@gentoo.org> napisał(a):
> 
> > 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.
> 
> Why doesn't it call default_src_unpack too?

In the original proposal, the loop that ran foo_src_unpack,
bar_src_unpack, etc would be part of default_src_unpack.

> > 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.
> 
> 'Unpredictable' is very lightly said. 'Complete mayhem' seems much more
> appropriate.
> 
> Right now, finding proper phase functions may be a bit hard due to
> indirect inherits. Imagine all the fun of debugging phase functions
> when every single indirect inherits adds to the stack. I don't want
> even to discuss the issue of ordering them all.

Agreed. It definitely would be a mess.

> > 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.
> 
> That is not really a problem of PMS behavior but a problem with
> the eclasses. If eclasses were done at least semi-reasonably, you
> would be able to easily guess which phase functions are exported by
> which eclass.

I'm all ears as they say; feel free to start a new thread on redesigning
our eclasses. I have no idea how they could be done differently
to make this easier.

> 
> > 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 ---
> 
> And how is this exactly different than:
> 
>   src_unpack() { foo_src_unpack; }
>   src_install() { bar_src_install; }
> 
> forced by your previous idea? As I see it, it's just a redundant way of
> doing the same thing. A few bytes shorter maybe, at the cost of having
> to control and consider another variable.
 
 I'm not arguing that either.

> What happens if ebuild specifies both ECLASS_PHASES="foo_src_unpack"
> and explicit src_unpack()?

The src_unpack() in the ebuild wins.

> That said, I suggest you focus your efforts on solving the real issue
> -- that is, fixing the eclasses -- rather than trying to shoehorn
> an ugly workaround into PMS.

Like I said above, I'm all ears; start a new thread about how the eclasses
can be fixed.

William


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

  reply	other threads:[~2014-08-16 23:30 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 [this message]
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

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=20140816233030.GB11181@linux1 \
    --to=williamh@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@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