1 |
On Tue, 25 Sep 2012 13:12:56 -0700 |
2 |
Brian Harring <ferringb@×××××.com> wrote: |
3 |
|
4 |
> On Mon, Sep 24, 2012 at 12:09:49AM +0200, Micha?? G??rny wrote: |
5 |
> > Hello, |
6 |
> > |
7 |
> > Since my previous idea of DYNAMIC_SLOTS proved too complex to design |
8 |
> > and implement, I would like to offer an another idea, based partially |
9 |
> > on what Ciaran mentioned. Before I start getting into details, I'd like |
10 |
> > to know your opinions, and what possible problems am I missing. To keep |
11 |
> > it clean, I will focus on Python ABIs but other languages and multilib |
12 |
> > could be handled in a similar manner. |
13 |
> > |
14 |
> > |
15 |
> > The problem |
16 |
> > =========== |
17 |
> > |
18 |
> > Right now, building packages for multiple Python ABIs is done using |
19 |
> > USE_EXPAND-based useflags. This is a working solution but it requires |
20 |
> > rebuilding the package for all ABIs whenever the chosen ABI list |
21 |
> > changes. |
22 |
> > |
23 |
> > While it may be not that important for most of the Python packages, it |
24 |
> > becomes such when it comes to things like boost or -- if we'd extend |
25 |
> > that to multilib -- say, llvm. In that case, whenever a newly-installed |
26 |
> > package requests a specific ABI, user has to spend twice as much time |
27 |
> > to rebuild the same version. |
28 |
> > |
29 |
> > |
30 |
> > The general idea |
31 |
> > ================ |
32 |
> > |
33 |
> > While not getting too deep into ebuild syntax, the core part |
34 |
> > of the idea is to mark some of the USE_EXPAND variables 'special'. |
35 |
> > In this particular example, such a special flag group would be |
36 |
> > 'PYTHON_TARGETS'. |
37 |
> > |
38 |
> > Now, let's consider user installs a new package with one |
39 |
> > python_targets_python2_7 enabled. The package is built and installed |
40 |
> > like usual but aside to regular vdb files an additional file |
41 |
> > is introduced, listing all the installed files as 'belonging' |
42 |
> > to python_targets_python2_7. |
43 |
> > |
44 |
> > If user enables python_targets_python3_2 on the same package, the PM |
45 |
> > doesn't trigger a full rebuild. Instead, it builds the package with |
46 |
> > the new flag being the only flag in PYTHON_TARGETS. The new files are |
47 |
> > installed over the installed package (and added to CONTENTS in vdb), |
48 |
> > and the files in install image are listed in vdb as 'belonging' |
49 |
> > to python_targets_python3_2. |
50 |
> |
51 |
> What you're proposing would liter the ebuild/eclass with has_version |
52 |
> checks; in brain dead simple cases, you can replace parts of the pkg |
53 |
> as you're proposing there. |
54 |
> |
55 |
> However if it installs scripts, things start getting more complex; |
56 |
> needs to vary how it installs if it's overlaying part of itself. |
57 |
|
58 |
That's the idea. You're given a tool, now thinking twice before using |
59 |
it. |
60 |
|
61 |
> This proposal also doesn't work in the phase of := slot deps either, |
62 |
> not unless you've got a way to ensure, potentially weeks/months after |
63 |
> the first build, that the node locks to the same slotting. |
64 |
|
65 |
A rebuild then? |
66 |
|
67 |
> > Whenever files from two ABIs collide, package manager either replaces |
68 |
> > the installed files if the 'new' ABI is considered 'better' than |
69 |
> > the old one or preserves it. This follows the current behavior when |
70 |
> > multiple ABIs are built, and later builds overwrite files from earlier |
71 |
> > ones. |
72 |
> |
73 |
> This is handwavey and kind of crackadled; the PM has no way of knowing |
74 |
> which USE_EXPAND target is considered 'best', so in the case of |
75 |
> multilib (say 64b and 32b subversion) there isn't any way to which svn |
76 |
> binary should be there- 64b or 32b. Best I can tell, your proposal |
77 |
> winds up just being "last one to merge wins" which isn't acceptable. |
78 |
|
79 |
This is just an early idea. Details like precedence weren't converted |
80 |
into any syntax yet. |
81 |
|
82 |
> > At the point, the additional file contains something like |
83 |
> > (ugly pseudo-syntax): |
84 |
> > |
85 |
> > /usr/lib64/python2.7/foo.py python_targets_python2_7 |
86 |
> > /usr/lib64/python3.2/foo.py python_targets_python3_2 |
87 |
> > /usr/share/doc/foo-1.2.3/README.bz2 python_targets_python2_7 \ |
88 |
> > python_targets_python3_2 |
89 |
> > |
90 |
> > Now, if user requests disabling python_targets_python2_7 |
91 |
> > on the package, the package manager may not rebuild it as well. |
92 |
> > Instead, it removes python_targets_python2_7 from the above list, |
93 |
> > and unmerges the files which don't belong into any other ABI. |
94 |
> |
95 |
> If we're going to do sub-packaging... which is what you're attempting |
96 |
> here... the VDB backend for it minimally cannot be a one off |
97 |
> USE_EXPAND hack. That'll just back us into a corner- which the vdb |
98 |
> already does quite heavily. |
99 |
> |
100 |
> Any subpackaging content tracking needs to be generic and usable. |
101 |
> Really is that simple. |
102 |
|
103 |
Give a better explanation if you want me to follow your thoughts. |
104 |
|
105 |
> > Sadly, this will not 'downgrade' common files to another ABI |
106 |
> > but I believe that it is not really a killer-feature. |
107 |
> > |
108 |
> > |
109 |
> > Installing new packages and upgrading existing |
110 |
> > ============================================== |
111 |
> > |
112 |
> > Whenever a new package is to be built and multiple ABIs are requested, |
113 |
> > the package manager should split the build process between particular |
114 |
> > ABIs. Preferably, it should build all of them one-by-one, recording |
115 |
> > the 'belongs' entries from the image and then install them as a single |
116 |
> > package. |
117 |
> |
118 |
> And how does the package know that it's being targetted at multiple |
119 |
> ABIs? |
120 |
|
121 |
It assumes it always is. Much like the python-distutils-ng does now. |
122 |
|
123 |
> Your proposal is built on the assumption ebuilds will happy overlay |
124 |
> themselves in differing configurations w/out ever fucking up. |
125 |
> |
126 |
> That's not the case frankly, and worse... for the cases where it |
127 |
> doesn't fly, your proposal basically requires the PM to hide the |
128 |
> "we're building/installing your ass multiple times" information from |
129 |
> the ebuild, further compounding the issue. |
130 |
|
131 |
How it does require anything to be hidden? This is an early proposal, |
132 |
just because it doesn't say anything about variables it doesn't mean |
133 |
there can't be any. |
134 |
|
135 |
> > Whenever a package is to be upgraded, all ABIs have to rebuilt. |
136 |
> > The package manager can handle it as a regular package upgrade, not |
137 |
> > considering 'belongs' entries more than in a fresh package install. |
138 |
> > |
139 |
> > Whenever a package is removed completely, the 'belongs' entries need |
140 |
> > not to be considered at all. |
141 |
> > |
142 |
> > |
143 |
> > Backwards compatibility |
144 |
> > ======================= |
145 |
> > |
146 |
> > The solution aims to be fully compatible with package managers |
147 |
> > not supporting it. They should see it as a regular package with |
148 |
> > selected useflags, and an additional opaque vdb file. |
149 |
> > |
150 |
> > When such a package manager attempts to rebuild or upgrade such |
151 |
> > package, the vdb file should be removed, thus not introducing any |
152 |
> > ambiguity for PMs supporting it. The package removal is unaffected |
153 |
> > at all. |
154 |
> |
155 |
> *cough* you forgot about the saved environment. |
156 |
> |
157 |
> To run the pkg_postinst of an install pkg, you need to run it within |
158 |
> that saved environment. That's hard law when it comes to ebuilds. |
159 |
> |
160 |
> You're proposing generating multiple environments, not addressing |
161 |
> which is used. A rather *fatal* flaw there is the assumption that the |
162 |
> ebuild/eclasses in the tree at the time of ABI #2 are going to be the |
163 |
> same/compatible as what's in the tree at the time of ABI #1. That |
164 |
> potential alone makes env handling fucktons worse. |
165 |
> |
166 |
> Just heading it off also, you cannot sanely slap together multiple env |
167 |
> dumps and hope it works; minimally, the USE metadata, vars calculated |
168 |
> from the run, etc, will collide and the last one to merge will be |
169 |
> what's seen; whether that's right or wrong. |
170 |
|
171 |
That's a fair point. |
172 |
|
173 |
> Bluntly; this feels like an attempt to duct tape multilib on; |
174 |
> Literally, I've spent ~5m reading this proposal, then inlining the |
175 |
> faults I see and there are multiple semi-fatal issues in it. |
176 |
> |
177 |
> If you want to do multilib, aim for something that isn't a hack of |
178 |
> existing PM behaviour; whatever we do has to work well, no insne edge |
179 |
> cases, etc. |
180 |
> |
181 |
> Keep in mind were this to land, it's not a one off feature; it lands, |
182 |
> it stays as a core part of the pm/format from that point forward |
183 |
> meaning fuckups in it bite us in the ass long term. |
184 |
|
185 |
Also, please watch your language. This is a public mailing list, not |
186 |
a public toilet. |
187 |
|
188 |
-- |
189 |
Best regards, |
190 |
Michał Górny |