Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope
Date: Wed, 30 Aug 2017 20:45:33
Message-Id: 1504125926.6710.3.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] ebuild.sh: Explicitly ban get_libdir in global scope by Zac Medico
1 W dniu śro, 30.08.2017 o godzinie 13∶35 -0700, użytkownik Zac Medico
2 napisał:
3 > On 08/30/2017 01:31 PM, Michał Górny wrote:
4 > > W dniu śro, 30.08.2017 o godzinie 10∶48 -0700, użytkownik Zac Medico
5 > > napisał:
6 > > > On 08/30/2017 02:06 AM, Michał Górny wrote:
7 > > > > The value of get_libdir depends on the profile, and so it is not useful
8 > > > > for dependency calculations. Furthermore, it seems that Portage does
9 > > > > not handle defining it in global scope well due to EAPI checking magic.
10 > > > > Ban it completely where it is defined as EAPI function to let developers
11 > > > > catch their mistakes early rather than see them as 'command not found'
12 > > > > errors during dependency calculation / cache updates.
13 > > > >
14 > > > > Bug: https://bugs.gentoo.org/629010
15 > > > > ---
16 > > > > bin/ebuild.sh | 1 +
17 > > > > 1 file changed, 1 insertion(+)
18 > > > >
19 > > > > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
20 > > > > index a400ef72e..f1ac3f278 100755
21 > > > > --- a/bin/ebuild.sh
22 > > > > +++ b/bin/ebuild.sh
23 > > > > @@ -66,6 +66,7 @@ else
24 > > > > use useq usev use_with use_enable"
25 > > > > ___eapi_has_usex && funcs+=" usex"
26 > > > > ___eapi_has_in_iuse && funcs+=" in_iuse"
27 > > > > + ___eapi_has_get_libdir && funcs+=" get_libdir"
28 > > > > # These functions die because calls to them during the "depend" phase
29 > > > > # are considered to be severe QA violations.
30 > > > > funcs+=" best_version has_version portageq"
31 > > > >
32 > > >
33 > > > It's possible that there are working ebuilds that call get_libdir in
34 > > > global scope. Have we done an analysis of the ebuilds in the gentoo
35 > > > repository? Obviously, it would be safer to call eqawarn.
36 > >
37 > > If there were any (more), we'd have caught them during cache regen,
38 > > wouldn't we? When I accidentally left it when bumping to EAPI 6, I've
39 > > got a bug report almost immediately.
40 >
41 > We'll only catch it during cache regen if we delete all of the previous
42 > cache, forcing all of the ebuilds to be sourced again. If all ebuilds in
43 > the gentoo tree are compliant, the I think that's good enough for us to
44 > die here.
45
46 I'm pretty sure all of them are. However, if someone has resources to
47 spare, I'd appreciate running a full regen with the patch to confirm.
48
49 --
50 Best regards,
51 Michał Górny

Replies