public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] IUSE and eclasses
@ 2005-07-07 20:49 Aron Griffis
  2005-07-07 21:07 ` Robin H. Johnson
  2005-07-07 22:13 ` [gentoo-dev] " Mike Frysinger
  0 siblings, 2 replies; 6+ messages in thread
From: Aron Griffis @ 2005-07-07 20:49 UTC (permalink / raw
  To: gentoo-dev

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

Current (possibly unwritten) policy:

  - eclasses declare USE-flags they honor in their own IUSE
  - ebuilds declare USE-flags they honor in their own IUSE
  - ebuilds do not declare USE-flags honored by eclasses they inherit

This policy has been around for a while.  It assumes that all the
flags honored by an eclass are likewise honored by all the ebuilds
that inherit that eclass.

Of course this assumption is false.  An eclass might provide
a function "install_docs" that calls, for example, "use doc".  The
ebuild inheriting the eclass might not call "install_docs".  In that
case, if IUSE="doc" in the eclass, it will be inaccurately displayed
when doing emerge -pv of the package.

The other possibility is to push IUSE declarations completely into the
ebuild.  In that case, it becomes a maintenance headache since an
update to the eclass might necessitate a cascading update to all the
ebuilds.  Hence the current policy, however inaccurate the results
might be.

So right now the policy is broken, but the apparent alternative is
unmanageable.  Ideas?

Regards,
Aron

--
Aron Griffis
Gentoo Linux Developer


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

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

* Re: [gentoo-dev] IUSE and eclasses
  2005-07-07 20:49 [gentoo-dev] IUSE and eclasses Aron Griffis
@ 2005-07-07 21:07 ` Robin H. Johnson
  2005-07-07 21:26   ` Aron Griffis
  2005-07-07 21:39   ` [gentoo-dev] " Michael Sterrett -Mr. Bones.-
  2005-07-07 22:13 ` [gentoo-dev] " Mike Frysinger
  1 sibling, 2 replies; 6+ messages in thread
From: Robin H. Johnson @ 2005-07-07 21:07 UTC (permalink / raw
  To: gentoo-dev

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

On Thu, Jul 07, 2005 at 04:49:13PM -0400, Aron Griffis wrote:
> Current (possibly unwritten) policy:
>   - eclasses declare USE-flags they honor in their own IUSE
>   - ebuilds declare USE-flags they honor in their own IUSE
>   - ebuilds do not declare USE-flags honored by eclasses they inherit

The policy itself is almost fine, it's the checking we need to improve.

The only policy problem case that is where an eclass has a flag
declared, but the ebuild doesn't use that part of the eclass at all, on
purpose.  Either the ebuild/eclass should be changed, or we should have
a way to take flags out of IUSE further down the line.

> So right now the policy is broken, but the apparent alternative is
> unmanageable.  Ideas?
Before changing more, it would be good to have some proper repoman
checks for this stuff.

It should be easily doable, as there are only a few proper ways to use
USE flags in your ebuild. This would also help catch ebuilds/eclasses
not declaring IUSE properly, or having old stuff in IUSE that isn't
actually used anymore.

The only official ways to use USE flags are (at least to my knowledge):
use FLAG
usev FLAG
useq FLAG
use_enable FLAG
use_with FLAG

I don't think I'm missing any here am I?

The only other change is that repoman would need to work on eclasses.

-- 
Robin Hugh Johnson
E-Mail     : robbat2@orbis-terrarum.net
Home Page  : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ#       : 30269588 or 41961639
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

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

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

* Re: [gentoo-dev] IUSE and eclasses
  2005-07-07 21:07 ` Robin H. Johnson
@ 2005-07-07 21:26   ` Aron Griffis
  2005-07-07 21:39   ` [gentoo-dev] " Michael Sterrett -Mr. Bones.-
  1 sibling, 0 replies; 6+ messages in thread
From: Aron Griffis @ 2005-07-07 21:26 UTC (permalink / raw
  To: gentoo-dev

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

Robin H. Johnson wrote:	[Thu Jul 07 2005, 05:07:06PM EDT]
> On Thu, Jul 07, 2005 at 04:49:13PM -0400, Aron Griffis wrote:
> > Current (possibly unwritten) policy:
> >   - eclasses declare USE-flags they honor in their own IUSE
> >   - ebuilds declare USE-flags they honor in their own IUSE
> >   - ebuilds do not declare USE-flags honored by eclasses they inherit
> 
> The policy itself is almost fine, it's the checking we need to improve.
> 
> The only policy problem case that is where an eclass has a flag
> declared, but the ebuild doesn't use that part of the eclass at all, on
> purpose.  Either the ebuild/eclass should be changed, or we should have
> a way to take flags out of IUSE further down the line.

I don't think the last suggestion makes sense.  It adds complexity to
IUSE declarations while increasing the linkage between eclasses and
ebuilds.  It's not much better to remove IUSE flags when they aren't
used than to add them when they are used...

> > So right now the policy is broken, but the apparent alternative is
> > unmanageable.  Ideas?
>
> Before changing more, it would be good to have some proper repoman
> checks for this stuff.

Before changing more what?

> It should be easily doable, as there are only a few proper ways to use
> USE flags in your ebuild. This would also help catch ebuilds/eclasses
> not declaring IUSE properly, or having old stuff in IUSE that isn't
> actually used anymore.
> 
> The only official ways to use USE flags are (at least to my knowledge):
> use FLAG
> usev FLAG
> useq FLAG
> use_enable FLAG
> use_with FLAG

The more complex eclasses have front-ends to USE, for example php and
mozconfig.  I think you will quickly find that it is not that "easily
doable" to catch this stuff in repoman, though it could certainly be
improved.

If you're going to teach repoman to read ebuilds and eclasses, create
a call graph, trace it for USE-flags, and generate what repoman thinks
IUSE should be...  well, suffice it to say I don't see this happening
soon.

Regards,
Aron

--
Aron Griffis
Gentoo Linux Developer


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

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

* [gentoo-dev] Re: IUSE and eclasses
  2005-07-07 21:07 ` Robin H. Johnson
  2005-07-07 21:26   ` Aron Griffis
@ 2005-07-07 21:39   ` Michael Sterrett -Mr. Bones.-
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Sterrett -Mr. Bones.- @ 2005-07-07 21:39 UTC (permalink / raw
  To: gentoo-dev

On Thu, 7 Jul 2005, Robin H. Johnson wrote:

> The only official ways to use USE flags are (at least to my knowledge):
> use FLAG
> usev FLAG
> useq FLAG
> use_enable FLAG
> use_with FLAG
>
> I don't think I'm missing any here am I?

It's a little harder because use $variable is valid and used in ebuilds
as well.

Michael Sterrett
   -Mr. Bones.-
mr_bones_@gentoo.org
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] IUSE and eclasses
  2005-07-07 20:49 [gentoo-dev] IUSE and eclasses Aron Griffis
  2005-07-07 21:07 ` Robin H. Johnson
@ 2005-07-07 22:13 ` Mike Frysinger
  2005-07-08  0:39   ` Aron Griffis
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2005-07-07 22:13 UTC (permalink / raw
  To: gentoo-dev

On Thursday 07 July 2005 04:49 pm, Aron Griffis wrote:
> Current (possibly unwritten) policy:
>
>   - eclasses declare USE-flags they honor in their own IUSE
>   - ebuilds declare USE-flags they honor in their own IUSE
>   - ebuilds do not declare USE-flags honored by eclasses they inherit

err this third one i dont think we do ... eclasses declare their own stuff and 
ebuilds declare their own ... it's a black box like it should be ...

portage was fixed a while ago to trim out duplicated flags in IUSE wasnt it ?

> Of course this assumption is false.  An eclass might provide
> a function "install_docs" that calls, for example, "use doc".  The
> ebuild inheriting the eclass might not call "install_docs".  In that
> case, if IUSE="doc" in the eclass, it will be inaccurately displayed
> when doing emerge -pv of the package.

does this really come up all that often that it needs to be handled ?  seems 
like a lot of effort for little gain ...
-mike
-- 
gentoo-dev@gentoo.org mailing list



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

* Re: [gentoo-dev] IUSE and eclasses
  2005-07-07 22:13 ` [gentoo-dev] " Mike Frysinger
@ 2005-07-08  0:39   ` Aron Griffis
  0 siblings, 0 replies; 6+ messages in thread
From: Aron Griffis @ 2005-07-08  0:39 UTC (permalink / raw
  To: gentoo-dev

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

Vapier wrote:	[Thu Jul 07 2005, 06:13:06PM EDT]
> On Thursday 07 July 2005 04:49 pm, Aron Griffis wrote:
> > Current (possibly unwritten) policy:
> >
> >   - eclasses declare USE-flags they honor in their own IUSE
> >   - ebuilds declare USE-flags they honor in their own IUSE
> >   - ebuilds do not declare USE-flags honored by eclasses they inherit
> 
> err this third one i dont think we do ... eclasses declare their own stuff and 
> ebuilds declare their own ... it's a black box like it should be ...

Sorry, my last bullet point was unclear.  I meant what you're saying.

> > Of course this assumption is false.  An eclass might provide
> > a function "install_docs" that calls, for example, "use doc".  The
> > ebuild inheriting the eclass might not call "install_docs".  In that
> > case, if IUSE="doc" in the eclass, it will be inaccurately displayed
> > when doing emerge -pv of the package.
> 
> does this really come up all that often that it needs to be handled?
> seems like a lot of effort for little gain ...

You're right... it probably doesn't matter.  It's just annoying.

Regards,
Aron

--
Aron Griffis
Gentoo Linux Developer


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

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

end of thread, other threads:[~2005-07-08  0:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-07 20:49 [gentoo-dev] IUSE and eclasses Aron Griffis
2005-07-07 21:07 ` Robin H. Johnson
2005-07-07 21:26   ` Aron Griffis
2005-07-07 21:39   ` [gentoo-dev] " Michael Sterrett -Mr. Bones.-
2005-07-07 22:13 ` [gentoo-dev] " Mike Frysinger
2005-07-08  0:39   ` Aron Griffis

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