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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download) (as text)
Sun May 17 20:56:53 2009 UTC (5 years, 4 months ago) by peper
Branch: MAIN
Changes since 1.4: +44 -3 lines
File MIME type: text/html
Add a more detailed description of the performance hit.

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 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
8 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title>
9 <style type="text/css">
10
11 /*
12 :Author: David Goodger
13 :Contact: goodger@users.sourceforge.net
14 :date: $Date: 2003/06/02 17:03:08 $
15 :version: $Revision: 1.1 $
16 :copyright: This stylesheet has been placed in the public domain.
17
18 Default cascading style sheet for the PEP HTML output of Docutils.
19 */
20
21 .first {
22 margin-top: 0 }
23
24 .last {
25 margin-bottom: 0 }
26
27 .navigation {
28 width: 100% ;
29 background: #cc99ff ;
30 margin-top: 0px ;
31 margin-bottom: 0px }
32
33 .navigation .navicon {
34 width: 150px ;
35 height: 35px }
36
37 .navigation .textlinks {
38 padding-left: 1em ;
39 text-align: left }
40
41 .navigation td, .navigation th {
42 padding-left: 0em ;
43 padding-right: 0em ;
44 vertical-align: middle }
45
46 .rfc2822 {
47 margin-top: 0.5em ;
48 margin-left: 0.5em ;
49 margin-right: 0.5em ;
50 margin-bottom: 0em }
51
52 .rfc2822 td {
53 text-align: left }
54
55 .rfc2822 th.field-name {
56 text-align: right ;
57 font-family: sans-serif ;
58 padding-right: 0.5em ;
59 font-weight: bold ;
60 margin-bottom: 0em }
61
62 a.toc-backref {
63 text-decoration: none ;
64 color: black }
65
66 body {
67 margin: 0px ;
68 margin-bottom: 1em ;
69 padding: 0px }
70
71 dd {
72 margin-bottom: 0.5em }
73
74 div.section {
75 margin-left: 1em ;
76 margin-right: 1em ;
77 margin-bottom: 1.5em }
78
79 div.section div.section {
80 margin-left: 0em ;
81 margin-right: 0em ;
82 margin-top: 1.5em }
83
84 div.abstract {
85 margin: 2em 5em }
86
87 div.abstract p.topic-title {
88 font-weight: bold ;
89 text-align: center }
90
91 div.attention, div.caution, div.danger, div.error, div.hint,
92 div.important, div.note, div.tip, div.warning {
93 margin: 2em ;
94 border: medium outset ;
95 padding: 1em }
96
97 div.attention p.admonition-title, div.caution p.admonition-title,
98 div.danger p.admonition-title, div.error p.admonition-title,
99 div.warning p.admonition-title {
100 color: red ;
101 font-weight: bold ;
102 font-family: sans-serif }
103
104 div.hint p.admonition-title, div.important p.admonition-title,
105 div.note p.admonition-title, div.tip p.admonition-title {
106 font-weight: bold ;
107 font-family: sans-serif }
108
109 div.figure {
110 margin-left: 2em }
111
112 div.footer, div.header {
113 font-size: smaller }
114
115 div.footer {
116 margin-left: 1em ;
117 margin-right: 1em }
118
119 div.system-messages {
120 margin: 5em }
121
122 div.system-messages h1 {
123 color: red }
124
125 div.system-message {
126 border: medium outset ;
127 padding: 1em }
128
129 div.system-message p.system-message-title {
130 color: red ;
131 font-weight: bold }
132
133 div.topic {
134 margin: 2em }
135
136 h1 {
137 font-family: sans-serif ;
138 font-size: large }
139
140 h2 {
141 font-family: sans-serif ;
142 font-size: medium }
143
144 h3 {
145 font-family: sans-serif ;
146 font-size: small }
147
148 h4 {
149 font-family: sans-serif ;
150 font-style: italic ;
151 font-size: small }
152
153 h5 {
154 font-family: sans-serif;
155 font-size: x-small }
156
157 h6 {
158 font-family: sans-serif;
159 font-style: italic ;
160 font-size: x-small }
161
162 .section hr {
163 width: 75% }
164
165 ol.simple, ul.simple {
166 margin-bottom: 1em }
167
168 ol.arabic {
169 list-style: decimal }
170
171 ol.loweralpha {
172 list-style: lower-alpha }
173
174 ol.upperalpha {
175 list-style: upper-alpha }
176
177 ol.lowerroman {
178 list-style: lower-roman }
179
180 ol.upperroman {
181 list-style: upper-roman }
182
183 p.caption {
184 font-style: italic }
185
186 p.credits {
187 font-style: italic ;
188 font-size: smaller }
189
190 p.label {
191 white-space: nowrap }
192
193 p.topic-title {
194 font-family: sans-serif ;
195 font-weight: bold }
196
197 pre.line-block {
198 font-family: serif ;
199 font-size: 100% }
200
201 pre.literal-block, pre.doctest-block {
202 margin-left: 2em ;
203 margin-right: 2em ;
204 background-color: #eeeeee }
205
206 span.classifier {
207 font-family: sans-serif ;
208 font-style: oblique }
209
210 span.classifier-delimiter {
211 font-family: sans-serif ;
212 font-weight: bold }
213
214 span.interpreted {
215 font-family: sans-serif }
216
217 span.option-argument {
218 font-style: italic }
219
220 span.pre {
221 white-space: pre }
222
223 span.problematic {
224 color: red }
225
226 table {
227 margin-top: 0.5em ;
228 margin-bottom: 0.5em }
229
230 td, th {
231 padding-left: 0.5em ;
232 padding-right: 0.5em ;
233 vertical-align: top }
234
235 td.num {
236 text-align: right }
237
238 th.field-name {
239 font-weight: bold ;
240 text-align: left ;
241 white-space: nowrap }
242
243 h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
244 font-size: 100% }
245
246 tt {
247 background-color: #eeeeee }
248
249 ul.auto-toc {
250 list-style-type: none }
251
252 </style></head>
253 <body bgcolor="white">
254 <table class="navigation" cellpadding="0" cellspacing="0"
255 width="100%" border="0">
256 <tr><td class="navicon" width="150" height="35">
257 <a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
258 <img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]"
259 border="0" width="150" height="35" /></a></td>
260 <td class="textlinks" align="left">
261 [<b><a href="http://www.gentoo.org/">Gentoo Linux Home</a></b>]
262 [<b><a href="http://www.gentoo.org/proj/en/glep">GLEP Index</a></b>]
263 [<b><a href="http://www.gentoo.org/proj/en/glep/glep-0055.txt">GLEP Source</a></b>]
264 </td></tr></table>
265 <table class="rfc2822 docutils field-list" frame="void" rules="none">
266 <col class="field-name" />
267 <col class="field-body" />
268 <tbody valign="top">
269 <tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
270 </tr>
271 <tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
272 </tr>
273 <tr class="field"><th class="field-name">Version:</th><td class="field-body">1.4</td>
274 </tr>
275 <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 17:00:30</a></td>
276 </tr>
277 <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>
278 </tr>
279 <tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
280 </tr>
281 <tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
282 </tr>
283 <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>
284 </tr>
285 <tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td>
286 </tr>
287 <tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007, 17-May-2009</td>
288 </tr>
289 </tbody>
290 </table>
291 <hr />
292 <div class="contents topic" id="contents">
293 <p class="topic-title first">Contents</p>
294 <ul class="simple">
295 <li><a class="reference internal" href="#abstract" id="id3">Abstract</a></li>
296 <li><a class="reference internal" href="#problem" id="id4">Problem</a></li>
297 <li><a class="reference internal" href="#current-behaviour" id="id5">Current behaviour</a><ul>
298 <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>
299 <li><a class="reference internal" href="#new-global-scope-function" id="id7">New global scope function</a></li>
300 <li><a class="reference internal" href="#new-version-format" id="id8">New version format</a></li>
301 <li><a class="reference internal" href="#use-newer-bash-features" id="id9">Use newer bash features</a></li>
302 </ul>
303 </li>
304 <li><a class="reference internal" href="#abstract-solution" id="id10">Abstract solution</a></li>
305 <li><a class="reference internal" href="#proposed-solution" id="id11">Proposed solution</a></li>
306 <li><a class="reference internal" href="#specification" id="id12">Specification</a></li>
307 <li><a class="reference internal" href="#summary-of-ideas" id="id13">Summary of ideas</a><ul>
308 <li><a class="reference internal" href="#eapi-suffixed-ebuilds-proposed-solution" id="id14">EAPI-suffixed ebuilds (proposed solution)</a></li>
309 <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>
310 <li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild" id="id16">Easily fetchable EAPI inside the ebuild</a></li>
311 <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>
312 <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>
313 </ul>
314 </li>
315 <li><a class="reference internal" href="#references" id="id19">References</a></li>
316 <li><a class="reference internal" href="#copyright" id="id20">Copyright</a></li>
317 </ul>
318 </div>
319 <blockquote>
320 <p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
321 spring: there shallow draughts intoxicate the brain, and drinking largely
322 sobers us again.&quot;</p>
323 <p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p>
324 </blockquote>
325 <div class="section" id="abstract">
326 <h1><a class="toc-backref" href="#id3">Abstract</a></h1>
327 <p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for
328 example, foo-1.2.3.ebuild-1).</p>
329 </div>
330 <div class="section" id="problem">
331 <h1><a class="toc-backref" href="#id4">Problem</a></h1>
332 <p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the
333 EAPI the package manager needs to source the ebuild, which itself needs the EAPI
334 in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
335 using any of the future EAPIs, will have to be source'able by old package
336 managers and hence there is no way to do any of the following:</p>
337 <blockquote>
338 <ul class="simple">
339 <li>Change the behaviour of inherit in any way (for example, to extend or change
340 eclass functionality).</li>
341 <li>Add new global scope functions in any sane way.</li>
342 <li>Extend versioning rules in an EAPI - for example, addition of the scm
343 suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1">[1]</a> or allowing more sensible version formats like
344 <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>
345 <li>Use newer bash features.</li>
346 </ul>
347 </blockquote>
348 </div>
349 <div class="section" id="current-behaviour">
350 <h1><a class="toc-backref" href="#id5">Current behaviour</a></h1>
351 <p>Following subsections show what happens if you introduce any of the mentioned
352 changes in an ebuild and try to install it with portage 2.1.6.13.</p>
353 <div class="section" id="incompatible-change-of-inherit-e-g-make-it-look-in-the-package-dir-too">
354 <h2><a class="toc-backref" href="#id6">Incompatible change of inherit (e.g. make it look in the package dir too)</a></h2>
355 <p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
356 <pre class="literal-block">
357 EAPI=&quot;5&quot;
358 inherit &quot;foo&quot;
359
360 DESCRIPTION=&quot;&quot;
361 HOMEPAGE=&quot;&quot;
362 SRC_URI=&quot;&quot;
363 ...
364 </pre>
365 <p>Result:</p>
366 <pre class="literal-block">
367 *
368 * ERROR: sys-apps/foo-1 failed.
369 * Call stack:
370 * ebuild.sh, line 1879: Called _source_ebuild
371 * ebuild.sh, line 1818: Called source '/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild'
372 * foo-1.ebuild, line 6: Called inherit 'foo'
373 * ebuild.sh, line 1218: Called die
374 * The specific snippet of code:
375 * [ ! -e &quot;$location&quot; ] &amp;&amp; die &quot;${1}.eclass could not be found by inherit()&quot;
376 * The die message:
377 * foo.eclass could not be found by inherit()
378 *
379 * If you need support, post the topmost build error, and the call stack if relevant.
380 * This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
381 *
382
383 !!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
384 !!! One of the following masked packages is required to complete your request:
385 - sys-apps/foo-1 (masked by: corruption)
386 </pre>
387 <p>Current portage looks for eclasses only in the <tt class="docutils literal"><span class="pre">eclass</span></tt> directory of a
388 repository. This results in a fatal error and ebuild being masked by corruption
389 - might be pretty confusing to users.</p>
390 </div>
391 <div class="section" id="new-global-scope-function">
392 <h2><a class="toc-backref" href="#id7">New global scope function</a></h2>
393 <p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
394 <pre class="literal-block">
395 EAPI=&quot;5&quot;
396 new_global_scope_function &quot;foo&quot;
397
398 DESCRIPTION=&quot;&quot;
399 HOMEPAGE=&quot;&quot;
400 SRC_URI=&quot;&quot;
401 ...
402 </pre>
403 <p>Result:</p>
404 <pre class="literal-block">
405 /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 7: new_global_scope_function: command not found
406
407 !!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
408 !!! One of the following masked packages is required to complete your request:
409 - sys-apps/foo-1 (masked by: EAPI 5)
410
411 The current version of portage supports EAPI '2'. You must upgrade to a
412 newer version of portage before EAPI masked packages can be installed.
413 </pre>
414 <p>Not that bad as user is advised to upgrade portage.</p>
415 </div>
416 <div class="section" id="new-version-format">
417 <h2><a class="toc-backref" href="#id8">New version format</a></h2>
418 <p><tt class="docutils literal"><span class="pre">sys-apps/foo-2-rc1.ebuild</span></tt>:</p>
419 <pre class="literal-block">
420 Invalid ebuild name: /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-2-rc1.ebuild
421
422 emerge: there are no ebuilds to satisfy &quot;sys-apps/foo&quot;
423 </pre>
424 <p>Not the best error message, especially if there are lots of them.</p>
425 </div>
426 <div class="section" id="use-newer-bash-features">
427 <h2><a class="toc-backref" href="#id9">Use newer bash features</a></h2>
428 <p><tt class="docutils literal"><span class="pre">|&amp;</span></tt> is a new type of redirection added in bash-4. It cannot be used even in
429 local scope as bash still parses the whole ebuild.</p>
430 <p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
431 <pre class="literal-block">
432 EAPI=&quot;5&quot;
433
434 foo() {
435 echo &quot;foo&quot; |&amp; cat
436 }
437 </pre>
438 <p>Result:</p>
439 <pre class="literal-block">
440 /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: syntax error near unexpected token `&amp;'
441 /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: ` echo &quot;foo&quot; |&amp; cat'
442 *
443 * ERROR: sys-apps/foo-1 failed.
444 * Call stack:
445 * ebuild.sh, line 1879: Called _source_ebuild
446 * ebuild.sh, line 1818: Called die
447 * The specific snippet of code:
448 * source &quot;${EBUILD}&quot; || die &quot;error sourcing ebuild&quot;
449 * The die message:
450 * error sourcing ebuild
451 *
452 * If you need support, post the topmost build error, and the call stack if relevant.
453 * This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
454 * ... done!
455
456 !!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
457 !!! One of the following masked packages is required to complete your request:
458 - sys-apps/foo-1 (masked by: corruption)
459 </pre>
460 <p>Again, not the best error.</p>
461 </div>
462 </div>
463 <div class="section" id="abstract-solution">
464 <h1><a class="toc-backref" href="#id10">Abstract solution</a></h1>
465 <p>A solution to this problem has to lift those limitations and the only way to do
466 it is to make the EAPI of an ebuild available to the package managers in a way
467 that doesn't require them to source the ebuild. Another important requirement is
468 for the solution to be backward compatible, which has the pleasant side-effect
469 of making the solution applicable in the Gentoo tree right away. Opposed to
470 waiting an arbitrary amount of time, which is never long enough anyway, as the
471 issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2">[2]</a> - show.</p>
472 </div>
473 <div class="section" id="proposed-solution">
474 <h1><a class="toc-backref" href="#id11">Proposed solution</a></h1>
475 <p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
476 allows package managers to trivially read the EAPI from the ebuild filename. It
477 is also backwards compatible, because currently ebuilds are recognised by the
478 <tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by
479 the package managers.</p>
480 </div>
481 <div class="section" id="specification">
482 <h1><a class="toc-backref" href="#id12">Specification</a></h1>
483 <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
484 optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p>
485 <p>The EAPI used by the ebuild is the EAPI included in the filename if it is set.
486 Otherwise the EAPI set inside the ebuild is used, which defaults to 0 (this is
487 the current behaviour).</p>
488 <p>Ebuilds with unsupported EAPIs are masked.</p>
489 <p>It should be considered an error to set the EAPI both in the filename and in the
490 ebuild.</p>
491 <p>Examples:</p>
492 <blockquote>
493 <ul>
494 <li><dl class="first docutils">
495 <dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt>
496 <dd><p class="first last">EAPI defaults to 0.</p>
497 </dd>
498 </dl>
499 </li>
500 <li><dl class="first docutils">
501 <dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt>
502 <dd><p class="first last">EAPI 1 is used.</p>
503 </dd>
504 </dl>
505 </li>
506 <li><dl class="first docutils">
507 <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>
508 <dd><p class="first last">EAPI set in both places - error.</p>
509 </dd>
510 </dl>
511 </li>
512 </ul>
513 </blockquote>
514 <p>Note that it is still not permitted to have more than one ebuild with equal
515 category, package name, and version. Although it would have the advantage of
516 allowing authors to provide backwards compatible ebuilds, it would introduce
517 problems too. The first is the requirement to have strict EAPI ordering, the
518 second is ensuring that all the ebuilds for a single category/package-version
519 are equivalent, i.e. installing any of them has exactly the same effect on a
520 given system.</p>
521 <p>Also note that it is not a new restriction. It is already possible to illegally
522 have multiple versions with different EAPIs as e.g. <tt class="docutils literal"><span class="pre">1.0</span> <span class="pre">==</span> <span class="pre">1.00</span> <span class="pre">==</span> <span class="pre">1.00-r0</span></tt>
523 and 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>
524 with EAPI Y.</p>
525 </div>
526 <div class="section" id="summary-of-ideas">
527 <h1><a class="toc-backref" href="#id13">Summary of ideas</a></h1>
528 <div class="section" id="eapi-suffixed-ebuilds-proposed-solution">
529 <h2><a class="toc-backref" href="#id14">EAPI-suffixed ebuilds (proposed solution)</a></h2>
530 <dl class="docutils">
531 <dt>Properties:</dt>
532 <dd><ul class="first last simple">
533 <li>Can be used right away: yes</li>
534 <li>Hurts performance: no</li>
535 </ul>
536 </dd>
537 </dl>
538 <p>Some say it is clear and simple, others that it is ugly and unintuitive.</p>
539 </div>
540 <div class="section" id="eapi-in-the-filename-with-one-time-extension-change">
541 <h2><a class="toc-backref" href="#id15">EAPI in the filename with one-time extension change</a></h2>
542 <p>One of the proposed filename formats:
543 <tt class="docutils literal"><span class="pre">&lt;PKG&gt;-&lt;VER&gt;.eapi-&lt;EAPI&gt;.eb</span></tt></p>
544 <dl class="docutils">
545 <dt>Properties:</dt>
546 <dd><ul class="first last simple">
547 <li>Can be used right away: yes</li>
548 <li>Hurts performance: no</li>
549 </ul>
550 </dd>
551 </dl>
552 <p>This is equivalent to the proposed solution.</p>
553 <p>Some say it is better because the extension is static.</p>
554 </div>
555 <div class="section" id="easily-fetchable-eapi-inside-the-ebuild">
556 <h2><a class="toc-backref" href="#id16">Easily fetchable EAPI inside the ebuild</a></h2>
557 <dl class="docutils">
558 <dt>Properties:</dt>
559 <dd><ul class="first last simple">
560 <li>Can be used right away: no</li>
561 <li>Hurts performance: yes</li>
562 </ul>
563 </dd>
564 </dl>
565 <p>Cannot be used right away as it would trigger the errors shown in Current
566 behaviour section for old package managers.</p>
567 <p>Performance decrease comes from the fact that with version format changes in the
568 picture package managers need EAPI to parse the ebuild's version. That means that merely
569 picking the best version of a package requires loading EAPI (from cache or the
570 ebuild) for each available ebuild.</p>
571 <p>Here is more or less how the package manager figures out the best available
572 version for a package with N versions available.</p>
573 <blockquote>
574 <ul class="simple">
575 <li>EAPI in the filename<ul>
576 <li>Read the directory containing the package - readdir()</li>
577 <li>For each ebuild, read its EAPI and using that parse its version - no I/O</li>
578 <li>Sort the versions - no I/O</li>
579 <li>Going down from the highest to the lowest version<ul>
580 <li>Get the metadata from cache - 2 x stat() + read()</li>
581 <li>break if the version is visible</li>
582 </ul>
583 </li>
584 </ul>
585 </li>
586 <li>EAPI in the ebuild<ul>
587 <li>Read the directory containing the package - readdir()</li>
588 <li>For each ebuild load its metadata from cache to get its EAPI - N x (2 x stat() + read())</li>
589 <li>Sort the versions - no I/O</li>
590 <li>Going down from the highest to the lowest version<ul>
591 <li>(metadata is already loaded) - no I/O</li>
592 <li>break if the version is visible - no I/O</li>
593 </ul>
594 </li>
595 </ul>
596 </li>
597 </ul>
598 </blockquote>
599 <p>The difference is in for how many versions the package manager needs to hit
600 cache. With EAPI in the ebuild it needs to do that for all versions, with EAPI
601 in the filename it depends on versions visibility.
602 For example, package foo has versions 1, 2, 3, 4, 5 and 6. 6 is masked, 5 is
603 ~arch and 1,2,3 and 4 are arch. Say, the user accepts only arch for this
604 package. With EAPI in the filename it will read metadata only for versions
605 6, 5 and 4. With EAPI in the ebuild it needs to load metadata for all versions.</p>
606 <p>It's hard to say what's the avarage case, but surely the worst case scenario
607 (when only the lowest version is visible) is uncommon.</p>
608 </div>
609 <div class="section" id="easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change">
610 <h2><a class="toc-backref" href="#id17">Easily fetchable EAPI inside the ebuild and one-time extension change</a></h2>
611 <dl class="docutils">
612 <dt>Properties:</dt>
613 <dd><ul class="first last simple">
614 <li>Can be used right away: yes</li>
615 <li>Hurts performance: yes</li>
616 </ul>
617 </dd>
618 </dl>
619 <p>Performance decrease as described in the previous section.</p>
620 <p>Some say it is clear and simple, others that it is confusing and unintuitive,
621 because of the arbitrary format restrictions in what is a bash script otherwise.</p>
622 </div>
623 <div class="section" id="use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix">
624 <h2><a class="toc-backref" href="#id18">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></h2>
625 <dl class="docutils">
626 <dt>Properties:</dt>
627 <dd><ul class="first last simple">
628 <li>Can be used right away: yes</li>
629 <li>Hurts performance: yes</li>
630 </ul>
631 </dd>
632 </dl>
633 <p>Performance decrease comes from the fact that it adds several more directory
634 reads.</p>
635 <p>Some say that it makes it much harder for maintainers to see what they have.</p>
636 </div>
637 </div>
638 <div class="section" id="references">
639 <h1><a class="toc-backref" href="#id19">References</a></h1>
640 <table class="docutils footnote" frame="void" id="glep54" rules="none">
641 <colgroup><col class="label" /><col /></colgroup>
642 <tbody valign="top">
643 <tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>GLEP 54, scm package version suffix
644 (<a class="reference external" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr>
645 </tbody>
646 </table>
647 <table class="docutils footnote" frame="void" id="portageproblems" rules="none">
648 <colgroup><col class="label" /><col /></colgroup>
649 <tbody valign="top">
650 <tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>Common portage problems
651 (<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>
652 </tbody>
653 </table>
654 </div>
655 <div class="section" id="copyright">
656 <h1><a class="toc-backref" href="#id20">Copyright</a></h1>
657 <p>This document has been placed in the public domain.</p>
658 <!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
659 </div>
660
661 </div>
662 <div class="footer">
663 <hr class="footer" />
664 <a class="reference external" href="glep-0055.txt">View document source</a>.
665 Generated on: 2009-05-17 20:42 UTC.
666 Generated 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.
667
668 </div>
669 </body>
670 </html>

  ViewVC Help
Powered by ViewVC 1.1.20