[Exherbo-dev] Multiple calls to default

Ciaran McCreesh ciaran.mccreesh at googlemail.com
Sat Oct 1 13:53:40 BST 2011

On Fri, 30 Sep 2011 22:27:57 +0200 (CEST)
Elias Pipping <pipping at lavabit.com> wrote:
> I'd like to point out a problem with default().
> [snip]
> What if we require two such exlibs? Then we end up calling default
> twice. That's in general not desirable: In the case of src_prepare
> e.g., if DEFAULT_SRC_PREPARE_PATCHES is non-empty, those patches will
> be applied twice!

This isn't specifically a problem with default. It also happens if
you've got exlibs a and b, each of which use a phase from exlib c.

The reason it happens is that exlibs currently pretty much follow
Gentoo's eclass model. Gentoo's eclass model, as the name sort of
suggests, was designed in a weird way with the idea that ebuilds were
objects that would inherit from various classes in some way (except
that they're not, and they don't). So you could say that this is the
multiple inheritance diamond problem in disguise, so long as you don't
define your terms too precisely.

> What should we do about this?

We've discussed "triggered exlibs" in the past (ticket 1010). The idea
being that rather than or as well as defining phase functions, exlibs
can define things to be run during a particular phase. Presumably some
kind of ordering would be required too.

I'd like to see if people can come up with examples and sanity check
the idea...

Ciaran McCreesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.exherbo.org/pipermail/exherbo-dev/attachments/20111001/94f8f6da/attachment.pgp>

More information about the Exherbo-dev mailing list