Gentoo Archives: gentoo-portage-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Re: [RFC] Improving Gentoo package format
Date: Sun, 11 Nov 2018 18:17:37
Message-Id: pan$849e4$800ba788$9c05e465$a2b880e5@cox.net
In Reply to: Re: [gentoo-portage-dev] [RFC] Improving Gentoo package format by Francesco Riosa
1 Francesco Riosa posted on Sun, 11 Nov 2018 17:05:37 +0100 as excerpted:
2
3 > Il giorno dom 11 nov 2018 alle ore 09:29 Michał Górny
4 > <mgorny@g.o>
5 > ha scritto:
6 >
7 >> On Sat, 2018-11-10 at 09:37 -0500, Alec Warner wrote:
8 >>> On Sat, Nov 10, 2018 at 8:09 AM Michał Górny <mgorny@g.o>
9 >>> wrote:
10 >> [...]
11 >>>> My proposal ===========
12 >>>>
13 >>>> Basic format ------------
14 >>>> The base of the format is a regular compressed tarball.
15 >>>> There's no junk appended to it but the metadata is stored
16 >>>> inside it as /var/db/pkg/${PF}. The contents are as compatible
17 >>>> with the actual vdb format as possible.
18 >>>>
19 >>>>
20 >>> Just to clarify, you are suggesting we store the metadata inside
21 >>> the contents of the binary package itself (e.g. where the other
22 >>> files that get merged to the liveFS are?) What about collisions?
23 >>>
24 >>> E.g. I install 'machine-images/gentoo-disk-image-1.2.3' on a machine
25 >>> that already has 'machine-images/gentoo-disk-image-1.2.3' installed,
26 >>> won't it overwrite files in the VDB at qmerge time?
27 >>
28 >> Portage will obviously move the files out, and process them as
29 >> metadata.
30
31 >> The idea is to precisely use a directory that can't be normally part
32 >> of binary packages, so can't cause collisions with real files (even if
33 >> they're very unlikely to ever happen).
34 >>
35 >>>> This has the following advantages:
36 >>>>
37 >>>> + Binary package is still stored as a single file.
38
39 Breaking these down into RFC style MUST/SHOULD/MAY levels (as already
40 suggested elsewhere), for me, this is...
41
42 SHOULD/MAY
43
44 (Would be a MAY, nice to have, but the existing solution has it, thus
45 arguably raising the priority to SHOULD.)
46
47 >>>> + It uses a standard compressed .tar format, with minimal
48 >>>> customization.
49
50 MUST
51
52 (Losing the existing functionality here would be horrible. FWIW I
53 routinely use binpkgs as a reference, for "clean" config files, comparing
54 install trees of old and new versions, etc. Having tools that allow
55 browsing standard compressed tar archives as virtual extensions to the
56 filesystem makes that a breeze. =:^)
57
58 >>>> + The user can easily inspect and modify the packages with standard
59 >>>> tools (tar and the compressor).
60
61 MUST
62
63 (As pointed out, portage itself already does this when doing binpkg
64 moves, etc. Losing that would be horrible!)
65
66 >>>> + If we can maintain reasonable level of vdb compatibility, the
67 >>>> user can even emergency-install a package without causing too much
68 >>>> hassle (as it will be recorded in vdb); ideally Portage would
69 >>>> detect this vdb entry and support fixing the install afterwards.
70 >>>>
71 >>>>
72 >>> I'm not certain this is really desired.
73
74 SHOULD/MAY
75
76 (I'd say SHOULD, but while possible to emergency-install via untarring
77 now, portage doesn't do anything with it at all, so the detect and fix
78 functionality is a bonus, thus arguably lowering it to a MAY.)
79
80 >> Are you saying it's better that user emergency-installs a package
81 >> without recording it in vdb, and ends up with mess of collisions and
82 >> untracked files?
83 >>
84 >> Just because you don't like some use case doesn't mean it's not gonna
85 >> happen. Either you prepare for it and make the best of it, or you
86 >> pretend it's not gonna happen and cause extra pain to users.
87
88 I think I've had to do this twice in ~1.5 decades, plus once reaching
89 into the tarball to extract a single file that was broken in a newly
90 installed glibc, breaking portage (and much of the system, but bunzip
91 still worked!) so I couldn't undo it using portage.
92
93 The first time I didn't know enough to clean up manually, but the second
94 time (and the reach-in time) I did. It'd *definitely* be nice to have
95 portage be able to clean up automatically.
96
97 > Another option would be to install in a near but not overlapping
98 > directory,
99 > example:
100 > /var/db/pkg/${PF}-binpkg
101 >
102 > this way the user that know what to do with that data can play with it,
103 > also portage could be instructed to stat() that directory and take
104 > action (halt maybe?) if present.
105
106 Idea ++
107
108 Detect and fix has already been proposed, but detect and halt with an
109 error and a pointer to manual fix instructions is arguably already better
110 than current.
111
112 Which suggests an easy implementation split, delaying the "fix" step
113 until later, if it would complicate the initial implementation too much.
114
115 [Bikeshed] I was thinking binpkg-${PF} to emphasize the binpkg part and
116 group any emergency-installed packages together in an alphabetical
117 listing. But whichever's easiest for portage to work with, which
118 probably makes the -binpkg suffix version a better choice, requiring less
119 modification to existing code.
120
121
122 Is there any interest at all in binpkgs, perhaps when improved, from the
123 other PMs? Or are they effectively dead now or not interested in binpkgs
124 even if the format were to be improved, or simply too hard to work with?
125 Because "it'd be nice" (aka MAY level) to have this formally standardized
126 to PMS... if there's any interest from the other PMs.
127
128 --
129 Duncan - List replies preferred. No HTML msgs.
130 "Every nonfree program has a lord, a master --
131 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-portage-dev] Re: [RFC] Improving Gentoo package format "M. J. Everitt" <m.j.everitt@×××.org>