Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 411069

Summary: Portage shouldn't check $EAPI to get the EAPI
Product: Portage Development Reporter: Ciaran McCreesh <ciaran.mccreesh>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: betelgeuse, sera, ulm
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 410999    
Bug Blocks:    

Description Ciaran McCreesh 2012-04-06 18:02:03 UTC
Various bits of bash code check the $EAPI environment variable to determine the EAPI. This isn't reliable: the code needs to change behaviour based upon the EAPI metadata variable, not the value of the environment variable, which may contain something else.

Note that it's legal for ebuilds to unset metadata variables for the benefit external utilities. For example, it used to be necessary to unset 'AA' before calling 'econf' for some annoying build systems. EAPI is no different here (other than that we've not had to do it yet).

It also gives people the misleading impression that they could do something like "EAPI=3 econf" to call an econf defined by a different EAPI. That happens to sort of work with Portage at the moment, and it shouldn't.

Finally, with the new EAPI semantics, it will be legal to do this:

    inherit blah
    EAPI=5

But we're allowing 'inherit' to change behaviour based upon EAPI.

The easiest fix is probably to set an "unlikely to need to be tampered with" variable like PORTAGE_ACTUAL_EAPI and to use that.
Comment 1 Brian Harring (RETIRED) gentoo-dev 2012-04-07 00:48:36 UTC
(In reply to comment #0)
> The easiest fix is probably to set an "unlikely to need to be tampered with"
> variable like PORTAGE_ACTUAL_EAPI and to use that.

And keep the council apprised of the actual realities (ebuild flow, gotchas, take your pick) of this decision.
Comment 2 Ulrich Müller gentoo-dev 2012-05-08 19:47:58 UTC
Council removed from CC as discussed in today's meeting.