1 |
On 12/26/2009 11:25 AM, Fabian Groffen wrote: |
2 |
> Hi Thomas, |
3 |
> |
4 |
> On 25-12-2009 15:00:36 +0100, Thomas Sachau wrote: |
5 |
>> On 12/25/2009 06:10 AM, Denis Dupeyron wrote: |
6 |
>>> Sorry, I forgot to send an email explaining what happened on the |
7 |
>>> council alias as promised. The consensus was that the project wasn't |
8 |
>>> mature enough to go ahead. Also more generally the council's job isn't |
9 |
>>> discussing but deciding, approving, etc... Discussing is what should |
10 |
>>> happen on mailing lists. |
11 |
>> |
12 |
>> Since i see noone arguing against adding the multilib features to |
13 |
>> current testing branch of portage, the discussion part already seems |
14 |
>> to be done. so a simple approval is ok, drop the discussion request. |
15 |
> |
16 |
> This may be a wasted effort, but I tried figuring out what you do in |
17 |
> your portage branch going by your earlier discussions. The idea I got |
18 |
> is the following: |
19 |
> |
20 |
> Triggered by some mechanism (maybe unconditional), you just run each |
21 |
> ebuild function executed by Portage multiple times, that is, for each |
22 |
> ABI that you grab from somewhere. e.g: |
23 |
> src_unpack() { |
24 |
> for abi in ${EABIS} ; do |
25 |
> mkdir ${WORKDIR}-${abi} |
26 |
> cd ${WORKDIR}-${abi} |
27 |
> unpack ${A} |
28 |
> done |
29 |
> } |
30 |
|
31 |
Currently it is something like this for every phase: |
32 |
|
33 |
src_unpack() { |
34 |
for abi in ${MULTILIB_ABIS}; do |
35 |
set_env $abi |
36 |
<do the usual stuff as normal> |
37 |
done |
38 |
} |
39 |
|
40 |
The ebuild phase does only see the normal WORKDIR, all work with it is done inside portage and |
41 |
outside the phases, so every package doing things inside WORKDIR just works without additional |
42 |
changes. The install part contains some additional helpers for headers and binaries. |
43 |
|
44 |
But i currently try to change it as suggested by vapier: |
45 |
|
46 |
for abi in ${MULTILIB_ABIS}; do |
47 |
set_env $abi |
48 |
pkg_setup |
49 |
src_{unpack,compile,install} |
50 |
mv ${D} ${D}.$abi |
51 |
done |
52 |
merge ${D}.$abi into ${D} |
53 |
<continue as usual> |
54 |
|
55 |
This way you can set ABI-dependent vars in pkg_setup (previous implementation requires to set it in |
56 |
every phase, if it was no preserved var), there is nothing in ${D} during src_install, so you can do |
57 |
a mv again (like some ebuilds or eclasses do or did) and, since the DEFAULT_ABI is run first, i can |
58 |
detect, if there is actually the need to run everything again for other ABIs. |
59 |
But i currently cannot say when i am finished with it. |
60 |
|
61 |
> |
62 |
> During configure you inject -m{32,64} in CFLAGS depending on your ABI. |
63 |
> This gives your multilib-compiler the right hint to do the thing you |
64 |
> want. |
65 |
|
66 |
Right |
67 |
|
68 |
> |
69 |
> This is about what I understood. Now here I have some questions that |
70 |
> may or may not be relevant. |
71 |
> |
72 |
> What triggers a multilib build? Is it unconditional, or can it be |
73 |
> turned on/off per package? How does Portage resolve/verify that a |
74 |
> library is built for the right ABI in that case? |
75 |
|
76 |
Currently multilib-portage does add a USE flag called "lib32". If you enable it, you will get the |
77 |
cross-compile, else just the normal install. In addition this flag is internally used like an EAPI-2 |
78 |
usedep, so it will require the dependencies to be built for all ABIs too. |
79 |
|
80 |
> |
81 |
> Unpacking sources many times feels like a terrible waste to me, |
82 |
> especially for things like GCC. If we would just start building outside |
83 |
> of the workdir (sources) into a separate builddir, wouldn't that just |
84 |
> be much cleaner and a nice EAPI feature? |
85 |
|
86 |
That might be an extra step, once the basic implementation works, but you will have to adjust some |
87 |
things, since e.g. cmake-utils eclass does already something like that, maybe others do it too, so |
88 |
you would have to change those ebuilds/eclasses or add exceptions or extra rules to portage for those. |
89 |
Some packages like gcc or glibc already do this multilib-stuff internally with the multilib USE |
90 |
flag, so you currently wont get any better experience for them. |
91 |
|
92 |
> |
93 |
> Since you make each compilation multiple times, you also obtain a fully |
94 |
> identical installation of the same package. How do you deal with that? |
95 |
> Do you have /usr/bin{64,32} directories for example too? If you only |
96 |
> keep libs (found by a scanelf scan or something), how do you know what's |
97 |
> relevant. Alternatively, if you build the full application anyway, |
98 |
> isn't it a waste to throw away the result? You could see multilib also |
99 |
> as two (unrelated) trees, such as e.g. a Gentoo Prefix installation. |
100 |
> A nasty one: how to deal with libs that actually contain hardcoded paths |
101 |
> to configuration from e.g. /etc or /var in your implementation? |
102 |
|
103 |
Currently i only work and test with amd64-ARCH, so with x86 and amd86 ABI. For those, the lib-part |
104 |
is easy since the crosscompile does install the libs into /usr/lib32 while the 64bit ones go into |
105 |
/usr/lib64. The headers for both ABIs are diffed and different ones are preserved, the rest is |
106 |
isntalled as usual. For binaries, normally only the one for the DEFAULT_ABI, so in this case the |
107 |
64bit one, will be preserved. But you can tell multilib-portage to preserve the 32bit binaries. In |
108 |
that case, the binaries will be called $binary-$ABI and a symlink $binary to a wrapper created, |
109 |
which calls the real binary depending on the current ABI. |
110 |
|
111 |
> |
112 |
> You chose to inject -m{32,64} in CFLAGS. Suppose you set CC to "gcc |
113 |
> -m{32,64}" or even "x86_64-..." or "i686-..." you could do some |
114 |
> cross-target stuff, I think. I say so in the light of Darwin systems |
115 |
> which are capable of using Mach-O FAT objects. Such objects can contain |
116 |
> multiple architectures. This idea is available for as FATelf also, and |
117 |
> e.g. included in the zen-sources. On such system you ultimately want to |
118 |
> handle the multilib hel^Wproblem by avoiding the different paths but |
119 |
> instead generate that single unified tree that contains all your ABIs in |
120 |
> each (FAT) file. Is your approach flexible enough to lipo two or more |
121 |
> trees together in one after the two images are installed? |
122 |
|
123 |
My currently planned changes do install into different target dirs, so if those target dirs do |
124 |
contain all you need, there should be no problem to add some additional lines during merge. |
125 |
|
126 |
>>> Before you can bring that to the council we |
127 |
>>> need to see an as-much-as-possible finalized solution with any of the |
128 |
>>> following if applicable: portage branch with an implementation that |
129 |
>>> people can try, documentation, PMS patch, devmanual patches, and a |
130 |
>>> team. |
131 |
>> |
132 |
>> Did you actually read my lines? I did NOT request an ACK to add it to |
133 |
>> PMS and next EAPI with a complete spec. zmedico also has no problem |
134 |
>> with having a look and adding it, but since he was once forced to |
135 |
>> remove an added feature, he now wants a council-ok before adding and |
136 |
>> improving it in testing branch of main tree portage. |
137 |
> |
138 |
>>From my experience they just want to get some grip on the issue. A |
139 |
> formal description helps sometimes. |
140 |
|
141 |
As i already said: My implementation is not final nor do i request some PMS changes or EAPI bump for |
142 |
it. I simply want some more help and feedback by getting it in the 2.2_rc* branch of portage and |
143 |
zmedico just wants an ok from council, so that they wont force him to remove it again. |
144 |
|
145 |
Once the implementation is final, there should be more time to create the SPEC, PMS patches and |
146 |
similar for a final approval by council and inclusion in PMS/some EAPI. |
147 |
|
148 |
>>> Look at what happened with prefix. They wanted |
149 |
>>> the council to approve it immediately or else... We didn't cede to |
150 |
>>> pressure and worked with them to make it good enough for approval. |
151 |
>> |
152 |
>> Something like "I/We want <x>,<y>,<z> or you wont get an approval" is |
153 |
>> no support and no "work with them". So if you really would like to see |
154 |
>> it in, actually help with patches, SPEC writing, discussion and code |
155 |
>> writing. Else i request an approval for getting some additional help |
156 |
>> instead of just shooting it down. |
157 |
> |
158 |
> Pfff, I guess like you, Thomas, we got a bit impatient. Our experience |
159 |
> is that once you give the information to the council in the right |
160 |
> format, they seem to be much more focussed. |
161 |
|
162 |
But i currently dont have "the information", i only want a "we wont force the portage team to remove |
163 |
the multilib code from portage-2.2_rc*". |
164 |
|
165 |
>>> Right now I don't hear anybody arguing about prefix going forward. And |
166 |
>>> that's exactly what I want for your project, i.e. helping you making |
167 |
>>> it better instead of it fading and failing in the (not so) long run. |
168 |
>> |
169 |
>> prefix is no one-man-team and the actual amount of people, who can and |
170 |
>> are willing to work on portage code is limited, so which other way do |
171 |
>> you have to improve it as requested? |
172 |
> |
173 |
> Prefix has been more or less a one-man-team for a long long time, but |
174 |
> then, the project exists for about 5 years now. I cannot really advise |
175 |
> you to go that route, so please try to spec it. |
176 |
|
177 |
Long term forking is hard, especially when you also work for other time consuming projects and have |
178 |
some work, where you have no contact with Gentoo or Linux. |
179 |
But i cannot give out specs, when it is not final. My main interest is more feedback, more comments, |
180 |
more testing and maybe a bit more help for the code part. |
181 |
|
182 |
-- |
183 |
Thomas Sachau |
184 |
|
185 |
Gentoo Linux Developer |