1 |
Michał Górny schrieb: |
2 |
> On Mon, 4 Mar 2013 11:02:40 +0100 |
3 |
> Alexis Ballier <aballier@g.o> wrote: |
4 |
> |
5 |
>> On Sun, 3 Mar 2013 23:25:03 +0100 |
6 |
>> Michał Górny <mgorny@g.o> wrote: |
7 |
>> |
8 |
>>> On Sun, 3 Mar 2013 18:18:12 +0100 |
9 |
>>> Alexis Ballier <aballier@g.o> wrote: |
10 |
>>> |
11 |
>>>> On Sun, 3 Mar 2013 17:58:26 +0100 |
12 |
>>>> Michał Górny <mgorny@g.o> wrote: |
13 |
>>>> |
14 |
>>>>> What do we need that wrapper for? What does the wrapper do? Does |
15 |
>>>>> it just rely on custom 'ABI' variable? |
16 |
>>>> |
17 |
>>>> yes -- it must perform some checks though. |
18 |
>>> |
19 |
>>> What kind of checks? |
20 |
>> |
21 |
>> you are called with ABI=sth argv[0] = your name |
22 |
> |
23 |
> I'm afraid that's the first potential point of failure. Relying |
24 |
> on argv[0] is a poor idea and means that any application calling exec() |
25 |
> with changed argv[0] on a wrapped binary will fail terribly. |
26 |
|
27 |
Nobody said, that one cannot create situations, where such a wrapper |
28 |
does fail, the point is more an easy and general solution for wrapping |
29 |
binaries without implementing different solutions for the same issue in |
30 |
every ebuild. |
31 |
|
32 |
If you have a better, yet still easy and general solution not requiring |
33 |
every ebuild to create something on its own, please write it instead of |
34 |
just complaining how bad the wrapper solution actually is. |
35 |
|
36 |
> |
37 |
>> if argv[0] = abiwrapper -> print some information and exit |
38 |
>> getenv ABI -> if nothing then set ABI=$DEFAULT_ABI (hardcoded at |
39 |
>> buildtime of the wrapper) |
40 |
>> execvp(argv[0]_$ABI, argv) |
41 |
>> if execvp returns: print a warning, execvp argv[0]_$DEFAULT_ABI |
42 |
>> |
43 |
>> |
44 |
>> python-wrapper.c is very likely to have such a logic already. |
45 |
>> |
46 |
>> btw, IMHO ABI is a too common name for such a variable, I'd better name |
47 |
>> it something like _GENTOO_MULTILIB_ABI so that collisions are much less |
48 |
>> likely. |
49 |
> |
50 |
> I'm afraid you are actually starting to go the other way. |
51 |
> |
52 |
> Global wrapper means that it is potentially useful to our users. |
53 |
> However I don't really see people who want to compile 32-bit |
54 |
> executables think of setting some custom variable like ABI. |
55 |
|
56 |
Unless you implied, that you want users to compile from hand instead of |
57 |
using an ebuild, this makes no sense to me. |
58 |
|
59 |
This ABI variable is of course set when setting up the environment, so |
60 |
it is around in every phase and any call to an abi-wrapped binary |
61 |
directly gets the right one for the current ABI. |
62 |
|
63 |
>>>>> Or maybe should it try to detect |
64 |
>>>>> whether it was called by a 64- or 32-bit app? |
65 |
>>>> |
66 |
>>>> this wont work: think about a build system, your shell/make will |
67 |
>>>> likely be your default abi's but may call abi-specific tools |
68 |
>>>> depending on what you build _for_ not what you build _with_ |
69 |
>>> |
70 |
>>> That's one side of it. The other is that if it worked, it may be |
71 |
>>> something really unexpected. Do you expect things to work differently |
72 |
>>> when called by a 32-bit program? |
73 |
>> |
74 |
>> That's why I asked for examples :) |
75 |
>> qmake may do it, I don't think its sane, but that's life for now. |
76 |
>> having glxinfo for each abi is useful from a user perspective (it does |
77 |
>> not need the wrapper a priori though) |
78 |
> |
79 |
> Yep, I intended to just have the additional variant of glxinfo directly |
80 |
> callable, with a name chosen specifically by the X11 team. Wrapper |
81 |
> would be more confusing than beneficial here IMO. |
82 |
|
83 |
Ah, you actually want each ebuild to have its own custom hack instead of |
84 |
one global solution usable everywhere? |
85 |
|
86 |
> |
87 |
>>>>> What for? |
88 |
>>>> |
89 |
>>>> in order to be transparent from the ebuild perspective. |
90 |
>>> |
91 |
>>> That depends on what kind of transparency do we want. I prefer being |
92 |
>>> explicit here rather than assuming something you can't know for sure. |
93 |
>> |
94 |
>> See it something like python-wrapper. EPYTHON=python3.2 python -> runs |
95 |
>> python3.2 :) |
96 |
> |
97 |
> Err, python-wrapper respects quite complex logic involving EPYTHON, |
98 |
> and eselect-python. We don't really want people to have eselect-abi, |
99 |
> do we? |
100 |
> |
101 |
> If we were to implement abi-wrapper, it will be much simpler than any |
102 |
> logic needed for Python. |
103 |
|
104 |
Exactly: Just the environment variable, no eselect module, simple, easy |
105 |
to understand and working. |
106 |
|
107 |
> |
108 |
>>> I think we're starting to miss the point of multilib. Multilib was |
109 |
>>> intended as a cheap way of getting things working. I believe that we |
110 |
>>> should still consider it so, and keep it in cages rather than |
111 |
>>> believing that the world is more fun with tigers jumping around. |
112 |
>>> |
113 |
>>> That said, I wouldn't say that making random executables in system |
114 |
>>> work differently on ${ABI} is a way to go. That leaves the tricky |
115 |
>>> imprint of multilib visible to users who shouldn't care about it. If |
116 |
>>> they do, they're looking for multilib-portage. |
117 |
>> |
118 |
>> To some extent that's what happened to python too :) As a python |
119 |
>> maintainer, you could share your thoughts on the topic. python slotting |
120 |
>> was intended to make switching between python versions easy but has |
121 |
>> been needing wrappers for the python binary. |
122 |
> |
123 |
> I'm doing just that. Any kind of wrapping is an increasing mess. I'm |
124 |
> still trying to find out good solutions for Python wrapping but there's |
125 |
> no such thing. It's always about choosing one evil over the other. |
126 |
|
127 |
So you are wrapping python, have not yet found anything better and still |
128 |
dont want to wrap abi-specific binaries, while you dont have a better |
129 |
solution at hand? Saying no to everything is easy, providing something |
130 |
better if you dont like a suggestion is the challenge. |
131 |
|
132 |
-- |
133 |
|
134 |
Thomas Sachau |
135 |
Gentoo Linux Developer |