/[gentoo]/xml/htdocs/proj/en/glep/glep-0055.html
Gentoo

Diff of /xml/htdocs/proj/en/glep/glep-0055.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.6
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<!-- 4
5This HTML is auto-generated. DO NOT EDIT THIS FILE! If you are writing a new
6PEP, see http://www.python.org/peps/pep-0001.html for instructions and links
7to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE!
8-->
9<head> 5<head>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> 7 <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
12 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title> 8 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title>
13 <link rel="stylesheet" href="tools/glep.css" type="text/css" /> 9 <link rel="stylesheet" href="tools/glep.css" type="text/css" /></head>
14</head>
15<body bgcolor="white"> 10<body bgcolor="white">
16<table class="navigation" cellpadding="0" cellspacing="0" 11<table class="navigation" cellpadding="0" cellspacing="0"
17 width="100%" border="0"> 12 width="100%" border="0">
18<tr><td class="navicon" width="150" height="35"> 13<tr><td class="navicon" width="150" height="35">
19<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page"> 14<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
20<img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]" 15<img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]"
21 border="0" width="150" height="35" /></a></td> 16 border="0" width="150" height="35" /></a></td>
22<td class="textlinks" align="left"> 17<td class="textlinks" align="left">
23[<b><a href="http://www.gentoo.org/">Gentoo Linux Home</a></b>] 18[<b><a href="http://www.gentoo.org/">Gentoo Linux Home</a></b>]
24[<b><a href="http://www.gentoo.org/peps">GLEP Index</a></b>] 19[<b><a href="http://www.gentoo.org/proj/en/glep">GLEP Index</a></b>]
25[<b><a href="http://www.gentoo.org/proj/en/glep/glep-0055.txt">GLEP Source</a></b>] 20[<b><a href="http://www.gentoo.org/proj/en/glep/glep-0055.txt">GLEP Source</a></b>]
26</td></tr></table> 21</td></tr></table>
27<table class="rfc2822 docutils field-list" frame="void" rules="none"> 22<table class="rfc2822 docutils field-list" frame="void" rules="none">
28<col class="field-name" /> 23<col class="field-name" />
29<col class="field-body" /> 24<col class="field-body" />
30<tbody valign="top"> 25<tbody valign="top">
31<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td> 26<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
32</tr> 27</tr>
33<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td> 28<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
34</tr> 29</tr>
35<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.1</td> 30<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.5</td>
36</tr> 31</tr>
37<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/proj/en/glep/glep-0055.txt?cvsroot=gentoo">2008/01/05 02:36:35</a></td> 32<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/proj/en/glep/glep-0055.txt?cvsroot=gentoo">2009/05/17 20:56:53</a></td>
38</tr> 33</tr>
39<tr class="field"><th class="field-name">Author:</th><td class="field-body">Piotr Jaroszyński &lt;peper&#32;&#97;t&#32;gentoo.org&gt;</td> 34<tr class="field"><th class="field-name">Author:</th><td class="field-body">Piotr Jaroszyński &lt;peper&#32;&#97;t&#32;gentoo.org&gt;</td>
40</tr> 35</tr>
41<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td> 36<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
42</tr> 37</tr>
43<tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td> 38<tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
44</tr> 39</tr>
45<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="glep-0002.html">text/x-rst</a></td> 40<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference external" href="glep-0002.html">text/x-rst</a></td>
46</tr> 41</tr>
47<tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td> 42<tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td>
48</tr> 43</tr>
49<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007</td> 44<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007, 17-May-2009</td>
50</tr> 45</tr>
51</tbody> 46</tbody>
52</table> 47</table>
53<hr /> 48<hr />
54<div class="contents topic"> 49<div class="contents topic" id="contents">
55<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> 50<p class="topic-title first">Contents</p>
56<ul class="simple"> 51<ul class="simple">
57<li><a class="reference" href="#abstract" id="id3" name="id3">Abstract</a></li> 52<li><a class="reference internal" href="#abstract" id="id3">Abstract</a></li>
58<li><a class="reference" href="#problem" id="id4" name="id4">Problem</a></li> 53<li><a class="reference internal" href="#problem" id="id4">Problem</a></li>
54<li><a class="reference internal" href="#current-behaviour" id="id5">Current behaviour</a><ul>
55<li><a class="reference internal" href="#incompatible-change-of-inherit-e-g-make-it-look-in-the-package-dir-too" id="id6">Incompatible change of inherit (e.g. make it look in the package dir too)</a></li>
56<li><a class="reference internal" href="#new-global-scope-function" id="id7">New global scope function</a></li>
57<li><a class="reference internal" href="#new-version-format" id="id8">New version format</a></li>
58<li><a class="reference internal" href="#use-newer-bash-features" id="id9">Use newer bash features</a></li>
59</ul>
60</li>
59<li><a class="reference" href="#abstract-solution" id="id5" name="id5">Abstract solution</a></li> 61<li><a class="reference internal" href="#abstract-solution" id="id10">Abstract solution</a></li>
60<li><a class="reference" href="#proposed-solution" id="id6" name="id6">Proposed solution</a></li> 62<li><a class="reference internal" href="#proposed-solution" id="id11">Proposed solution</a></li>
61<li><a class="reference" href="#specification" id="id7" name="id7">Specification</a></li> 63<li><a class="reference internal" href="#specification" id="id12">Specification</a></li>
62<li><a class="reference" href="#application" id="id8" name="id8">Application</a></li> 64<li><a class="reference internal" href="#summary-of-ideas" id="id13">Summary of ideas</a><ul>
63<li><a class="reference" href="#other-ideas" id="id9" name="id9">Other ideas</a></li> 65<li><a class="reference internal" href="#eapi-suffixed-ebuilds-proposed-solution" id="id14">EAPI-suffixed ebuilds (proposed solution)</a></li>
66<li><a class="reference internal" href="#eapi-in-the-filename-with-one-time-extension-change" id="id15">EAPI in the filename with one-time extension change</a></li>
67<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild" id="id16">Easily fetchable EAPI inside the ebuild</a></li>
68<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change" id="id17">Easily fetchable EAPI inside the ebuild and one-time extension change</a></li>
69<li><a class="reference internal" href="#use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix" id="id18">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></li>
70</ul>
71</li>
64<li><a class="reference" href="#references" id="id10" name="id10">References</a></li> 72<li><a class="reference internal" href="#references" id="id19">References</a></li>
65<li><a class="reference" href="#copyright" id="id11" name="id11">Copyright</a></li> 73<li><a class="reference internal" href="#copyright" id="id20">Copyright</a></li>
66</ul> 74</ul>
67</div> 75</div>
68<blockquote> 76<blockquote>
69<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian 77<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
70spring: there shallow draughts intoxicate the brain, and drinking largely 78spring: there shallow draughts intoxicate the brain, and drinking largely
71sobers us again.&quot;</p> 79sobers us again.&quot;</p>
72<p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p> 80<p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p>
73</blockquote> 81</blockquote>
74<div class="section"> 82<div class="section" id="abstract">
75<h1><a class="toc-backref" href="#id3" id="abstract" name="abstract">Abstract</a></h1> 83<h1><a class="toc-backref" href="#id3">Abstract</a></h1>
76<p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for 84<p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for
77example, foo-1.2.3.ebuild-1).</p> 85example, foo-1.2.3.ebuild-1).</p>
78</div> 86</div>
79<div class="section"> 87<div class="section" id="problem">
80<h1><a class="toc-backref" href="#id4" id="problem" name="problem">Problem</a></h1> 88<h1><a class="toc-backref" href="#id4">Problem</a></h1>
81<p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the 89<p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the
82EAPI the package manager needs to source the ebuild, which itself needs the EAPI 90EAPI the package manager needs to source the ebuild, which itself needs the EAPI
83in the first place. Otherwise it imposes a serious limitation, namely every ebuild, 91in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
84using any of the future EAPIs, will have to be source'able by old package 92using any of the future EAPIs, will have to be source'able by old package
85managers and hence there is no way to:</p> 93managers and hence there is no way to do any of the following:</p>
86<blockquote> 94<blockquote>
87<ul class="simple"> 95<ul class="simple">
88<li>Change behaviour of inherit in any way (for example, to extend or change 96<li>Change the behaviour of inherit in any way (for example, to extend or change
89eclass functionality).</li> 97eclass functionality).</li>
90<li>Add new global scope functions in any sane way.</li> 98<li>Add new global scope functions in any sane way.</li>
91<li>Extend versioning rules in an EAPI - for example, addition of the scm 99<li>Extend versioning rules in an EAPI - for example, addition of the scm
92suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1" name="id1">[1]</a>.</li> 100suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1">[1]</a> or allowing more sensible version formats like
101<tt class="docutils literal"><span class="pre">1-rc1</span></tt>, <tt class="docutils literal"><span class="pre">1-alpha</span></tt> etc. to match upstream more closely.</li>
102<li>Use newer bash features.</li>
93</ul> 103</ul>
94</blockquote> 104</blockquote>
95</div> 105</div>
96<div class="section"> 106<div class="section" id="current-behaviour">
97<h1><a class="toc-backref" href="#id5" id="abstract-solution" name="abstract-solution">Abstract solution</a></h1> 107<h1><a class="toc-backref" href="#id5">Current behaviour</a></h1>
108<p>Following subsections show what happens if you introduce any of the mentioned
109changes in an ebuild and try to install it with portage 2.1.6.13.</p>
110<div class="section" id="incompatible-change-of-inherit-e-g-make-it-look-in-the-package-dir-too">
111<h2><a class="toc-backref" href="#id6">Incompatible change of inherit (e.g. make it look in the package dir too)</a></h2>
112<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
113<pre class="literal-block">
114EAPI=&quot;5&quot;
115inherit &quot;foo&quot;
116
117DESCRIPTION=&quot;&quot;
118HOMEPAGE=&quot;&quot;
119SRC_URI=&quot;&quot;
120...
121</pre>
122<p>Result:</p>
123<pre class="literal-block">
124*
125* ERROR: sys-apps/foo-1 failed.
126* Call stack:
127* ebuild.sh, line 1879: Called _source_ebuild
128* ebuild.sh, line 1818: Called source '/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild'
129* foo-1.ebuild, line 6: Called inherit 'foo'
130* ebuild.sh, line 1218: Called die
131* The specific snippet of code:
132* [ ! -e &quot;$location&quot; ] &amp;&amp; die &quot;${1}.eclass could not be found by inherit()&quot;
133* The die message:
134* foo.eclass could not be found by inherit()
135*
136* If you need support, post the topmost build error, and the call stack if relevant.
137* This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
138*
139
140!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
141!!! One of the following masked packages is required to complete your request:
142- sys-apps/foo-1 (masked by: corruption)
143</pre>
144<p>Current portage looks for eclasses only in the <tt class="docutils literal">eclass</tt> directory of a
145repository. This results in a fatal error and ebuild being masked by corruption
146- might be pretty confusing to users.</p>
147</div>
148<div class="section" id="new-global-scope-function">
149<h2><a class="toc-backref" href="#id7">New global scope function</a></h2>
150<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
151<pre class="literal-block">
152EAPI=&quot;5&quot;
153new_global_scope_function &quot;foo&quot;
154
155DESCRIPTION=&quot;&quot;
156HOMEPAGE=&quot;&quot;
157SRC_URI=&quot;&quot;
158...
159</pre>
160<p>Result:</p>
161<pre class="literal-block">
162/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 7: new_global_scope_function: command not found
163
164!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
165!!! One of the following masked packages is required to complete your request:
166- sys-apps/foo-1 (masked by: EAPI 5)
167
168The current version of portage supports EAPI '2'. You must upgrade to a
169newer version of portage before EAPI masked packages can be installed.
170</pre>
171<p>Not that bad as user is advised to upgrade portage.</p>
172</div>
173<div class="section" id="new-version-format">
174<h2><a class="toc-backref" href="#id8">New version format</a></h2>
175<p><tt class="docutils literal"><span class="pre">sys-apps/foo-2-rc1.ebuild</span></tt>:</p>
176<pre class="literal-block">
177Invalid ebuild name: /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-2-rc1.ebuild
178
179emerge: there are no ebuilds to satisfy &quot;sys-apps/foo&quot;
180</pre>
181<p>Not the best error message, especially if there are lots of them.</p>
182</div>
183<div class="section" id="use-newer-bash-features">
184<h2><a class="toc-backref" href="#id9">Use newer bash features</a></h2>
185<p><tt class="docutils literal">|&amp;</tt> is a new type of redirection added in bash-4. It cannot be used even in
186local scope as bash still parses the whole ebuild.</p>
187<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
188<pre class="literal-block">
189EAPI=&quot;5&quot;
190
191foo() {
192 echo &quot;foo&quot; |&amp; cat
193}
194</pre>
195<p>Result:</p>
196<pre class="literal-block">
197/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: syntax error near unexpected token `&amp;'
198/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: ` echo &quot;foo&quot; |&amp; cat'
199*
200* ERROR: sys-apps/foo-1 failed.
201* Call stack:
202* ebuild.sh, line 1879: Called _source_ebuild
203* ebuild.sh, line 1818: Called die
204* The specific snippet of code:
205* source &quot;${EBUILD}&quot; || die &quot;error sourcing ebuild&quot;
206* The die message:
207* error sourcing ebuild
208*
209* If you need support, post the topmost build error, and the call stack if relevant.
210* This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
211* ... done!
212
213!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
214!!! One of the following masked packages is required to complete your request:
215- sys-apps/foo-1 (masked by: corruption)
216</pre>
217<p>Again, not the best error.</p>
218</div>
219</div>
220<div class="section" id="abstract-solution">
221<h1><a class="toc-backref" href="#id10">Abstract solution</a></h1>
98<p>A solution to this problem has to lift those limitations and the only way to do 222<p>A solution to this problem has to lift those limitations and the only way to do
99it is to make the EAPI of an ebuild available to the package managers in a way 223it is to make the EAPI of an ebuild available to the package managers in a way
100that doesn't require them to source the ebuild. Another important requirement is 224that doesn't require them to source the ebuild. Another important requirement is
101for the solution to be backward compatible, which has the pleasant side-effect 225for the solution to be backward compatible, which has the pleasant side-effect
102of making the solution applicable in the Gentoo tree right away. Opposed to 226of making the solution applicable in the Gentoo tree right away. Opposed to
103waiting an arbitrary amount of time, which is never long enough anyway, as the 227waiting an arbitrary amount of time, which is never long enough anyway, as the
104issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2" name="id2">[2]</a> - show.</p> 228issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2">[2]</a> - show.</p>
105</div> 229</div>
106<div class="section"> 230<div class="section" id="proposed-solution">
107<h1><a class="toc-backref" href="#id6" id="proposed-solution" name="proposed-solution">Proposed solution</a></h1> 231<h1><a class="toc-backref" href="#id11">Proposed solution</a></h1>
108<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This 232<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
109allows package managers to trivially read the EAPI from the ebuild filename. It 233allows package managers to trivially read the EAPI from the ebuild filename. It
110is also backward compatible, because currently ebuilds are recognised by the 234is also backwards compatible, because currently ebuilds are recognised by the
111<tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by 235<tt class="docutils literal">.ebuild</tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by
112the package managers.</p> 236the package managers.</p>
113</div> 237</div>
114<div class="section"> 238<div class="section" id="specification">
115<h1><a class="toc-backref" href="#id7" id="specification" name="specification">Specification</a></h1> 239<h1><a class="toc-backref" href="#id12">Specification</a></h1>
116<p>Ebuild filename extension syntax: <tt class="docutils literal"><span class="pre">ebuild[-&lt;EAPI&gt;]</span></tt>, where <tt class="docutils literal"><span class="pre">[]</span></tt> denotes an 240<p>Ebuild filename extension syntax: <tt class="docutils literal"><span class="pre">ebuild[-&lt;EAPI&gt;]</span></tt>, where <tt class="docutils literal">[]</tt> denotes an
117optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p> 241optional part, and <tt class="docutils literal">&lt;EAPI&gt;</tt> is the EAPI of the ebuild.</p>
118<p>Let's call the EAPI included in the ebuild filename the pre-source EAPI, and the 242<p>The EAPI used by the ebuild is the EAPI included in the filename if it is set.
119EAPI set inside the ebuild the post-source EAPI. Given these two, the final EAPI 243Otherwise the EAPI set inside the ebuild is used, which defaults to 0 (this is
120used by the ebuild can be established by following these steps:</p> 244the current behaviour).</p>
121<blockquote>
122<ul class="simple">
123<li>If the pre-source EAPI is not set it defaults to 0.</li>
124<li>If the pre-source EAPI is not recognised it is returned immediately.</li>
125<li>If the post-source EAPI is not set, it defaults to the pre-source EAPI.</li>
126<li>post-source EAPI is returned.</li>
127</ul>
128</blockquote>
129<p>The above process should be only used to generate the metadata cache. Should the
130pre-source EAPI be unsupported the cache entry cannot be generated.</p>
131<p>Ebuilds with unsupported EAPIs are masked.</p> 245<p>Ebuilds with unsupported EAPIs are masked.</p>
132<p>QA tools should consider it an error for both EAPIs to be set explicitly to 246<p>It should be considered an error to set the EAPI both in the filename and in the
133different values. Package managers may warn, but must use the post-source EAPI 247ebuild.</p>
134in such cases.</p>
135<p>Examples:</p> 248<p>Examples:</p>
136<blockquote> 249<blockquote>
137<ul> 250<ul>
138<li><dl class="first docutils"> 251<li><dl class="first docutils">
139<dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt> 252<dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt>
140<dd><p class="first last">pre-source EAPI defaults 0, post-source EAPI defaults to pre-source EAPI. 253<dd><p class="first last">EAPI defaults to 0.</p>
141EAPI 0 is used.</p>
142</dd> 254</dd>
143</dl> 255</dl>
144</li> 256</li>
145<li><dl class="first docutils"> 257<li><dl class="first docutils">
146<dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt> 258<dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt>
147<dd><p class="first last">pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI. 259<dd><p class="first last">EAPI 1 is used.</p>
148EAPI 1 is used.</p>
149</dd> 260</dd>
150</dl> 261</dl>
151</li> 262</li>
152<li><dl class="first docutils"> 263<li><dl class="first docutils">
153<dt><tt class="docutils literal"><span class="pre">pkg-3.ebuild</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt> 264<dt><tt class="docutils literal"><span class="pre">pkg-3.ebuild-1</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt>
154<dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 1. 265<dd><p class="first last">EAPI set in both places - error.</p>
155EAPI 1 is used.</p>
156</dd>
157</dl>
158</li>
159<li><dl class="first docutils">
160<dt><tt class="docutils literal"><span class="pre">pkg-4.ebuild-2</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt>
161<dd><p class="first last">pre-source EAPI is 2, post-source EAPI is 1.
162EAPI 1 is used, but note that one should <strong>never</strong> explicitly set both
163EAPIs to different values.</p>
164</dd>
165</dl>
166</li>
167<li><dl class="first docutils">
168<dt><tt class="docutils literal"><span class="pre">pkg-5.ebuild-2</span></tt>, no EAPI set inside the ebuild, package manager not supporting EAPI 2</dt>
169<dd><p class="first last">pre-source EAPI is 2, post-source EAPI is never checked.
170ebuild masked because of the unsupported pre-source EAPI.</p>
171</dd>
172</dl>
173</li>
174<li><dl class="first docutils">
175<dt><tt class="docutils literal"><span class="pre">pkg-6.ebuild</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;2&quot;</span></tt>, package manager not supporting EAPI 2</dt>
176<dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 2 (assuming the
177package manager didn't die when sourcing the ebuild thinking that EAPI 0
178is used).
179ebuild masked because of the unsupported post-source EAPI.</p>
180</dd> 266</dd>
181</dl> 267</dl>
182</li> 268</li>
183</ul> 269</ul>
184</blockquote> 270</blockquote>
185<p>Note that it is still not permitted to have more than one ebuild with equal 271<p>Note that it is still not permitted to have more than one ebuild with equal
186category, package name, and version. Although it would have the advantage of 272category, package name, and version. Although it would have the advantage of
187allowing to provide backward compatible ebuilds, it would introduce problems 273allowing authors to provide backwards compatible ebuilds, it would introduce
188too. The first is the requirement to have strict EAPI ordering, the second is 274problems too. The first is the requirement to have strict EAPI ordering, the
189ensuring that all the ebuilds for a single category/package-version are 275second is ensuring that all the ebuilds for a single category/package-version
190equivalent, i.e. installing any of them has exactly the same effect to the 276are equivalent, i.e. installing any of them has exactly the same effect on a
191system.</p> 277given system.</p>
278<p>Also note that it is not a new restriction. It is already possible to illegally
279have multiple versions with different EAPIs as e.g. <tt class="docutils literal">1.0 == 1.00 == <span class="pre">1.00-r0</span></tt>
280and hence you could have <tt class="docutils literal"><span class="pre">foo-1.0.ebuild</span></tt> with EAPI X and <tt class="docutils literal"><span class="pre">foo-1.00.ebuild</span></tt>
281with EAPI Y.</p>
192</div> 282</div>
193<div class="section"> 283<div class="section" id="summary-of-ideas">
194<h1><a class="toc-backref" href="#id8" id="application" name="application">Application</a></h1> 284<h1><a class="toc-backref" href="#id13">Summary of ideas</a></h1>
195<p>Note that the developers should only set the pre-source EAPI. The process 285<div class="section" id="eapi-suffixed-ebuilds-proposed-solution">
196described above is only necessary to avoid undefined behaviour in corner cases 286<h2><a class="toc-backref" href="#id14">EAPI-suffixed ebuilds (proposed solution)</a></h2>
197and to retain backwards compatibility.</p> 287<dl class="docutils">
198<p>QA tools may warn if the post-source EAPI is set at all, thus helping with the 288<dt>Properties:</dt>
199transition to the new format.</p> 289<dd><ul class="first last simple">
290<li>Can be used right away: yes</li>
291<li>Hurts performance: no</li>
292</ul>
293</dd>
294</dl>
295<p>Some say it is clear and simple, others that it is ugly and unintuitive.</p>
200</div> 296</div>
201<div class="section"> 297<div class="section" id="eapi-in-the-filename-with-one-time-extension-change">
202<h1><a class="toc-backref" href="#id9" id="other-ideas" name="other-ideas">Other ideas</a></h1> 298<h2><a class="toc-backref" href="#id15">EAPI in the filename with one-time extension change</a></h2>
203<p>There were some other solutions proposed on the mailing list:</p> 299<p>One of the proposed filename formats:
300<tt class="docutils literal"><span class="pre">&lt;PKG&gt;-&lt;VER&gt;.eapi-&lt;EAPI&gt;.eb</span></tt></p>
301<dl class="docutils">
302<dt>Properties:</dt>
303<dd><ul class="first last simple">
304<li>Can be used right away: yes</li>
305<li>Hurts performance: no</li>
306</ul>
307</dd>
308</dl>
309<p>This is equivalent to the proposed solution.</p>
310<p>Some say it is better because the extension is static.</p>
311</div>
312<div class="section" id="easily-fetchable-eapi-inside-the-ebuild">
313<h2><a class="toc-backref" href="#id16">Easily fetchable EAPI inside the ebuild</a></h2>
314<dl class="docutils">
315<dt>Properties:</dt>
316<dd><ul class="first last simple">
317<li>Can be used right away: no</li>
318<li>Hurts performance: yes</li>
319</ul>
320</dd>
321</dl>
322<p>Cannot be used right away as it would trigger the errors shown in Current
323behaviour section for old package managers.</p>
324<p>Performance decrease comes from the fact that with version format changes in the
325picture package managers need EAPI to parse the ebuild's version. That means that merely
326picking the best version of a package requires loading EAPI (from cache or the
327ebuild) for each available ebuild.</p>
328<p>Here is more or less how the package manager figures out the best available
329version for a package with N versions available.</p>
204<blockquote> 330<blockquote>
331<ul class="simple">
332<li>EAPI in the filename<ul>
333<li>Read the directory containing the package - readdir()</li>
334<li>For each ebuild, read its EAPI and using that parse its version - no I/O</li>
335<li>Sort the versions - no I/O</li>
336<li>Going down from the highest to the lowest version<ul>
337<li>Get the metadata from cache - 2 x stat() + read()</li>
338<li>break if the version is visible</li>
205<ul> 339</ul>
340</li>
341</ul>
342</li>
343<li>EAPI in the ebuild<ul>
344<li>Read the directory containing the package - readdir()</li>
345<li>For each ebuild load its metadata from cache to get its EAPI - N x (2 x stat() + read())</li>
346<li>Sort the versions - no I/O</li>
347<li>Going down from the highest to the lowest version<ul>
348<li>(metadata is already loaded) - no I/O</li>
349<li>break if the version is visible - no I/O</li>
350</ul>
351</li>
352</ul>
353</li>
354</ul>
355</blockquote>
356<p>The difference is in for how many versions the package manager needs to hit
357cache. With EAPI in the ebuild it needs to do that for all versions, with EAPI
358in the filename it depends on versions visibility.
359For example, package foo has versions 1, 2, 3, 4, 5 and 6. 6 is masked, 5 is
360~arch and 1,2,3 and 4 are arch. Say, the user accepts only arch for this
361package. With EAPI in the filename it will read metadata only for versions
3626, 5 and 4. With EAPI in the ebuild it needs to load metadata for all versions.</p>
363<p>It's hard to say what's the avarage case, but surely the worst case scenario
364(when only the lowest version is visible) is uncommon.</p>
365</div>
366<div class="section" id="easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change">
367<h2><a class="toc-backref" href="#id17">Easily fetchable EAPI inside the ebuild and one-time extension change</a></h2>
206<li><dl class="first docutils"> 368<dl class="docutils">
207<dt>Set the EAPI inside the ebuild in a way that makes it easy to fetch it</dt> 369<dt>Properties:</dt>
208<dd><ul class="first last simple"> 370<dd><ul class="first last simple">
209<li>Doesn't meet the backward compatibility requirement.</li> 371<li>Can be used right away: yes</li>
210<li>Isn't forward compatible either.</li> 372<li>Hurts performance: yes</li>
211<li>Could be confusing as ebuilds, and not without a reason, are
212considered bash scripts and this would impose additional restrictions.</li>
213</ul>
214</dd>
215</dl> 373</ul>
374</dd>
216</li> 375</dl>
376<p>Performance decrease as described in the previous section.</p>
377<p>Some say it is clear and simple, others that it is confusing and unintuitive,
378because of the arbitrary format restrictions in what is a bash script otherwise.</p>
379</div>
380<div class="section" id="use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix">
381<h2><a class="toc-backref" href="#id18">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></h2>
217<li><dl class="first docutils"> 382<dl class="docutils">
218<dt>Do the above and change the ebuild extension to <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt></dt> 383<dt>Properties:</dt>
219<dd><ul class="first last simple"> 384<dd><ul class="first last simple">
220<li>Meets the backward compatibility requirement.</li> 385<li>Can be used right away: yes</li>
221<li>Still can be confusing.</li> 386<li>Hurts performance: yes</li>
222<li>Isn't really forward compatible. What would be after <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt>?
223<tt class="docutils literal"><span class="pre">.ebuild-ng-ng</span></tt>?</li>
224</ul>
225</dd>
226</dl> 387</ul>
388</dd>
227</li> 389</dl>
228<li><dl class="first docutils"> 390<p>Performance decrease comes from the fact that it adds several more directory
229<dt>Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</dt> 391reads.</p>
230<dd><ul class="first last simple">
231<li>Meets both requirements.</li>
232<li>Introduces a noticeable performance hit (several more directory reads
233in an I/O bound operation).</li>
234<li>Makes it much harder for maintainers to see what they have.</li> 392<p>Some say that it makes it much harder for maintainers to see what they have.</p>
235</ul>
236</dd>
237</dl>
238</li>
239</ul>
240</blockquote>
241</div> 393</div>
242<div class="section"> 394</div>
395<div class="section" id="references">
243<h1><a class="toc-backref" href="#id10" id="references" name="references">References</a></h1> 396<h1><a class="toc-backref" href="#id19">References</a></h1>
244<table class="docutils footnote" frame="void" id="glep54" rules="none"> 397<table class="docutils footnote" frame="void" id="glep54" rules="none">
245<colgroup><col class="label" /><col /></colgroup> 398<colgroup><col class="label" /><col /></colgroup>
246<tbody valign="top"> 399<tbody valign="top">
247<tr><td class="label"><a class="fn-backref" href="#id1" name="glep54">[1]</a></td><td>GLEP 54, scm package version suffix 400<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>GLEP 54, scm package version suffix
248(<a class="reference" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr> 401(<a class="reference external" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr>
249</tbody> 402</tbody>
250</table> 403</table>
251<table class="docutils footnote" frame="void" id="portageproblems" rules="none"> 404<table class="docutils footnote" frame="void" id="portageproblems" rules="none">
252<colgroup><col class="label" /><col /></colgroup> 405<colgroup><col class="label" /><col /></colgroup>
253<tbody valign="top"> 406<tbody valign="top">
254<tr><td class="label"><a class="fn-backref" href="#id2" name="portageproblems">[2]</a></td><td>Common portage problems 407<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>Common portage problems
255(<a class="reference" href="http://www.gentoo.org/proj/en/portage/doc/common-problems.xml">http://www.gentoo.org/proj/en/portage/doc/common-problems.xml</a>)</td></tr> 408(<a class="reference external" href="http://www.gentoo.org/proj/en/portage/doc/common-problems.xml">http://www.gentoo.org/proj/en/portage/doc/common-problems.xml</a>)</td></tr>
256</tbody> 409</tbody>
257</table> 410</table>
258</div> 411</div>
259<div class="section"> 412<div class="section" id="copyright">
260<h1><a class="toc-backref" href="#id11" id="copyright" name="copyright">Copyright</a></h1> 413<h1><a class="toc-backref" href="#id20">Copyright</a></h1>
261<p>This document has been placed in the public domain.</p> 414<p>This document has been placed in the public domain.</p>
262<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : --> 415<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
263</div> 416</div>
264 417
265</div> 418</div>
266<div class="footer"> 419<div class="footer">
267<hr class="footer" /> 420<hr class="footer" />
268<a class="reference" href="glep-0055.txt">View document source</a>. 421<a class="reference external" href="glep-0055.txt">View document source</a>.
269Generated on: 2008-01-05 02:38 UTC. 422Generated on: 2010-04-07 22:12 UTC.
270Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. 423Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
271 424
272</div> 425</div>
273</body> 426</body>
274</html> 427</html>
275

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20