Gentoo Archives: gentoo-commits

From: "Piotr Jaroszynski (peper)" <peper@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/en/glep: glep-0055.html gleps.xml
Date: Sat, 05 Jan 2008 02:43:05
Message-Id: E1JAyzz-00048p-N4@stork.gentoo.org
1 peper 08/01/05 02:42:59
2
3 Modified: gleps.xml
4 Added: glep-0055.html
5 Log:
6 Add GLEP 55 html.
7
8 Revision Changes Path
9 1.13 xml/htdocs/proj/en/glep/gleps.xml
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/glep/gleps.xml?rev=1.13&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/glep/gleps.xml?rev=1.13&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/glep/gleps.xml?r1=1.12&r2=1.13
14
15 Index: gleps.xml
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/glep/gleps.xml,v
18 retrieving revision 1.12
19 retrieving revision 1.13
20 diff -u -r1.12 -r1.13
21 --- gleps.xml 19 Dec 2007 04:11:00 -0000 1.12
22 +++ gleps.xml 5 Jan 2008 02:42:59 -0000 1.13
23 @@ -1,5 +1,5 @@
24 <?xml version='1.0' encoding="UTF-8"?>
25 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/glep/gleps.xml,v 1.12 2007/12/19 04:11:00 antarus Exp $ -->
26 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/glep/gleps.xml,v 1.13 2008/01/05 02:42:59 peper Exp $ -->
27 <!DOCTYPE gleps SYSTEM "/dtd/gleps.dtd">
28
29 <gleps>
30 @@ -166,5 +166,8 @@
31 <glep file="glep-0054.html" id="54" type="S" status="D">
32 scm package version suffix
33 </glep>
34 +<glep file="glep-0055.html" id="55" type="S" status="D">
35 + Use EAPI-suffixed ebuilds (.ebuild-EAPI)
36 +</glep>
37
38 </gleps>
39
40
41
42 1.1 xml/htdocs/proj/en/glep/glep-0055.html
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/glep/glep-0055.html?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/glep/glep-0055.html?rev=1.1&content-type=text/plain
46
47 Index: glep-0055.html
48 ===================================================================
49 <?xml version="1.0" encoding="utf-8" ?>
50 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
51 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
52 <!--
53 This HTML is auto-generated. DO NOT EDIT THIS FILE! If you are writing a new
54 PEP, see http://www.python.org/peps/pep-0001.html for instructions and links
55 to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE!
56 -->
57 <head>
58 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
59 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
60 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title>
61 <link rel="stylesheet" href="tools/glep.css" type="text/css" />
62 </head>
63 <body bgcolor="white">
64 <table class="navigation" cellpadding="0" cellspacing="0"
65 width="100%" border="0">
66 <tr><td class="navicon" width="150" height="35">
67 <a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
68 <img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]"
69 border="0" width="150" height="35" /></a></td>
70 <td class="textlinks" align="left">
71 [<b><a href="http://www.gentoo.org/">Gentoo Linux Home</a></b>]
72 [<b><a href="http://www.gentoo.org/peps">GLEP Index</a></b>]
73 [<b><a href="http://www.gentoo.org/proj/en/glep/glep-0055.txt">GLEP Source</a></b>]
74 </td></tr></table>
75 <table class="rfc2822 docutils field-list" frame="void" rules="none">
76 <col class="field-name" />
77 <col class="field-body" />
78 <tbody valign="top">
79 <tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
80 </tr>
81 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
82 </tr>
83 <tr class="field"><th class="field-name">Version:</th><td class="field-body">1.1</td>
84 </tr>
85 <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>
86 </tr>
87 <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>
88 </tr>
89 <tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
90 </tr>
91 <tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
92 </tr>
93 <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>
94 </tr>
95 <tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td>
96 </tr>
97 <tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007</td>
98 </tr>
99 </tbody>
100 </table>
101 <hr />
102 <div class="contents topic">
103 <p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
104 <ul class="simple">
105 <li><a class="reference" href="#abstract" id="id3" name="id3">Abstract</a></li>
106 <li><a class="reference" href="#problem" id="id4" name="id4">Problem</a></li>
107 <li><a class="reference" href="#abstract-solution" id="id5" name="id5">Abstract solution</a></li>
108 <li><a class="reference" href="#proposed-solution" id="id6" name="id6">Proposed solution</a></li>
109 <li><a class="reference" href="#specification" id="id7" name="id7">Specification</a></li>
110 <li><a class="reference" href="#application" id="id8" name="id8">Application</a></li>
111 <li><a class="reference" href="#other-ideas" id="id9" name="id9">Other ideas</a></li>
112 <li><a class="reference" href="#references" id="id10" name="id10">References</a></li>
113 <li><a class="reference" href="#copyright" id="id11" name="id11">Copyright</a></li>
114 </ul>
115 </div>
116 <blockquote>
117 <p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
118 spring: there shallow draughts intoxicate the brain, and drinking largely
119 sobers us again.&quot;</p>
120 <p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p>
121 </blockquote>
122 <div class="section">
123 <h1><a class="toc-backref" href="#id3" id="abstract" name="abstract">Abstract</a></h1>
124 <p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for
125 example, foo-1.2.3.ebuild-1).</p>
126 </div>
127 <div class="section">
128 <h1><a class="toc-backref" href="#id4" id="problem" name="problem">Problem</a></h1>
129 <p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the
130 EAPI the package manager needs to source the ebuild, which itself needs the EAPI
131 in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
132 using any of the future EAPIs, will have to be source'able by old package
133 managers and hence there is no way to:</p>
134 <blockquote>
135 <ul class="simple">
136 <li>Change behaviour of inherit in any way (for example, to extend or change
137 eclass functionality).</li>
138 <li>Add new global scope functions in any sane way.</li>
139 <li>Extend versioning rules in an EAPI - for example, addition of the scm
140 suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1" name="id1">[1]</a>.</li>
141 </ul>
142 </blockquote>
143 </div>
144 <div class="section">
145 <h1><a class="toc-backref" href="#id5" id="abstract-solution" name="abstract-solution">Abstract solution</a></h1>
146 <p>A solution to this problem has to lift those limitations and the only way to do
147 it is to make the EAPI of an ebuild available to the package managers in a way
148 that doesn't require them to source the ebuild. Another important requirement is
149 for the solution to be backward compatible, which has the pleasant side-effect
150 of making the solution applicable in the Gentoo tree right away. Opposed to
151 waiting an arbitrary amount of time, which is never long enough anyway, as the
152 issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2" name="id2">[2]</a> - show.</p>
153 </div>
154 <div class="section">
155 <h1><a class="toc-backref" href="#id6" id="proposed-solution" name="proposed-solution">Proposed solution</a></h1>
156 <p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
157 allows package managers to trivially read the EAPI from the ebuild filename. It
158 is also backward compatible, because currently ebuilds are recognised by the
159 <tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by
160 the package managers.</p>
161 </div>
162 <div class="section">
163 <h1><a class="toc-backref" href="#id7" id="specification" name="specification">Specification</a></h1>
164 <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
165 optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p>
166 <p>Let's call the EAPI included in the ebuild filename the pre-source EAPI, and the
167 EAPI set inside the ebuild the post-source EAPI. Given these two, the final EAPI
168 used by the ebuild can be established by following these steps:</p>
169 <blockquote>
170 <ul class="simple">
171 <li>If the pre-source EAPI is not set it defaults to 0.</li>
172 <li>If the pre-source EAPI is not recognised it is returned immediately.</li>
173 <li>If the post-source EAPI is not set, it defaults to the pre-source EAPI.</li>
174 <li>post-source EAPI is returned.</li>
175 </ul>
176 </blockquote>
177 <p>The above process should be only used to generate the metadata cache. Should the
178 pre-source EAPI be unsupported the cache entry cannot be generated.</p>
179 <p>Ebuilds with unsupported EAPIs are masked.</p>
180 <p>QA tools should consider it an error for both EAPIs to be set explicitly to
181 different values. Package managers may warn, but must use the post-source EAPI
182 in such cases.</p>
183 <p>Examples:</p>
184 <blockquote>
185 <ul>
186 <li><dl class="first docutils">
187 <dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt>
188 <dd><p class="first last">pre-source EAPI defaults 0, post-source EAPI defaults to pre-source EAPI.
189 EAPI 0 is used.</p>
190 </dd>
191 </dl>
192 </li>
193 <li><dl class="first docutils">
194 <dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt>
195 <dd><p class="first last">pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI.
196 EAPI 1 is used.</p>
197 </dd>
198 </dl>
199 </li>
200 <li><dl class="first docutils">
201 <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>
202 <dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 1.
203 EAPI 1 is used.</p>
204 </dd>
205 </dl>
206 </li>
207 <li><dl class="first docutils">
208 <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>
209 <dd><p class="first last">pre-source EAPI is 2, post-source EAPI is 1.
210 EAPI 1 is used, but note that one should <strong>never</strong> explicitly set both
211 EAPIs to different values.</p>
212 </dd>
213 </dl>
214 </li>
215 <li><dl class="first docutils">
216 <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>
217 <dd><p class="first last">pre-source EAPI is 2, post-source EAPI is never checked.
218 ebuild masked because of the unsupported pre-source EAPI.</p>
219 </dd>
220 </dl>
221 </li>
222 <li><dl class="first docutils">
223 <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>
224 <dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 2 (assuming the
225 package manager didn't die when sourcing the ebuild thinking that EAPI 0
226 is used).
227 ebuild masked because of the unsupported post-source EAPI.</p>
228 </dd>
229 </dl>
230 </li>
231 </ul>
232 </blockquote>
233 <p>Note that it is still not permitted to have more than one ebuild with equal
234 category, package name, and version. Although it would have the advantage of
235 allowing to provide backward compatible ebuilds, it would introduce problems
236 too. The first is the requirement to have strict EAPI ordering, the second is
237 ensuring that all the ebuilds for a single category/package-version are
238 equivalent, i.e. installing any of them has exactly the same effect to the
239 system.</p>
240 </div>
241 <div class="section">
242 <h1><a class="toc-backref" href="#id8" id="application" name="application">Application</a></h1>
243 <p>Note that the developers should only set the pre-source EAPI. The process
244 described above is only necessary to avoid undefined behaviour in corner cases
245 and to retain backwards compatibility.</p>
246 <p>QA tools may warn if the post-source EAPI is set at all, thus helping with the
247 transition to the new format.</p>
248 </div>
249 <div class="section">
250 <h1><a class="toc-backref" href="#id9" id="other-ideas" name="other-ideas">Other ideas</a></h1>
251 <p>There were some other solutions proposed on the mailing list:</p>
252 <blockquote>
253 <ul>
254 <li><dl class="first docutils">
255 <dt>Set the EAPI inside the ebuild in a way that makes it easy to fetch it</dt>
256 <dd><ul class="first last simple">
257 <li>Doesn't meet the backward compatibility requirement.</li>
258 <li>Isn't forward compatible either.</li>
259 <li>Could be confusing as ebuilds, and not without a reason, are
260 considered bash scripts and this would impose additional restrictions.</li>
261 </ul>
262 </dd>
263 </dl>
264 </li>
265 <li><dl class="first docutils">
266 <dt>Do the above and change the ebuild extension to <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt></dt>
267 <dd><ul class="first last simple">
268 <li>Meets the backward compatibility requirement.</li>
269 <li>Still can be confusing.</li>
270 <li>Isn't really forward compatible. What would be after <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt>?
271 <tt class="docutils literal"><span class="pre">.ebuild-ng-ng</span></tt>?</li>
272 </ul>
273 </dd>
274 </dl>
275 </li>
276 <li><dl class="first docutils">
277 <dt>Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</dt>
278 <dd><ul class="first last simple">
279 <li>Meets both requirements.</li>
280 <li>Introduces a noticeable performance hit (several more directory reads
281 in an I/O bound operation).</li>
282 <li>Makes it much harder for maintainers to see what they have.</li>
283 </ul>
284 </dd>
285 </dl>
286 </li>
287 </ul>
288 </blockquote>
289 </div>
290 <div class="section">
291 <h1><a class="toc-backref" href="#id10" id="references" name="references">References</a></h1>
292 <table class="docutils footnote" frame="void" id="glep54" rules="none">
293 <colgroup><col class="label" /><col /></colgroup>
294 <tbody valign="top">
295 <tr><td class="label"><a class="fn-backref" href="#id1" name="glep54">[1]</a></td><td>GLEP 54, scm package version suffix
296 (<a class="reference" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr>
297 </tbody>
298 </table>
299 <table class="docutils footnote" frame="void" id="portageproblems" rules="none">
300 <colgroup><col class="label" /><col /></colgroup>
301 <tbody valign="top">
302 <tr><td class="label"><a class="fn-backref" href="#id2" name="portageproblems">[2]</a></td><td>Common portage problems
303 (<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>
304 </tbody>
305 </table>
306 </div>
307 <div class="section">
308 <h1><a class="toc-backref" href="#id11" id="copyright" name="copyright">Copyright</a></h1>
309 <p>This document has been placed in the public domain.</p>
310 <!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
311 </div>
312
313 </div>
314 <div class="footer">
315 <hr class="footer" />
316 <a class="reference" href="glep-0055.txt">View document source</a>.
317 Generated on: 2008-01-05 02:38 UTC.
318 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.
319
320 </div>
321 </body>
322 </html>
323
324
325
326
327 --
328 gentoo-commits@g.o mailing list