Gentoo Archives: gentoo-dev

From: Daniel Robbins <drobbins.daniel@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: EAPI spec (was Re: [gentoo-dev] Re: let's clear things up (was Slacker archs))
Date: Tue, 20 Feb 2007 21:14:59
Message-Id: 226689f10702201312p47537d86rd6099c4feca7b7e0@mail.gmail.com
In Reply to: Re: EAPI spec (was Re: [gentoo-dev] Re: let's clear things up (was Slacker archs)) by Ciaran McCreesh
1 OK, my initial impression of this is:
2
3 1) ebuilds and *especially* eclasses do way too many weird things and
4 can often depend on idiosyncrasies of portage. The eclass bash scripts
5 can be quite complex and probably 9 out of 10 (99 out of 100?) times
6 I'd put the burden of compatibility on the eclass rather than the
7 package manager, because it's the eclass that's trying to do "weird
8 stuff."
9
10 2) to ensure cross-package-manager compatibility, all one would need
11 to do is document what one can and cannot assume regarding Portage
12 functionality. I see no harm in having the ebuilds/eclasses assume
13 less and encourage others to write more robust and compatible ebuild
14 and eclass functions.
15
16 3) I regretfully added eclasses to portage. Although they're useful, I
17 don't think they ever made sense from an architecture perspective and
18 are certainly not pretty. Eclasses are nearly ubiquitous now, which is
19 unfortunate. I can't remember seeing an eclass that I ever liked, even
20 if the functionality was really useful and everything was
21 well-written, thought out, documented, etc.
22
23 4) Building on 3, I think there are two ways of life in the world of
24 Portage - either the eclasses control you, or you fight back a bit and
25 control the growth of eclasses. The eclasses are sort of an
26 "anti-architecture" so I think our will should to be imposed on them
27 rather than the other way around. Otherwise you are in a catch-22
28 where we are continually adding tons of weird "legacy code" in the
29 form of eclasses and this problem of cross-package manager
30 compatibility will never go away.
31
32 Those are my thoughts, anyway...
33
34 If you wanted to get me to agree with you by giving me lots of eclass
35 compatibility issues, then it worked :)
36
37 -Daniel
38
39 On 2/20/07, Ciaran McCreesh <ciaranm@×××××××.org> wrote:
40 > On Tue, 20 Feb 2007 12:19:12 -0700 "Daniel Robbins"
41 > <drobbins.daniel@×××××.com> wrote:
42 > | I think that standardization is a good thing and interoperability
43 > | between paludis, portage, pkgcore and others is something we should
44 > | strive for. If at all possible, I think that this standardization
45 > | effort should be "multi-lateral" in the sense that Gentoo and pkgcore
46 > | are also active participants in the standardization process.
47 >
48 > Well, Gentoo already is a participant, in that there are a number
49 > of Gentoo developers with access to the document... At this stage, we're
50 > deliberately keeping the numbers down because we want to get it done
51 > rather than spend huge amounts of time arguing with the peanut gallery
52 > (the same approach we took with eselect, the devmanual and Paludis,
53 > rather than the approach taken with portage-ng and Zynot).
54 >
55 > | Also, I don't think that the council itself needs to be involved
56 > | directly, as a standards/spec project can be created and worked on,
57 > | and the conformance of Portage to this standard can be measured, and
58 > | if desired Portage developers can tweak portage so that it is more
59 > | conformant to this standard. This can be done voluntarily by all
60 > | parties, as they deem it useful.
61 >
62 > The reason the Council is involved is because someone has to give final
63 > approval. This won't be asked for until late on in the process.
64 >
65 > | I think standardization should focus on real interoperability issues,
66 > | rather than esoteric technical issues.
67 >
68 > The esoteric technical issues are the problem, though. The areas where
69 > there are interoperability problems are the areas where ebuilds are
70 > doing weird things, like relying upon side effects of one
71 > implementation of inherit or trying to manually modify vdb or assuming
72 > that certain variables that contain directory names will not include a
73 > trailing slash. The question is whether the ebuilds are wrong in
74 > expecting to be able to do this, or whether package managers have to
75 > emulate weird quirks in how Portage is currently implemented.
76 >
77 > I'll give you a perfect example. Paludis currently includes the
78 > following workaround:
79 >
80 > archives = strip_trailing(archives, " ");
81 > all_archives = strip_trailing(all_archives, " ");
82 >
83 > The reason that this is necessary is because kde-meta.eclass does this:
84 >
85 > [[ -n ${A/${TARBALL}/} ]] && unpack ${A/${TARBALL}/}
86 >
87 > Which means that if a package manager includes trailing spaces in ${A},
88 > the eclass will break. Personally I consider this to be an eclass bug,
89 > but without some standard to back it up there's no concrete answer
90 > either way.
91 >
92 > Another example along the same lines (this one's now fixed in the tree,
93 > but it's a good example of weird side effect behaviour): The PHP
94 > eclasses used to set a global scope variable called EXT_DIR based upon
95 > the value of a variable called PHPCONFIG. The PHPCONFIG variable was
96 > set in pkg_setup, and the EXT_DIR variable was used later on. For
97 > Portage as it is currently implemented, this happens to be ok, because
98 > eclasses are re-sourced for every phase. For Paludis this breaks,
99 > because we implement the environment saving that Portage is going to do
100 > at some point to avoid the eclass API problems.
101 >
102 > Another example: A certain eclass we all know and love used to use
103 > SLOT=${PVR} and then force uninstalls by overwriting VDB SLOT files
104 > when installing packages. As it happens, Portage doesn't cache those
105 > entries, and because of how it implements cleaning the hack happens to
106 > work. The question is whether ebuilds are allowed to rely upon weird
107 > quirks like that (and, indeed, whether ebuilds should be reading VDB at
108 > all).
109 >
110 > Another example: Various ebuilds rely upon the order of items in $A
111 > matching the order in $SRC_URI. This one's arguably useful, but at the
112 > same time it's questionable as to whether it works by fluke.
113 >
114 > It's these cases that are the problem, not the generalities. On the one
115 > hand, requiring that package managers implement every Portage quirk
116 > identically is insane, and stops Portage from changing behaviour in the
117 > future. On the other hand, restricting the API to only completely sane
118 > things makes it much harder to code certain ebuilds -- the $A ordering
119 > is one example of this.
120 >
121 > --
122 > Ciaran McCreesh
123 > Mail : ciaranm at ciaranm.org
124 > Web : http://ciaranm.org/
125 > Paludis, the secure package manager : http://paludis.pioto.org/
126 >
127 >
128 >
129 --
130 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: EAPI spec (was Re: [gentoo-dev] Re: let's clear things up (was Slacker archs)) Ciaran McCreesh <ciaranm@×××××××.org>