Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: Micha?? G??rny <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Multiple ABI support through package appending/partial removal
Date: Wed, 26 Sep 2012 10:59:28
Message-Id: 20120926105728.GI26094@localhost
In Reply to: Re: [gentoo-dev] [RFC] Multiple ABI support through package appending/partial removal by "Michał Górny"
1 On Wed, Sep 26, 2012 at 08:35:37AM +0200, Micha?? G??rny wrote:
2 > On Tue, 25 Sep 2012 13:12:56 -0700
3 > Brian Harring <ferringb@×××××.com> wrote:
4 >
5 > > On Mon, Sep 24, 2012 at 12:09:49AM +0200, Micha?? G??rny wrote:
6 > > > Hello,
7 > > >
8 > > > Since my previous idea of DYNAMIC_SLOTS proved too complex to design
9 > > > and implement, I would like to offer an another idea, based partially
10 > > > on what Ciaran mentioned. Before I start getting into details, I'd like
11 > > > to know your opinions, and what possible problems am I missing. To keep
12 > > > it clean, I will focus on Python ABIs but other languages and multilib
13 > > > could be handled in a similar manner.
14 > > >
15 > > >
16 > > > The problem
17 > > > ===========
18 > > >
19 > > > Right now, building packages for multiple Python ABIs is done using
20 > > > USE_EXPAND-based useflags. This is a working solution but it requires
21 > > > rebuilding the package for all ABIs whenever the chosen ABI list
22 > > > changes.
23 > > >
24 > > > While it may be not that important for most of the Python packages, it
25 > > > becomes such when it comes to things like boost or -- if we'd extend
26 > > > that to multilib -- say, llvm. In that case, whenever a newly-installed
27 > > > package requests a specific ABI, user has to spend twice as much time
28 > > > to rebuild the same version.
29 > > >
30 > > >
31 > > > The general idea
32 > > > ================
33 > > >
34 > > > While not getting too deep into ebuild syntax, the core part
35 > > > of the idea is to mark some of the USE_EXPAND variables 'special'.
36 > > > In this particular example, such a special flag group would be
37 > > > 'PYTHON_TARGETS'.
38 > > >
39 > > > Now, let's consider user installs a new package with one
40 > > > python_targets_python2_7 enabled. The package is built and installed
41 > > > like usual but aside to regular vdb files an additional file
42 > > > is introduced, listing all the installed files as 'belonging'
43 > > > to python_targets_python2_7.
44 > > >
45 > > > If user enables python_targets_python3_2 on the same package, the PM
46 > > > doesn't trigger a full rebuild. Instead, it builds the package with
47 > > > the new flag being the only flag in PYTHON_TARGETS. The new files are
48 > > > installed over the installed package (and added to CONTENTS in vdb),
49 > > > and the files in install image are listed in vdb as 'belonging'
50 > > > to python_targets_python3_2.
51 > >
52 > > What you're proposing would liter the ebuild/eclass with has_version
53 > > checks; in brain dead simple cases, you can replace parts of the pkg
54 > > as you're proposing there.
55 > >
56 > > However if it installs scripts, things start getting more complex;
57 > > needs to vary how it installs if it's overlaying part of itself.
58 >
59 > That's the idea. You're given a tool, now thinking twice before using
60 > it.
61
62 This statement doesn't make sense. Clarify it.
63
64
65 > > This proposal also doesn't work in the phase of := slot deps either,
66 > > not unless you've got a way to ensure, potentially weeks/months after
67 > > the first build, that the node locks to the same slotting.
68 >
69 > A rebuild then?
70
71 More logic to dump on the PM. Yes, you can hack around it- I pointed
72 it out because the existence of that corner case says something about
73 the proposal.
74
75
76 > > > Whenever files from two ABIs collide, package manager either replaces
77 > > > the installed files if the 'new' ABI is considered 'better' than
78 > > > the old one or preserves it. This follows the current behavior when
79 > > > multiple ABIs are built, and later builds overwrite files from earlier
80 > > > ones.
81 > >
82 > > This is handwavey and kind of crackadled; the PM has no way of knowing
83 > > which USE_EXPAND target is considered 'best', so in the case of
84 > > multilib (say 64b and 32b subversion) there isn't any way to which svn
85 > > binary should be there- 64b or 32b. Best I can tell, your proposal
86 > > winds up just being "last one to merge wins" which isn't acceptable.
87 >
88 > This is just an early idea. Details like precedence weren't converted
89 > into any syntax yet.
90
91 Precedence is a core requirement of anything that's more than just a
92 non lib; python would've already been required to be addressed if we
93 didn't have that damn wrapper in place (when a multislotting proposal
94 goes through, that wrapper should die in the process).
95
96
97 > > > At the point, the additional file contains something like
98 > > > (ugly pseudo-syntax):
99 > > >
100 > > > /usr/lib64/python2.7/foo.py python_targets_python2_7
101 > > > /usr/lib64/python3.2/foo.py python_targets_python3_2
102 > > > /usr/share/doc/foo-1.2.3/README.bz2 python_targets_python2_7 \
103 > > > python_targets_python3_2
104 > > >
105 > > > Now, if user requests disabling python_targets_python2_7
106 > > > on the package, the package manager may not rebuild it as well.
107 > > > Instead, it removes python_targets_python2_7 from the above list,
108 > > > and unmerges the files which don't belong into any other ABI.
109 > >
110 > > If we're going to do sub-packaging... which is what you're attempting
111 > > here... the VDB backend for it minimally cannot be a one off
112 > > USE_EXPAND hack. That'll just back us into a corner- which the vdb
113 > > already does quite heavily.
114 > >
115 > > Any subpackaging content tracking needs to be generic and usable.
116 > > Really is that simple.
117 >
118 > Give a better explanation if you want me to follow your thoughts.
119
120 It's sub-packaging. Having packages within packages, ability to
121 add/remove chunks of a package without forcing full rebuilds of the
122 gestalt.
123
124 It is as it sounds.
125
126 A subpkging example beyond this would be storing splitdebug symbols in
127 a separate tbz2, and pulling that down- merging/unmerging on the fly.
128
129 Any such proposal as yours needs to recognize subpkging, and minimally
130 not make that situation worse.
131
132
133 > > > Sadly, this will not 'downgrade' common files to another ABI
134 > > > but I believe that it is not really a killer-feature.
135 > > >
136 > > >
137 > > > Installing new packages and upgrading existing
138 > > > ==============================================
139 > > >
140 > > > Whenever a new package is to be built and multiple ABIs are requested,
141 > > > the package manager should split the build process between particular
142 > > > ABIs. Preferably, it should build all of them one-by-one, recording
143 > > > the 'belongs' entries from the image and then install them as a single
144 > > > package.
145 > >
146 > > And how does the package know that it's being targetted at multiple
147 > > ABIs?
148 >
149 > It assumes it always is. Much like the python-distutils-ng does now.
150
151 Installation of binaries/scripts is where that most strongly applies-
152 python libraries are mostly by nature, slotted in how they install-
153 with the exception of docs, snakeoil doesn't conflict across multiple
154 python versions targetted for example.
155
156 If however we were talking about pkgcore, which *does* install things
157 into the ${PATH}, that question stands; it's an offshoot of the
158 precedence bit I poked at earlier.
159
160
161 > > Your proposal is built on the assumption ebuilds will happy overlay
162 > > themselves in differing configurations w/out ever fucking up.
163 > >
164 > > That's not the case frankly, and worse... for the cases where it
165 > > doesn't fly, your proposal basically requires the PM to hide the
166 > > "we're building/installing your ass multiple times" information from
167 > > the ebuild, further compounding the issue.
168 >
169 > How it does require anything to be hidden? This is an early proposal,
170 > just because it doesn't say anything about variables it doesn't mean
171 > there can't be any.
172
173 Your counterargument is that "nyuh uh; we can add variables to deal
174 with it". I had to write the critique there based on what you
175 wrote... not on what's in your head.
176
177 Reiterating; any code that is has_version aware, is going to have to
178 be adjusted for this.
179
180 Any code that is REPLACING_VERSIONS or REPLACED_BY_VERSIONS aware,
181 same thing; the those signals (and ones like it) are now wanged up due
182 to the fact that chunk of code is going to be invoked multiple times,
183 not knowing that it's sibling ABI target already ran- potentially
184 doing something about it.
185
186 Basically, if you try to run the phases all on their own with out them
187 truly knowing what's going on, it's going to make corner cases/issues
188 for devs pop up.
189
190 Now, if you have some vars you'd like to propose to deal with it, do
191 so; but that core issue is there and must be addressed.
192
193
194 ~harring