Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 422513 - PMS is unclear on EXPORT_FUNCTIONS effective order
Summary: PMS is unclear on EXPORT_FUNCTIONS effective order
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-20 08:21 UTC by Michał Górny
Modified: 2021-09-01 17:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-06-20 08:21:52 UTC
PMS seems a bit laconic regarding EXPORT_FUNCTIONS. While one _may_ get an idea what it is supposed to be used for, there's no explanation what happens when EXPORT_FUNCTIONS is used within multiple inherited eclasses.

Especially it lacks information that:

a) indirectly inherited eclasses have precedence over explicitly inherited ones:

a.eclass, b.eclass export pkg_setup()
c.eclass inherits a
if ebuild does 'inherit a b c', a_pkg_setup() will be called


b) calls to EXPORT_FUNCTIONS determine the order, not inherits:

in case listed above, vapier introduces double-inherit prevention in a.eclass
now if ebuild does 'inherit a b c', b_pkg_setup() will be called


c) whether eclass API/exports is allowed to change between successive inherits:

- due to 'configuration' variables changing,
- due to 'double include prevention'.

(where basically one defeats the other)


The above behavior I was able to reproduce using portage, pkgcore & paludis. Not sure if that's what we want in the spec though.
Comment 1 Brian Harring (RETIRED) gentoo-dev 2012-11-26 09:03:11 UTC
Bump; any life on PMS bugs or have the cows fled the barn?
Comment 2 Ulrich Müller gentoo-dev 2012-11-26 09:11:23 UTC
It would certainly help if a patch was attached.
Comment 3 Larry the Git Cow gentoo-dev 2021-09-01 17:34:58 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=f5f8e42eeb8ea1e8c2ac182f30214ef0c559dd88

commit f5f8e42eeb8ea1e8c2ac182f30214ef0c559dd88
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-08-29 08:10:29 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-08-31 16:02:50 +0000

    eclasses.tex: Clarify precedence of EXPORT_FUNCTIONS calls
    
    Clarify that the last call to EXPORT_FUNCTIONS takes precedence over
    earlier calls.
    
    Unfortunately, we need an exception when inherit is called after
    EXPORT_FUNCTIONS because Portage changed its behaviour in 2009:
    https://gitweb.gentoo.org/proj/portage.git/commit/?id=06d4433e8b8be60d606733b9e23f57f8a5869d8f
    
    Pkgcore and Paludis apply precedence consistently based on call order
    of EXPORT_FUNCTIONS.
    
    Bug: https://bugs.gentoo.org/399039
    Bug: https://bugs.gentoo.org/422513
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 eclasses.tex | 4 ++++
 1 file changed, 4 insertions(+)