Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [pre-GLEP] Gentoo binary package container format [gentoo@jonesmz.com]
Date: Mon, 19 Nov 2018 02:52:12
Message-Id: CAGfcS_mJGEn00_GuQ22SiARU-AiM4fgoCqi-krcyyD69wYZ74A@mail.gmail.com
In Reply to: Re: [gentoo-dev] [pre-GLEP] Gentoo binary package container format [gentoo@jonesmz.com] by Zac Medico
1 On Sun, Nov 18, 2018 at 5:40 PM Zac Medico <zmedico@g.o> wrote:
2 >
3 > On 11/18/18 1:55 PM, Rich Freeman wrote:
4 > >
5 > > My idea is to basically have portage generate a tag with all the info
6 > > needed to identify the "right" package, take a hash of it, and then
7 > > stick that in the filename. Then when portage is looking for a binary
8 > > package to use at install time it generates the same tag using the
9 > > same algorithm and looks for a matching hash.
10 >
11 > We've already had this handled for a couple years now, via
12 > FEATURES=binpkg-multi-instance.
13
14 According to the make.conf manpage this simply numbers builds. So, if
15 you build something twice with the same config you end up with two
16 duplicate files (wasteful). Presumably if you had a large collection
17 of these packages portage would have to read the metadata within each
18 one to figure out which one is appropriate to install. That would be
19 expensive if IO is slow, such as when fetching packages online
20 on-demand.
21
22 But, it obviously is somewhat of an improvement for Roy's use case.
23
24 IMO using a content-hash of certain metadata would eliminate
25 duplication, and based on filename alone it would be clear whether the
26 sought-after binary package exists or not. As with the build numbers
27 you couldn't tell from filename inspection what packages you have, but
28 if you know what you want you could immediately find it. IMO trying
29 to cram all that metadata into a filename to make them more
30 transparent isn't a good idea, and using hashes lets the user set
31 their own policy regarding flexibility. Heck, you could auto-gen
32 symlinks for subsets of metadata (ie, the same file could be linked
33 from a file that specifies its USE flags but not its CFLAGS, so it
34 would be found if either an exact hit on CFLAGS was sought or if
35 CFLAGS were considered unimportant).
36
37 But, I'm certainly not suggesting that you're not allowed to go to bed
38 until you've built it. :)
39
40 --
41 Rich

Replies