Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 411069 - Portage shouldn't check $EAPI to get the EAPI
Summary: Portage shouldn't check $EAPI to get the EAPI
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 410999
Blocks:
  Show dependency tree
 
Reported: 2012-04-06 18:02 UTC by Ciaran McCreesh
Modified: 2012-06-02 16:02 UTC (History)
3 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 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.