public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
@ 2017-08-30  9:06 Michał Górny
  2017-08-30 17:48 ` Zac Medico
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2017-08-30  9:06 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

The value of get_libdir depends on the profile, and so it is not useful
for dependency calculations. Furthermore, it seems that Portage does
not handle defining it in global scope well due to EAPI checking magic.
Ban it completely where it is defined as EAPI function to let developers
catch their mistakes early rather than see them as 'command not found'
errors during dependency calculation / cache updates.

Bug: https://bugs.gentoo.org/629010
---
 bin/ebuild.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a400ef72e..f1ac3f278 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -66,6 +66,7 @@ else
 		use useq usev use_with use_enable"
 	___eapi_has_usex && funcs+=" usex"
 	___eapi_has_in_iuse && funcs+=" in_iuse"
+	___eapi_has_get_libdir && funcs+=" get_libdir"
 	# These functions die because calls to them during the "depend" phase
 	# are considered to be severe QA violations.
 	funcs+=" best_version has_version portageq"
-- 
2.14.1



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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30  9:06 [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope Michał Górny
@ 2017-08-30 17:48 ` Zac Medico
  2017-08-30 17:52   ` Ulrich Mueller
  2017-08-30 20:31   ` Michał Górny
  0 siblings, 2 replies; 9+ messages in thread
