Gentoo Archives: gentoo-portage-dev

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

Replies