Gentoo Archives: gentoo-dev

From: Paul de Vrieze <pauldv@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] EBUILD_FORMAT support
Date: Thu, 25 Aug 2005 15:36:11
Message-Id: 200508251234.00876.pauldv@gentoo.org
In Reply to: Re: [gentoo-dev] EBUILD_FORMAT support by Brian Harring
1 On Tuesday 23 August 2005 18:00, Brian Harring wrote:
2 > On Tue, Aug 23, 2005 at 03:20:16PM +0200, Paul de Vrieze wrote:
3 > > To allow for this to work with current portage versions, perhaps it
4 > > would be an option to introduce a new extension for .ebuild scripts
5 > > that use it's functionality. That would allow all non-EAPI aware
6 > > portage versions to automatically ignore ebuilds that use this.
7 >
8 > not much for .ebuild? in the tree, personally.
9 > Why? Cause portage *should not* ignore those ebuilds. If the user
10 > wants to merge something that is a later ebuild api then they have, at
11 > least portage chucks an exception that the UI can wrap into "upgrade
12 > portage".
13 >
14 > With what you're proposing, we instead get bugs about portage missing
15 > packages.
16
17 What I mean is compatibility with current portage versions. Current
18 versions do not understand EAPI. There would be a good chance that they
19 could choke on packages with all kinds of new features, even in the sync
20 phase. A different extension would ensure that those portage versions
21 would still work (crippled) on a new tree. Of course such an extension
22 change should only be done once. Once the API versions are available this
23 is not an issue.
24
25 >
26 > > ps. I would also suggest requiring that EAPI can be retrieved by a
27 > > simple line by line parsing without using bash. (This allows for
28 > > changing the parsing system)
29 >
30 > No, that's yanks EAPI setting away from eclasses.
31
32 If the eclasses follow similar rules that would be easilly parseable.
33 (taking inherit ...) into account is easy as long as the inherit line is
34 on one line of it's own. (unconditionally) These rules that would
35 allready be followed out of style reasons would make various kinds of
36 parsers able to parse them.
37
38 > Only time this would be required is if we move away from bash; if that
39 > occurs, then I'd think a new extension would be required.
40
41 It would allow to for example restrict the ebuild format such that initial
42 parsing is not done by bash (but the files are still parseable by bash).
43 If we perform changes I think it should be done right in the first place.
44
45 > As is, shifting the 'template' loaded for an ebuild can be done in
46 > ebd's init_environ easy enough, so no reason to add the extra
47 > restrictions/changes.
48
49 One of the issues of ebuilds is the cache/metadata stuff. Parsing an
50 ebuild for basic information takes a lot of time. This can be done lots
51 faster with a less featured parser (I've written one some day) that
52 accepts 98% of all current ebuilds, just doesn't like dynamic features in
53 the toplevel. Such a parser could be a python plugin and as such easy to
54 use from python. However to ensure compatibility with a faster parser the
55 EAPI variable should be there in a way that is a little more strict than
56 the other variables. And such a restriction is in practice not a
57 restriction.
58
59 The restriction I propose would be:
60 - If EAPI is defined in the ebuild it should be unconditional, on it's own
61 line in the toplevel of the ebuild before any functions are defined.
62 (preferably the first element after the comments and whitespace)
63
64 - If EAPI is not defined in the ebuild, but in an eclass, the inherit
65 chain should be unconditional and direct. Further more in the eclass the
66 above rules should be followed.
67
68 Please note that many of the conditions are allready true for current
69 ebuilds, just portage can "handle" more.
70
71 Paul
72
73 --
74 Paul de Vrieze
75 Gentoo Developer
76 Mail: pauldv@g.o
77 Homepage: http://www.devrieze.net

Replies

Subject Author
Re: [gentoo-dev] EBUILD_FORMAT support Brian Harring <ferringb@g.o>