From: Zac Medico @ 2017-08-30 17:48 UTC (permalink / raw
  To: gentoo-portage-dev, Michał Górny

On 08/30/2017 02:06 AM, Michał Górny wrote:
> The value of get_libdir depends on the profile, and so it is not useful
> for dependency calculations. Furthermore, it seems that Portage does
> not handle defining it in global scope well due to EAPI checking magic.
> Ban it completely where it is defined as EAPI function to let developers
> catch their mistakes early rather than see them as 'command not found'
> errors during dependency calculation / cache updates.
> 
> Bug: https://bugs.gentoo.org/629010
> ---
>  bin/ebuild.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> index a400ef72e..f1ac3f278 100755
> --- a/bin/ebuild.sh
> +++ b/bin/ebuild.sh
> @@ -66,6 +66,7 @@ else
>  		use useq usev use_with use_enable"
>  	___eapi_has_usex && funcs+=" usex"
>  	___eapi_has_in_iuse && funcs+=" in_iuse"
> +	___eapi_has_get_libdir && funcs+=" get_libdir"
>  	# These functions die because calls to them during the "depend" phase
>  	# are considered to be severe QA violations.
>  	funcs+=" best_version has_version portageq"
> 

It's possible that there are working ebuilds that call get_libdir in
global scope. Have we done an analysis of the ebuilds in the gentoo
repository? Obviously, it would be safer to call eqawarn.
-- 
Thanks,
Zac


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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 17:48 ` Zac Medico
@ 2017-08-30 17:52   ` Ulrich Mueller
  2017-08-30 18:00     ` Zac Medico
  2017-08-30 20:31   ` Michał Górny
  1 sibling, 1 reply; 9+ messages in thread
From: Ulrich Mueller @ 2017-08-30 17:52 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

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

>>>>> On Wed, 30 Aug 2017, Zac Medico wrote:

> It's possible that there are working ebuilds that call get_libdir in
> global scope.

How could that be possible when get_libdir() is defined in
phase-helpers.sh?

> Have we done an analysis of the ebuilds in the gentoo repository?
> Obviously, it would be safer to call eqawarn.

Ulrich

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

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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 17:52   ` Ulrich Mueller
@ 2017-08-30 18:00     ` Zac Medico
  0 siblings, 0 replies; 9+ messages in thread
From: Zac Medico @ 2017-08-30 18:00 UTC (permalink / raw
  To: gentoo-portage-dev, Ulrich Mueller; +Cc: Michał Górny

On 08/30/2017 10:52 AM, Ulrich Mueller wrote:
>>>>>> On Wed, 30 Aug 2017, Zac Medico wrote:
> 
>> It's possible that there are working ebuilds that call get_libdir in
>> global scope.
> 
> How could that be possible when get_libdir() is defined in
> phase-helpers.sh?

During an "normal" ebuild phase, ebuild.sh will source phase-helpers.sh
before it sources the ebuild:

if [[ $EBUILD_PHASE != depend ]] ; then
	source "${PORTAGE_BIN_PATH}/phase-functions.sh" || die
	source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || die
	source "${PORTAGE_BIN_PATH}/phase-helpers.sh" || die
	source "${PORTAGE_BIN_PATH}/bashrc-functions.sh" || die
else
-- 
Thanks,
Zac


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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 17:48 ` Zac Medico
  2017-08-30 17:52   ` Ulrich Mueller
@ 2017-08-30 20:31   ` Michał Górny
  2017-08-30 20:35     ` Zac Medico
  1 sibling, 1 reply; 9+ messages in thread
From: Michał Górny @ 2017-08-30 20:31 UTC (permalink / raw
  To: gentoo-portage-dev

W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
napisał:
> On 08/30/2017 02:06 AM, Michał Górny wrote:
> > The value of get_libdir depends on the profile, and so it is not useful
> > for dependency calculations. Furthermore, it seems that Portage does
> > not handle defining it in global scope well due to EAPI checking magic.
> > Ban it completely where it is defined as EAPI function to let developers
> > catch their mistakes early rather than see them as 'command not found'
> > errors during dependency calculation / cache updates.
> > 
> > Bug: https://bugs.gentoo.org/629010
> > ---
> >  bin/ebuild.sh | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> > index a400ef72e..f1ac3f278 100755
> > --- a/bin/ebuild.sh
> > +++ b/bin/ebuild.sh
> > @@ -66,6 +66,7 @@ else
> >  		use useq usev use_with use_enable"
> >  	___eapi_has_usex && funcs+=" usex"
> >  	___eapi_has_in_iuse && funcs+=" in_iuse"
> > +	___eapi_has_get_libdir && funcs+=" get_libdir"
> >  	# These functions die because calls to them during the "depend" phase
> >  	# are considered to be severe QA violations.
> >  	funcs+=" best_version has_version portageq"
> > 
> 
> It's possible that there are working ebuilds that call get_libdir in
> global scope. Have we done an analysis of the ebuilds in the gentoo
> repository? Obviously, it would be safer to call eqawarn.

If there were any (more), we'd have caught them during cache regen,
wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
got a bug report almost immediately.

-- 
Best regards,
Michał Górny



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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 20:31   ` Michał Górny
@ 2017-08-30 20:35     ` Zac Medico
  2017-08-30 20:45       ` Michał Górny
  0 siblings, 1 reply; 9+ messages in thread
From: Zac Medico @ 2017-08-30 20:35 UTC (permalink / raw
  To: gentoo-portage-dev, Michał Górny

On 08/30/2017 01:31 PM, Michał Górny wrote:
> W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
> napisał:
>> On 08/30/2017 02:06 AM, Michał Górny wrote:
>>> The value of get_libdir depends on the profile, and so it is not useful
>>> for dependency calculations. Furthermore, it seems that Portage does
>>> not handle defining it in global scope well due to EAPI checking magic.
>>> Ban it completely where it is defined as EAPI function to let developers
>>> catch their mistakes early rather than see them as 'command not found'
>>> errors during dependency calculation / cache updates.
>>>
>>> Bug: https://bugs.gentoo.org/629010
>>> ---
>>>  bin/ebuild.sh | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/bin/ebuild.sh b/bin/ebuild.sh
>>> index a400ef72e..f1ac3f278 100755
>>> --- a/bin/ebuild.sh
>>> +++ b/bin/ebuild.sh
>>> @@ -66,6 +66,7 @@ else
>>>  		use useq usev use_with use_enable"
>>>  	___eapi_has_usex && funcs+=" usex"
>>>  	___eapi_has_in_iuse && funcs+=" in_iuse"
>>> +	___eapi_has_get_libdir && funcs+=" get_libdir"
>>>  	# These functions die because calls to them during the "depend" phase
>>>  	# are considered to be severe QA violations.
>>>  	funcs+=" best_version has_version portageq"
>>>
>>
>> It's possible that there are working ebuilds that call get_libdir in
>> global scope. Have we done an analysis of the ebuilds in the gentoo
>> repository? Obviously, it would be safer to call eqawarn.
> 
> If there were any (more), we'd have caught them during cache regen,
> wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
> got a bug report almost immediately.

We'll only catch it during cache regen if we delete all of the previous
cache, forcing all of the ebuilds to be sourced again. If all ebuilds in
the gentoo tree are compliant, the I think that's good enough for us to
die here.
-- 
Thanks,
Zac


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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 20:35     ` Zac Medico
@ 2017-08-30 20:45       ` Michał Górny
  2017-08-31  6:36         ` Zac Medico
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2017-08-30 20:45 UTC (permalink / raw
  To: gentoo-portage-dev

W dniu śro, 30.08.2017 o godzinie 13∶35 -0700, użytkownik Zac Medico
napisał:
> On 08/30/2017 01:31 PM, Michał Górny wrote:
> > W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
> > napisał:
> > > On 08/30/2017 02:06 AM, Michał Górny wrote:
> > > > The value of get_libdir depends on the profile, and so it is not useful
> > > > for dependency calculations. Furthermore, it seems that Portage does
> > > > not handle defining it in global scope well due to EAPI checking magic.
> > > > Ban it completely where it is defined as EAPI function to let developers
> > > > catch their mistakes early rather than see them as 'command not found'
> > > > errors during dependency calculation / cache updates.
> > > > 
> > > > Bug: https://bugs.gentoo.org/629010
> > > > ---
> > > >  bin/ebuild.sh | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> > > > index a400ef72e..f1ac3f278 100755
> > > > --- a/bin/ebuild.sh
> > > > +++ b/bin/ebuild.sh
> > > > @@ -66,6 +66,7 @@ else
> > > >  		use useq usev use_with use_enable"
> > > >  	___eapi_has_usex && funcs+=" usex"
> > > >  	___eapi_has_in_iuse && funcs+=" in_iuse"
> > > > +	___eapi_has_get_libdir && funcs+=" get_libdir"
> > > >  	# These functions die because calls to them during the "depend" phase
> > > >  	# are considered to be severe QA violations.
> > > >  	funcs+=" best_version has_version portageq"
> > > > 
> > > 
> > > It's possible that there are working ebuilds that call get_libdir in
> > > global scope. Have we done an analysis of the ebuilds in the gentoo
> > > repository? Obviously, it would be safer to call eqawarn.
> > 
> > If there were any (more), we'd have caught them during cache regen,
> > wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
> > got a bug report almost immediately.
> 
> We'll only catch it during cache regen if we delete all of the previous
> cache, forcing all of the ebuilds to be sourced again. If all ebuilds in
> the gentoo tree are compliant, the I think that's good enough for us to
> die here.

I'm pretty sure all of them are. However, if someone has resources to
spare, I'd appreciate running a full regen with the patch to confirm.

-- 
Best regards,
Michał Górny



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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-30 20:45       ` Michał Górny
@ 2017-08-31  6:36         ` Zac Medico
  2017-08-31 14:07           ` Michał Górny
  0 siblings, 1 reply; 9+ messages in thread
From: Zac Medico @ 2017-08-31  6:36 UTC (permalink / raw
  To: gentoo-portage-dev, Michał Górny


[-- Attachment #1.1: Type: text/plain, Size: 2356 bytes --]

On 08/30/2017 01:45 PM, Michał Górny wrote:
> W dniu śro, 30.08.2017 o godzinie 13∶35 -0700, użytkownik Zac Medico
> napisał:
>> On 08/30/2017 01:31 PM, Michał Górny wrote:
>>> W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
>>> napisał:
>>>> On 08/30/2017 02:06 AM, Michał Górny wrote:
>>>>> The value of get_libdir depends on the profile, and so it is not useful
>>>>> for dependency calculations. Furthermore, it seems that Portage does
>>>>> not handle defining it in global scope well due to EAPI checking magic.
>>>>> Ban it completely where it is defined as EAPI function to let developers
>>>>> catch their mistakes early rather than see them as 'command not found'
>>>>> errors during dependency calculation / cache updates.
>>>>>
>>>>> Bug: https://bugs.gentoo.org/629010
>>>>> ---
>>>>>  bin/ebuild.sh | 1 +
>>>>>  1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/bin/ebuild.sh b/bin/ebuild.sh
>>>>> index a400ef72e..f1ac3f278 100755
>>>>> --- a/bin/ebuild.sh
>>>>> +++ b/bin/ebuild.sh
>>>>> @@ -66,6 +66,7 @@ else
>>>>>  		use useq usev use_with use_enable"
>>>>>  	___eapi_has_usex && funcs+=" usex"
>>>>>  	___eapi_has_in_iuse && funcs+=" in_iuse"
>>>>> +	___eapi_has_get_libdir && funcs+=" get_libdir"
>>>>>  	# These functions die because calls to them during the "depend" phase
>>>>>  	# are considered to be severe QA violations.
>>>>>  	funcs+=" best_version has_version portageq"
>>>>>
>>>>
>>>> It's possible that there are working ebuilds that call get_libdir in
>>>> global scope. Have we done an analysis of the ebuilds in the gentoo
>>>> repository? Obviously, it would be safer to call eqawarn.
>>>
>>> If there were any (more), we'd have caught them during cache regen,
>>> wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
>>> got a bug report almost immediately.
>>
>> We'll only catch it during cache regen if we delete all of the previous
>> cache, forcing all of the ebuilds to be sourced again. If all ebuilds in
>> the gentoo tree are compliant, the I think that's good enough for us to
>> die here.
> 
> I'm pretty sure all of them are. However, if someone has resources to
> spare, I'd appreciate running a full regen with the patch to confirm.

Confirmed. Please merge the patch.
-- 
Thanks,
Zac


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

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

* Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
  2017-08-31  6:36         ` Zac Medico
@ 2017-08-31 14:07           ` Michał Górny
  0 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2017-08-31 14:07 UTC (permalink / raw
  To: gentoo-portage-dev

W dniu śro, 30.08.2017 o godzinie 23∶36 -0700, użytkownik Zac Medico
napisał:
> On 08/30/2017 01:45 PM, Michał Górny wrote:
> > W dniu śro, 30.08.2017 o godzinie 13∶35 -0700, użytkownik Zac Medico
> > napisał:
> > > On 08/30/2017 01:31 PM, Michał Górny wrote:
> > > > W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
> > > > napisał:
> > > > > On 08/30/2017 02:06 AM, Michał Górny wrote:
> > > > > > The value of get_libdir depends on the profile, and so it is not useful
> > > > > > for dependency calculations. Furthermore, it seems that Portage does
> > > > > > not handle defining it in global scope well due to EAPI checking magic.
> > > > > > Ban it completely where it is defined as EAPI function to let developers
> > > > > > catch their mistakes early rather than see them as 'command not found'
> > > > > > errors during dependency calculation / cache updates.
> > > > > > 
> > > > > > Bug: https://bugs.gentoo.org/629010
> > > > > > ---
> > > > > >  bin/ebuild.sh | 1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > > 
> > > > > > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> > > > > > index a400ef72e..f1ac3f278 100755
> > > > > > --- a/bin/ebuild.sh
> > > > > > +++ b/bin/ebuild.sh
> > > > > > @@ -66,6 +66,7 @@ else
> > > > > >  		use useq usev use_with use_enable"
> > > > > >  	___eapi_has_usex && funcs+=" usex"
> > > > > >  	___eapi_has_in_iuse && funcs+=" in_iuse"
> > > > > > +	___eapi_has_get_libdir && funcs+=" get_libdir"
> > > > > >  	# These functions die because calls to them during the "depend" phase
> > > > > >  	# are considered to be severe QA violations.
> > > > > >  	funcs+=" best_version has_version portageq"
> > > > > > 
> > > > > 
> > > > > It's possible that there are working ebuilds that call get_libdir in
> > > > > global scope. Have we done an analysis of the ebuilds in the gentoo
> > > > > repository? Obviously, it would be safer to call eqawarn.
> > > > 
> > > > If there were any (more), we'd have caught them during cache regen,
> > > > wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
> > > > got a bug report almost immediately.
> > > 
> > > We'll only catch it during cache regen if we delete all of the previous
> > > cache, forcing all of the ebuilds to be sourced again. If all ebuilds in
> > > the gentoo tree are compliant, the I think that's good enough for us to
> > > die here.
> > 
> > I'm pretty sure all of them are. However, if someone has resources to
> > spare, I'd appreciate running a full regen with the patch to confirm.
> 
> Confirmed. Please merge the patch.

Thanks. Merged now.

-- 
Best regards,
Michał Górny



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

end of thread, other threads:[~2017-08-31 14:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30  9:06 [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope Michał Górny
2017-08-30 17:48 ` Zac Medico
2017-08-30 17:52   ` Ulrich Mueller
2017-08-30 18:00     ` Zac Medico
2017-08-30 20:31   ` Michał Górny
2017-08-30 20:35     ` Zac Medico
2017-08-30 20:45       ` Michał Górny
2017-08-31  6:36         ` Zac Medico
2017-08-31 14:07           ` Michał Górny

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