Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] eapi function (Was: Collecting opinions about GLEP 55 and alternatives)
Date: Thu, 26 Feb 2009 00:02:12
Message-Id: 20090226000246.GK3506@hrair
In Reply to: Re: [gentoo-dev] eapi function (Was: Collecting opinions about GLEP 55 and alternatives) by Ciaran McCreesh
1 On Wed, Feb 25, 2009 at 11:03:07PM +0000, Ciaran McCreesh wrote:
2 > On Wed, 25 Feb 2009 04:49:51 -0800
3 > Brian Harring <ferringb@×××××.com> wrote:
4 > > 4) eapi as a function; instead of "EAPI=1", do "eapi 1", required as
5 > > the first statement (simplest way).
6 >
7 > Doesn't solve anything over having it as a variable, and has a messy
8 > upgrade path.
9 >
10 > > - global scope changes can occur (inherit mechanism changes
11 > > included).
12 >
13 > Global scope changes can no more occur than they can with it as a
14 > variable. All it does is changes where the barfing occurs to slightly
15 > earlier on.
16
17 Bullshit. First invocation of the ebuild, that means it can do
18 whatever it wants to the environment- literally swapping in the EAPI
19 environment right then/there. Auto inherits, changing the inherit
20 mechanism, everything (this includes shopt adjustments).
21
22 Not even sure why you're arguing that one, but back it up w/ examples
23 if you want to continue that line of FUD.
24
25
26 > > - transition is slightly icky; basically one of the following is
27 > > required-
28 > > a) for EAPI>=2, do 'eapi 3 || die "upgrade your manager"'. Reason
29 > > for this is that current managers obviously lack an eapi
30 > > function, to make managers available *now* blow up the || die is
31 > > required. This solution can be deployed now, no transition required
32 > > although at some point stating "eapi is required retroactively for
33 > > all eapis" would be wise to eliminate the need for the || die (cut
34 > > support basically for old managers)
35 >
36 > Global scope die is very very messy. This leaks out to users in the
37 > form of horrible messages that make the user think something's badly
38 > broken.
39
40 One would think "upgrade your manager" would be... self explanatory.
41 Regardless, spelling it out- the user visible barf is only visible on
42 existant managers.
43
44 For any manager supporting eapi>2 (thus having the function), the
45 function can exist out cleanly (no stderr complaints) from sourcing at
46 that point without issue.
47
48
49 > > b) bashrc trickery, defines an eapi if it's unset. Said eapi
50 > > function exports EAPI=$1, optionally triggering a die if the eapi
51 > > isn't 0,1,2 (since any later eapi would require a manager upgrade
52 > > which would also have the eapi function).
53 >
54 > Unportable, and still leaks out to users.
55
56 Two options were given there; one 'leaks out to users', the other is
57 the old behaviour (eapi env setting)- again, this is only visible for
58 the window of pre eapi 3 managers, meaning it's a one time hit (rather
59 then continual as you're implying).
60
61
62 Every proposal has uglyness- g55 for example doesn't give the user any
63 indication that they're not seeing ebuilds due to EAPI (in other words
64 loss of functionality that exists now).
65
66 ~brian

Replies

Subject Author
Re: [gentoo-dev] eapi function (Was: Collecting opinions about GLEP 55 and alternatives) Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>