public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Making built_with_use die by default with EAPI 2
@ 2008-09-20 16:29 Petteri Räty
  2008-09-20 17:15 ` Alexis Ballier
  2008-09-21 20:57 ` [gentoo-dev] " Steve Long
  0 siblings, 2 replies; 13+ messages in thread
From: Petteri Räty @ 2008-09-20 16:29 UTC (permalink / raw
  To: gentoo-dev

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

When EAPI 2 goes live built_with_use should probably die for most cases. 
Are there valid use cases for built_with_use that are not covered by the 
use deps in EAPI 2? If there are we could add a switch like --noeapi2die 
to it.

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-20 16:29 [gentoo-dev] Making built_with_use die by default with EAPI 2 Petteri Räty
@ 2008-09-20 17:15 ` Alexis Ballier
  2008-09-20 19:05   ` Petteri Räty
  2008-09-21 12:35   ` [gentoo-dev] " David Leverton
  2008-09-21 20:57 ` [gentoo-dev] " Steve Long
  1 sibling, 2 replies; 13+ messages in thread
From: Alexis Ballier @ 2008-09-20 17:15 UTC (permalink / raw
  To: gentoo-dev

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

Hi,

> When EAPI 2 goes live built_with_use should probably die for most
> cases. 

I don't understand here: you mean die like being removed or die like
the die call in an ebuild? If I understood correctly the following it
should be the latter.

> Are there valid use cases for built_with_use that are not
> covered by the use deps in EAPI 2?

I can think of checks like:
- foo is a dep/rdep of bar
- foo has a "plugin like" architecture
- bar will "work" with minimal foo
- most people will expect some features in bar that come with foo's
plugins
- we might want to display warnings for the most useful features
- having useflags in bar for each of foo's useflags doesn't seem wise


Ok that's not really a nice example but I can't think of anything
better at the moment.

By the way, how will the --missing option of built_with_use be handled
by eapi 2?

Alexis.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-20 17:15 ` Alexis Ballier
@ 2008-09-20 19:05   ` Petteri Räty
  2008-09-21  1:14     ` [gentoo-dev] " Ryan Hill
  2008-09-21 12:35   ` [gentoo-dev] " David Leverton
  1 sibling, 1 reply; 13+ messages in thread
From: Petteri Räty @ 2008-09-20 19:05 UTC (permalink / raw
  To: gentoo-dev

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

Alexis Ballier kirjoitti:
> Hi,
> 
>> When EAPI 2 goes live built_with_use should probably die for most
>> cases. 
> 
> I don't understand here: you mean die like being removed or die like
> the die call in an ebuild? If I understood correctly the following it
> should be the latter.
> 

Well we could go with either but if there are valid use cases we need to 
go with the latter.

>> Are there valid use cases for built_with_use that are not
>> covered by the use deps in EAPI 2?
> 
> I can think of checks like:
> - foo is a dep/rdep of bar
> - foo has a "plugin like" architecture
> - bar will "work" with minimal foo
> - most people will expect some features in bar that come with foo's
> plugins
> - we might want to display warnings for the most useful features
> - having useflags in bar for each of foo's useflags doesn't seem wise
> 
> 
> Ok that's not really a nice example but I can't think of anything
> better at the moment.
> 
> By the way, how will the --missing option of built_with_use be handled
> by eapi 2?
> 
> Alexis.

Why should it be any different than what it is now?

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [gentoo-dev]  Re: Making built_with_use die by default with EAPI 2
  2008-09-20 19:05   ` Petteri Räty
@ 2008-09-21  1:14     ` Ryan Hill
  0 siblings, 0 replies; 13+ messages in thread
From: Ryan Hill @ 2008-09-21  1:14 UTC (permalink / raw
  To: gentoo-dev

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

On Sat, 20 Sep 2008 22:05:43 +0300
Petteri Räty <betelgeuse@gentoo.org> wrote:

> Alexis Ballier kirjoitti:
> > Hi,
> > 
> >> When EAPI 2 goes live built_with_use should probably die for most
> >> cases. 
> > 
> > I don't understand here: you mean die like being removed or die like
> > the die call in an ebuild? If I understood correctly the following
> > it should be the latter.
> > 
> 
> Well we could go with either but if there are valid use cases we need
> to go with the latter.
> 
> >> Are there valid use cases for built_with_use that are not
> >> covered by the use deps in EAPI 2?
> > 
> > I can think of checks like:
> > - foo is a dep/rdep of bar
> > - foo has a "plugin like" architecture
> > - bar will "work" with minimal foo
> > - most people will expect some features in bar that come with foo's
> > plugins
> > - we might want to display warnings for the most useful features
> > - having useflags in bar for each of foo's useflags doesn't seem
> > wise
> > 
> > 
> > Ok that's not really a nice example but I can't think of anything
> > better at the moment.
> > 
> > By the way, how will the --missing option of built_with_use be
> > handled by eapi 2?
> > 
> > Alexis.
> 
> Why should it be any different than what it is now?

i still don't get what you're saying.  using built_with_use should die
as in cause the ebuild to exit with an error code?  or that we should
stop using it for checking use flags?

there are plenty of reasons for using built_with_use that have nothing
to do with dependencies.  i use it in the wxwidgets eclass to determine
what possible configuration tuple(s) the user can have installed.
toolchain.eclass uses it for some cross-compile logic.  in many cases
it's simply used to display elog messages conditionally.

so, please don't make it "die" or i will be ":("


-- 
gcc-porting,                                      by design, by neglect
treecleaner,                              for a fact or just for effect
wxwidgets @ gentoo     EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-20 17:15 ` Alexis Ballier
  2008-09-20 19:05   ` Petteri Räty
@ 2008-09-21 12:35   ` David Leverton
  2008-09-22  6:32     ` Vlastimil Babka
  2008-09-22 20:25     ` Petteri Räty
  1 sibling, 2 replies; 13+ messages in thread
From: David Leverton @ 2008-09-21 12:35 UTC (permalink / raw
  To: gentoo-dev

On Saturday 20 September 2008 18:15:27 Alexis Ballier wrote:
> I can think of checks like:
> - foo is a dep/rdep of bar
> - foo has a "plugin like" architecture
> - bar will "work" with minimal foo
> - most people will expect some features in bar that come with foo's
> plugins
> - we might want to display warnings for the most useful features
> - having useflags in bar for each of foo's useflags doesn't seem wise

If you mean something like

    built_with_use cat/foo coolfeature || ewarn "bar will be more useful if 
you rebuild cat/foo with USE=coolfeature"

then you can use

    has_version 'cat/foo[coolfeature]' || ...

instead.

> By the way, how will the --missing option of built_with_use be handled
> by eapi 2?

Not at all.  



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

* [gentoo-dev]  Re: Making built_with_use die by default with EAPI 2
  2008-09-20 16:29 [gentoo-dev] Making built_with_use die by default with EAPI 2 Petteri Räty
  2008-09-20 17:15 ` Alexis Ballier
@ 2008-09-21 20:57 ` Steve Long
  1 sibling, 0 replies; 13+ messages in thread
From: Steve Long @ 2008-09-21 20:57 UTC (permalink / raw
  To: gentoo-dev

Petteri Räty wrote:

> When EAPI 2 goes live built_with_use should probably die for most cases.
> Are there valid use cases for built_with_use that are not covered by the
> use deps in EAPI 2? If there are we could add a switch like --noeapi2die
> to it.
> 
It would be nicer imo if we just added --or-die as a general switch to those
functions we can (and look at sorting out the subshell die thing for -exec
externals.) That way the decision to die or not would be down to the ebuild
author and always explicit from looking at the code.





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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-21 12:35   ` [gentoo-dev] " David Leverton
@ 2008-09-22  6:32     ` Vlastimil Babka
  2008-09-22 20:25     ` Petteri Räty
  1 sibling, 0 replies; 13+ messages in thread
From: Vlastimil Babka @ 2008-09-22  6:32 UTC (permalink / raw
  To: gentoo-dev

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

David Leverton wrote:
> On Saturday 20 September 2008 18:15:27 Alexis Ballier wrote:
>> I can think of checks like:
>> - foo is a dep/rdep of bar
>> - foo has a "plugin like" architecture
>> - bar will "work" with minimal foo
>> - most people will expect some features in bar that come with foo's
>> plugins
>> - we might want to display warnings for the most useful features
>> - having useflags in bar for each of foo's useflags doesn't seem wise
> 
> If you mean something like
> 
>     built_with_use cat/foo coolfeature || ewarn "bar will be more useful if 
> you rebuild cat/foo with USE=coolfeature"
> 
> then you can use
> 
>     has_version 'cat/foo[coolfeature]' || ...
> 
> instead.

Which is much better because it's handled directly with the PM and not
eutils going looking in vdb by hand, right. In that case we should
really encourage this and make built_with_use die or at least emit a qa
warning? The only downside is that use deps don't support the --missing
stuff and we'll see how big problem this turns out to be in practice...

Caster



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-21 12:35   ` [gentoo-dev] " David Leverton
  2008-09-22  6:32     ` Vlastimil Babka
@ 2008-09-22 20:25     ` Petteri Räty
  2008-09-23  9:41       ` Bo Ørsted Andresen
  1 sibling, 1 reply; 13+ messages in thread
From: Petteri Räty @ 2008-09-22 20:25 UTC (permalink / raw
  To: gentoo-dev

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

David Leverton kirjoitti:
> On Saturday 20 September 2008 18:15:27 Alexis Ballier wrote:
>> I can think of checks like:
>> - foo is a dep/rdep of bar
>> - foo has a "plugin like" architecture
>> - bar will "work" with minimal foo
>> - most people will expect some features in bar that come with foo's
>> plugins
>> - we might want to display warnings for the most useful features
>> - having useflags in bar for each of foo's useflags doesn't seem wise
> 
> If you mean something like
> 
>     built_with_use cat/foo coolfeature || ewarn "bar will be more useful if 
> you rebuild cat/foo with USE=coolfeature"
> 
> then you can use
> 
>     has_version 'cat/foo[coolfeature]' || ...
> 
> instead.
> 

What does this report if cat/foo does not have coolfeature use flag in 
some version? Meaning can this support cases which need --missing true.

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-22 20:25     ` Petteri Räty
@ 2008-09-23  9:41       ` Bo Ørsted Andresen
  2008-09-23 20:33         ` Petteri Räty
  0 siblings, 1 reply; 13+ messages in thread
From: Bo Ørsted Andresen @ 2008-09-23  9:41 UTC (permalink / raw
  To: gentoo-dev

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

On Monday 22 September 2008 22:25:20 Petteri Räty wrote:
> > If you mean something like
> >
> >     built_with_use cat/foo coolfeature || ewarn "bar will be more useful if you rebuild cat/foo with USE=coolfeature" 
> >
> > then you can use
> >
> >     has_version 'cat/foo[coolfeature]' || ...
> >
> > instead.
>
> What does this report if cat/foo does not have coolfeature use flag in
> some version? Meaning can this support cases which need --missing true.

False. If for instance coolfeature was made optional in >=pv you can use logic
like:

if has_version '>=cat/foo-pv' && ! has_version 'cat/foo[coolfeature]'; then
   ewarn '...'
fi

-- 
Bo Andresen

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-23  9:41       ` Bo Ørsted Andresen
@ 2008-09-23 20:33         ` Petteri Räty
  2008-09-23 20:44           ` Alexis Ballier
  0 siblings, 1 reply; 13+ messages in thread
From: Petteri Räty @ 2008-09-23 20:33 UTC (permalink / raw
  To: gentoo-dev

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

Bo Ørsted Andresen kirjoitti:
> On Monday 22 September 2008 22:25:20 Petteri Räty wrote:
>>> If you mean something like
>>>
>>>     built_with_use cat/foo coolfeature || ewarn "bar will be more useful if you rebuild cat/foo with USE=coolfeature" 
>>>
>>> then you can use
>>>
>>>     has_version 'cat/foo[coolfeature]' || ...
>>>
>>> instead.
>> What does this report if cat/foo does not have coolfeature use flag in
>> some version? Meaning can this support cases which need --missing true.
> 
> False. If for instance coolfeature was made optional in >=pv you can use logic
> like:
> 
> if has_version '>=cat/foo-pv' && ! has_version 'cat/foo[coolfeature]'; then
>    ewarn '...'
> fi
> 

I think this should cover all the current functionality with 
built_with_use. So when before EAPI 2 goes live I will commit:

23:29 < zmedico> has EAPI 0 1 || die "build_with_use is only allowed in 
EAPI 0 or 1"

Unless someone objects with good reasoning of course.

Regards,
Petteri



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-23 20:33         ` Petteri Räty
@ 2008-09-23 20:44           ` Alexis Ballier
  2008-09-23 21:00             ` Petteri Räty
  2008-09-23 23:09             ` Bo Ørsted Andresen
  0 siblings, 2 replies; 13+ messages in thread
From: Alexis Ballier @ 2008-09-23 20:44 UTC (permalink / raw
  To: gentoo-dev

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

On Tue, 23 Sep 2008 23:33:44 +0300
Petteri Räty <betelgeuse@gentoo.org> wrote:

> Bo Ørsted Andresen kirjoitti:
> > On Monday 22 September 2008 22:25:20 Petteri Räty wrote:
> >>> If you mean something like
> >>>
> >>>     built_with_use cat/foo coolfeature || ewarn "bar will be more
> >>> useful if you rebuild cat/foo with USE=coolfeature" 
> >>>
> >>> then you can use
> >>>
> >>>     has_version 'cat/foo[coolfeature]' || ...
> >>>
> >>> instead.
> >> What does this report if cat/foo does not have coolfeature use
> >> flag in some version? Meaning can this support cases which need
> >> --missing true.
> > 
> > False. If for instance coolfeature was made optional in >=pv you
> > can use logic like:
> > 
> > if has_version '>=cat/foo-pv' && ! has_version
> > 'cat/foo[coolfeature]'; then ewarn '...'
> > fi
> > 
> 
> I think this should cover all the current functionality with 
> built_with_use. 

This is just an ugly hack. Think about a package that has coolfeature
useflag removed and enabled by default for a couple of releases because
it wouldn't build without it and once upstream sorted out everything
the useflag is coming back. Missing useflags that are assumed to be
enabled have nothing to do with the package version being greater than
a given number.

I would *really* prefer having big warnings when using built_with_use
in EAPI 2; that way we can see how things are in practice and then
maybe make built_with_use die for a later eapi or once all the tree is
converted to eapi 2 remove it.

Alexis.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-23 20:44           ` Alexis Ballier
@ 2008-09-23 21:00             ` Petteri Räty
  2008-09-23 23:09             ` Bo Ørsted Andresen
  1 sibling, 0 replies; 13+ messages in thread
From: Petteri Räty @ 2008-09-23 21:00 UTC (permalink / raw
  To: gentoo-dev

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

Alexis Ballier kirjoitti:
> On Tue, 23 Sep 2008 23:33:44 +0300
> Petteri Räty <betelgeuse@gentoo.org> wrote:
> 
>> Bo Ørsted Andresen kirjoitti:
>>> On Monday 22 September 2008 22:25:20 Petteri Räty wrote:
>>>>> If you mean something like
>>>>>
>>>>>     built_with_use cat/foo coolfeature || ewarn "bar will be more
>>>>> useful if you rebuild cat/foo with USE=coolfeature" 
>>>>>
>>>>> then you can use
>>>>>
>>>>>     has_version 'cat/foo[coolfeature]' || ...
>>>>>
>>>>> instead.
>>>> What does this report if cat/foo does not have coolfeature use
>>>> flag in some version? Meaning can this support cases which need
>>>> --missing true.
>>> False. If for instance coolfeature was made optional in >=pv you
>>> can use logic like:
>>>
>>> if has_version '>=cat/foo-pv' && ! has_version
>>> 'cat/foo[coolfeature]'; then ewarn '...'
>>> fi
>>>
>> I think this should cover all the current functionality with 
>> built_with_use. 
> 
> This is just an ugly hack. Think about a package that has coolfeature
> useflag removed and enabled by default for a couple of releases because
> it wouldn't build without it and once upstream sorted out everything
> the useflag is coming back. Missing useflags that are assumed to be
> enabled have nothing to do with the package version being greater than
> a given number.
> 
> I would *really* prefer having big warnings when using built_with_use
> in EAPI 2; that way we can see how things are in practice and then
> maybe make built_with_use die for a later eapi or once all the tree is
> converted to eapi 2 remove it.
> 
> Alexis.

Well we could replace the die with eerror but eventually we should get 
rid of vdb access directly by ebuilds. Maybe the next EAPI should add 
something similar to portageq as an abstraction layer.

betelgeuse@pena /usr/portage/eclass $ portageq metadata / installed 
$(portageq match / sys-devel/gcc:4.3) USE
elibc_glibc gcj kernel_linux libffi openmp userland_GNU x86

Regards,
Petteri


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* Re: [gentoo-dev] Making built_with_use die by default with EAPI 2
  2008-09-23 20:44           ` Alexis Ballier
  2008-09-23 21:00             ` Petteri Räty
@ 2008-09-23 23:09             ` Bo Ørsted Andresen
  1 sibling, 0 replies; 13+ messages in thread
From: Bo Ørsted Andresen @ 2008-09-23 23:09 UTC (permalink / raw
  To: gentoo-dev

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

On Tuesday 23 September 2008 22:44:35 Alexis Ballier wrote:
> > > False. If for instance coolfeature was made optional in >=pv you
> > > can use logic like:
> > >
> > > if has_version '>=cat/foo-pv' && ! has_version
> > > 'cat/foo[coolfeature]'; then ewarn '...'
> > > fi
> >
> > I think this should cover all the current functionality with
> > built_with_use.
>
> This is just an ugly hack. Think about a package that has coolfeature
> useflag removed and enabled by default for a couple of releases because
> it wouldn't build without it and once upstream sorted out everything
> the useflag is coming back. Missing useflags that are assumed to be
> enabled have nothing to do with the package version being greater than
> a given number.

If it is needed that often we should add support for stating the state of the 
use flag in dependencies. With the currently planned eapi 2 you get 
dependencies such as:

DEPEND="|| ( >=cat/foo-pv[coolfeature] <cat-foo-pv )"

too. Doing the same with has_version is only consistent with that. If we add 
support for it in dependency syntax it will work with has_version too...

-- 
Bo Andresen

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2008-09-23 23:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-20 16:29 [gentoo-dev] Making built_with_use die by default with EAPI 2 Petteri Räty
2008-09-20 17:15 ` Alexis Ballier
2008-09-20 19:05   ` Petteri Räty
2008-09-21  1:14     ` [gentoo-dev] " Ryan Hill
2008-09-21 12:35   ` [gentoo-dev] " David Leverton
2008-09-22  6:32     ` Vlastimil Babka
2008-09-22 20:25     ` Petteri Räty
2008-09-23  9:41       ` Bo Ørsted Andresen
2008-09-23 20:33         ` Petteri Räty
2008-09-23 20:44           ` Alexis Ballier
2008-09-23 21:00             ` Petteri Räty
2008-09-23 23:09             ` Bo Ørsted Andresen
2008-09-21 20:57 ` [gentoo-dev] " Steve Long

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