Gentoo Archives: gentoo-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] What are eblits?
Date: Sun, 29 May 2016 01:11:50
Message-Id: 66d4acaa-4c75-540f-eb65-4f7b40e40b02@gentoo.org
In Reply to: Re: [gentoo-dev] What are eblits? by Kent Fredric
1 On 05/26/2016 21:28, Kent Fredric wrote:
2 > On 27 May 2016 at 10:28, rindeal <dev.rindeal@×××××.com> wrote:
3 >>
4 >> 1) what are they?
5 >> 2) why are they used?
6 >
7 >
8 > My best explanation is its a way to re-use very large amounts of code
9 > between 2 ebuilds, without resorting to:
10 >
11 > a) Copying the whole ebuild and hoping you find the relevant part in diffs
12 > b) Not needing reams of version-specific conditional code to make
13 > copying ebuilds between versions easier.
14 > c) Not needing confusing eclasses that exist to serve a single
15 > package, loaded with lots of weird conditional logic.
16 >
17 > My understanding is you could effectively roll the eblits back into
18 > the ebuild statically, just doing so would make keeping the changes
19 > consistent harder.
20 >
21 > Its clearly designed for a system where you have ~10 different
22 > versions of Perl available or ~10 different versions of glibc
23 > available, but you don't want to pay the price of duplicating that
24 > logic wholesale for every minor concurrent revision, and only want to
25 > update essential differences when you need to, not because you have
26 > to.
27 >
28 > That said, its a very confusing system to get your head around,
29 > because its *basically* yet another "mixin" system like "inherit", but
30 > done in bash, which itself is a rather strange language to be doing
31 > something as complicated as mixins.
32
33 An accurate explanation, but probably better to say they're more like "local
34 eclasses". If you think of the existing eclasses in ${PORTDIR}/eclass as
35 "global", that is, they contain common code utilized by multiple unrelated
36 ebuild packages, then eblits were originally envisioned as localized versions
37 of eclasses to share package-specific code between multiple ebuilds of
38 differing versions.
39
40 Whether the idea is useful in the present day and age, eh, who knows. For the
41 mips-sources ebuilds, eblits let me centralize the per-machine notes and
42 unpacking logic, which reduced each ebuild's size from ~18KB a few years ago
43 down to ~4.9KB today.
44
45 --
46 Joshua Kinard
47 Gentoo/MIPS
48 kumba@g.o
49 6144R/F5C6C943 2015-04-27
50 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
51
52 "The past tempts us, the present confuses us, the future frightens us. And our
53 lives slip away, moment by moment, lost in that vast, terrible in-between."
54
55 --Emperor Turhan, Centauri Republic

Replies

Subject Author
Re: [gentoo-dev] What are eblits? Rich Freeman <rich0@g.o>