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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.1 - (show annotations) (download) (as text)
Sat Jan 5 02:42:59 2008 UTC (10 years, 5 months ago) by peper
Branch: MAIN
File MIME type: text/html
Add GLEP 55 html.

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">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <!--
5 This HTML is auto-generated. DO NOT EDIT THIS FILE! If you are writing a new
6 PEP, see http://www.python.org/peps/pep-0001.html for instructions and links
8 -->
9 <head>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
12 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title>
13 <link rel="stylesheet" href="tools/glep.css" type="text/css" />
14 </head>
15 <body bgcolor="white">
16 <table class="navigation" cellpadding="0" cellspacing="0"
17 width="100%" border="0">
18 <tr><td class="navicon" width="150" height="35">
19 <a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
20 <img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]"
21 border="0" width="150" height="35" /></a></td>
22 <td class="textlinks" align="left">
23 [<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>]
25 [<b><a href="http://www.gentoo.org/proj/en/glep/glep-0055.txt">GLEP Source</a></b>]
26 </td></tr></table>
27 <table class="rfc2822 docutils field-list" frame="void" rules="none">
28 <col class="field-name" />
29 <col class="field-body" />
30 <tbody valign="top">
31 <tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
32 </tr>
33 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
34 </tr>
35 <tr class="field"><th class="field-name">Version:</th><td class="field-body">1.1</td>
36 </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>
38 </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>
40 </tr>
41 <tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
42 </tr>
43 <tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
44 </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>
46 </tr>
47 <tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td>
48 </tr>
49 <tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007</td>
50 </tr>
51 </tbody>
52 </table>
53 <hr />
54 <div class="contents topic">
55 <p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
56 <ul class="simple">
57 <li><a class="reference" href="#abstract" id="id3" name="id3">Abstract</a></li>
58 <li><a class="reference" href="#problem" id="id4" name="id4">Problem</a></li>
59 <li><a class="reference" href="#abstract-solution" id="id5" name="id5">Abstract solution</a></li>
60 <li><a class="reference" href="#proposed-solution" id="id6" name="id6">Proposed solution</a></li>
61 <li><a class="reference" href="#specification" id="id7" name="id7">Specification</a></li>
62 <li><a class="reference" href="#application" id="id8" name="id8">Application</a></li>
63 <li><a class="reference" href="#other-ideas" id="id9" name="id9">Other ideas</a></li>
64 <li><a class="reference" href="#references" id="id10" name="id10">References</a></li>
65 <li><a class="reference" href="#copyright" id="id11" name="id11">Copyright</a></li>
66 </ul>
67 </div>
68 <blockquote>
69 <p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
70 spring: there shallow draughts intoxicate the brain, and drinking largely
71 sobers us again.&quot;</p>
72 <p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p>
73 </blockquote>
74 <div class="section">
75 <h1><a class="toc-backref" href="#id3" id="abstract" name="abstract">Abstract</a></h1>
76 <p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for
77 example, foo-1.2.3.ebuild-1).</p>
78 </div>
79 <div class="section">
80 <h1><a class="toc-backref" href="#id4" id="problem" name="problem">Problem</a></h1>
81 <p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the
82 EAPI the package manager needs to source the ebuild, which itself needs the EAPI
83 in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
84 using any of the future EAPIs, will have to be source'able by old package
85 managers and hence there is no way to:</p>
86 <blockquote>
87 <ul class="simple">
88 <li>Change behaviour of inherit in any way (for example, to extend or change
89 eclass functionality).</li>
90 <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
92 suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1" name="id1">[1]</a>.</li>
93 </ul>
94 </blockquote>
95 </div>
96 <div class="section">
97 <h1><a class="toc-backref" href="#id5" id="abstract-solution" name="abstract-solution">Abstract solution</a></h1>
98 <p>A solution to this problem has to lift those limitations and the only way to do
99 it is to make the EAPI of an ebuild available to the package managers in a way
100 that doesn't require them to source the ebuild. Another important requirement is
101 for the solution to be backward compatible, which has the pleasant side-effect
102 of making the solution applicable in the Gentoo tree right away. Opposed to
103 waiting an arbitrary amount of time, which is never long enough anyway, as the
104 issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2" name="id2">[2]</a> - show.</p>
105 </div>
106 <div class="section">
107 <h1><a class="toc-backref" href="#id6" id="proposed-solution" name="proposed-solution">Proposed solution</a></h1>
108 <p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
109 allows package managers to trivially read the EAPI from the ebuild filename. It
110 is also backward 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
112 the package managers.</p>
113 </div>
114 <div class="section">
115 <h1><a class="toc-backref" href="#id7" id="specification" name="specification">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
117 optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></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
119 EAPI set inside the ebuild the post-source EAPI. Given these two, the final EAPI
120 used by the ebuild can be established by following these steps:</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
130 pre-source EAPI be unsupported the cache entry cannot be generated.</p>
131 <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
133 different values. Package managers may warn, but must use the post-source EAPI
134 in such cases.</p>
135 <p>Examples:</p>
136 <blockquote>
137 <ul>
138 <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>
140 <dd><p class="first last">pre-source EAPI defaults 0, post-source EAPI defaults to pre-source EAPI.
141 EAPI 0 is used.</p>
142 </dd>
143 </dl>
144 </li>
145 <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>
147 <dd><p class="first last">pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI.
148 EAPI 1 is used.</p>
149 </dd>
150 </dl>
151 </li>
152 <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>
154 <dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 1.
155 EAPI 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.
162 EAPI 1 is used, but note that one should <strong>never</strong> explicitly set both
163 EAPIs 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.
170 ebuild 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
177 package manager didn't die when sourcing the ebuild thinking that EAPI 0
178 is used).
179 ebuild masked because of the unsupported post-source EAPI.</p>
180 </dd>
181 </dl>
182 </li>
183 </ul>
184 </blockquote>
185 <p>Note that it is still not permitted to have more than one ebuild with equal
186 category, package name, and version. Although it would have the advantage of
187 allowing to provide backward compatible ebuilds, it would introduce problems
188 too. The first is the requirement to have strict EAPI ordering, the second is
189 ensuring that all the ebuilds for a single category/package-version are
190 equivalent, i.e. installing any of them has exactly the same effect to the
191 system.</p>
192 </div>
193 <div class="section">
194 <h1><a class="toc-backref" href="#id8" id="application" name="application">Application</a></h1>
195 <p>Note that the developers should only set the pre-source EAPI. The process
196 described above is only necessary to avoid undefined behaviour in corner cases
197 and to retain backwards compatibility.</p>
198 <p>QA tools may warn if the post-source EAPI is set at all, thus helping with the
199 transition to the new format.</p>
200 </div>
201 <div class="section">
202 <h1><a class="toc-backref" href="#id9" id="other-ideas" name="other-ideas">Other ideas</a></h1>
203 <p>There were some other solutions proposed on the mailing list:</p>
204 <blockquote>
205 <ul>
206 <li><dl class="first docutils">
207 <dt>Set the EAPI inside the ebuild in a way that makes it easy to fetch it</dt>
208 <dd><ul class="first last simple">
209 <li>Doesn't meet the backward compatibility requirement.</li>
210 <li>Isn't forward compatible either.</li>
211 <li>Could be confusing as ebuilds, and not without a reason, are
212 considered bash scripts and this would impose additional restrictions.</li>
213 </ul>
214 </dd>
215 </dl>
216 </li>
217 <li><dl class="first docutils">
218 <dt>Do the above and change the ebuild extension to <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt></dt>
219 <dd><ul class="first last simple">
220 <li>Meets the backward compatibility requirement.</li>
221 <li>Still can be confusing.</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>
227 </li>
228 <li><dl class="first docutils">
229 <dt>Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</dt>
230 <dd><ul class="first last simple">
231 <li>Meets both requirements.</li>
232 <li>Introduces a noticeable performance hit (several more directory reads
233 in an I/O bound operation).</li>
234 <li>Makes it much harder for maintainers to see what they have.</li>
235 </ul>
236 </dd>
237 </dl>
238 </li>
239 </ul>
240 </blockquote>
241 </div>
242 <div class="section">
243 <h1><a class="toc-backref" href="#id10" id="references" name="references">References</a></h1>
244 <table class="docutils footnote" frame="void" id="glep54" rules="none">
245 <colgroup><col class="label" /><col /></colgroup>
246 <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
248 (<a class="reference" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr>
249 </tbody>
250 </table>
251 <table class="docutils footnote" frame="void" id="portageproblems" rules="none">
252 <colgroup><col class="label" /><col /></colgroup>
253 <tbody valign="top">
254 <tr><td class="label"><a class="fn-backref" href="#id2" name="portageproblems">[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>
256 </tbody>
257 </table>
258 </div>
259 <div class="section">
260 <h1><a class="toc-backref" href="#id11" id="copyright" name="copyright">Copyright</a></h1>
261 <p>This document has been placed in the public domain.</p>
262 <!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
263 </div>
265 </div>
266 <div class="footer">
267 <hr class="footer" />
268 <a class="reference" href="glep-0055.txt">View document source</a>.
269 Generated on: 2008-01-05 02:38 UTC.
270 Generated 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.
272 </div>
273 </body>
274 </html>

  ViewVC Help
Powered by ViewVC 1.1.20