Gentoo Archives: gentoo-dev

From: Ian Stakenvicius <axs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Eclass assisted multilib dependent cache updates
Date: Mon, 04 Jan 2016 16:29:52
Message-Id: 568A9DF3.9060201@gentoo.org
In Reply to: [gentoo-dev] Eclass assisted multilib dependent cache updates by Gilles Dartiguelongue
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 02/01/16 10:54 AM, Gilles Dartiguelongue wrote:
5 > Hello all,
6 >
7 > while working on bug #518422, I found out that while eclass calls
8 > the relevant cache updates it has no idea whether or not it is
9 > called in a multilib context or not.
10 >
11 > Imho, this leads to avoidable human errors where one thinks
12 > eclass will take care of lib dependent caches, which it does, but
13 > not for all enabled ABIs which could lead to reduced
14 > functionality for non-native ABIs.
15 >
16 > While it seems reasonable to call multilib_foreach_abi
17 > gnome2_pkg_postinst for multilib enabled ebuilds, it is still not
18 > ideal as it will call a lot of functions for no good reason. On
19 > the other hand, checking environment variable set by multilib
20 > eclasses does not seem like a robust solution.
21 >
22 > Is there any reasonable way to make phase functions aware of if
23 > they are running in a multilib enabled ebuild to adjust their
24 > behavior ?
25 >
26
27 By "phase functions" here, I assume that you are referring to phase
28 functions exported by the eclass? In that particular case, AFAIK,
29 they are never called in a multilib context by default, rather they
30 are only called within a multilib context when explicitly called
31 within a multilib_foreach_abi.
32
33 Back to the issue at hand, though, likely there would be a way to
34 leverage 'multilib_is_native_abi' to filter out cases when you don't
35 want certain things to run. To do this properly for non-multilib
36 ebuilds you'll need to make sure that your conditionals won't crash
37 out if multilib_is_native_abi is undefined, though -- could be a
38 messy hack... It would probably make more sense to rearrange the
39 function(s) internally and perhaps provide two (one for
40 multilib-build, one not) if the plan is to support ebuilds that
41 inherit multilib-build AND ebuilds that don't, from the same eclass.
42
43
44 -----BEGIN PGP SIGNATURE-----
45 Version: GnuPG v2
46
47 iF4EAREIAAYFAlaKnfMACgkQAJxUfCtlWe0xxQD/S0+QJMqm0qulSR4DAZb4J0uu
48 RPF53KqIPkuvE0VnL14BAJWscEDyB4Pt9JOEjoiYwNelfDV0frwsgEQVvZu1Ol7Y
49 =pZVV
50 -----END PGP SIGNATURE-----