Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Cc: tommy@g.o
Subject: Re: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds.
Date: Mon, 14 Jan 2013 18:05:02
Message-Id: 20130114150445.029088b9@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds. by Thomas Sachau
1 On Thu, 03 Jan 2013 11:44:58 +0100
2 Thomas Sachau <tommy@g.o> wrote:
3
4 > Pacho Ramos schrieb:
5 > > El mar, 25-09-2012 a las 10:21 -0300, Alexis Ballier escribió:
6 > >> On Sun, 23 Sep 2012 16:49:13 +0200
7 > >> Thomas Sachau <tommy@g.o> wrote:
8 > >>
9 > >>> It is not hard by itself to inherit an eclass. There is just the
10 > >>> limitation, that occurs with an eclass, e.g.:
11 > >>>
12 > >>> -the one from mgorny only does it for autotools based ebuilds
13 > >>> only and even there only for libraries, headers and binaries are
14 > >>> not done. While one may create the same for cmake based ones,
15 > >>> those are still only for a subset of packages, since not all do
16 > >>> use autotools/cmake or are satisfied with a libs only solution
17 > >>> -the multilib-native eclass does extend it way more, but still
18 > >>> has its limitations, e.g. what happens with a new target ABI
19 > >>> (like x32 on the amd64 profile) or how are dependencies handled?
20 > >>>
21 > >>> multilib-portage is the answer to those limitations, since it does
22 > >>> work for any target with multilib cross-compile support, can
23 > >>> handle things like the dependencies internally and can even work
24 > >>> on not prepared/modified ebuilds.
25 > >>>
26 > >>> So before i invest even more time in getting this official, we
27 > >>> should better get to some conclusion, if we either go the route
28 > >>> with eclass based multilib cross-compile support with its
29 > >>> limitations or if we move this up to the package manager level.
30 > >>>
31 > >>
32 > >> Can't we get something in between ?
33 > >>
34 > >> Unless I'm mistaken, portage-multilib has its limitations also:
35 > >>
36 > >> - I have package foo and package bar, both depending on ffmpeg and
37 > >> canditates for a multilib build. However, package foo does not
38 > >> link to ffmpeg but simply spawns the 'ffmpeg' binary to process
39 > >> some files, package bar links to libavcodec. You need
40 > >> ffmpeg[multilib] for a multilib build of bar but not for foo. How
41 > >> do you distinguish between the two ?
42 >
43 > I dont really understand your question here. So do you:
44 >
45 > - simply have 2 64bit apps wanting to use ffmpeg?
46 > - have 2 32bit binary packages wanting to use ffmpeg?
47 > - want to build foo and bar on a 64bit platform for a 32bit platform?
48 > - want a 64bit or a 32bit version of ffmpeg or both?
49 > - if you want a 32bit version of ffmpeg, do you only want 32bit libs
50 > or also a 32bit binary?
51
52
53 it depends on what you are building; let's say we want all abi flavors
54 for foo and bar.
55
56 in the above example, package foo uses fork/exec so needs a libc
57 compatible with its abis and that's all; it doesn't care if ffmpeg is
58 an elf executable, a bash script, or running through an emulator.
59 package bar needs ffmpeg libraries for every abi it installs.
60 portage multilib doesn't seem to distinguish between the two cases.
61
62 > >> - When an out-of-tree build is possible, it is more efficient to
63 > >> do it that way while multilib-portage will probably run the full
64 > >> src_* phases twice. mgorny's eclass is a solution to this for
65 > >> autotools-utils based ebuilds. I have added basic support for
66 > >> this in freebsd-lib some time ago also.
67 >
68 > Isnt "out-of-tree build" just building in a seperate location, so in
69 > the end doing one unpack instead of 2, while everything else still
70 > needs to be done for each target?
71
72 yes, so?
73 (unpack in the EAPI0 sense btw, prepare shouldn't need to be done twice
74 either)
75
76 > >> However, it is clear that USE=multilib is limited too. What we
77 > >> probably need, as I read in the draft you posted some time ago, is
78 > >> a MULTILIB_ABI use-expand. Keep a list of all the MULTILIB_ABIs in
79 > >> an eclass, add them to IUSE of multilib-enabled packages and then
80 > >> you can use the USE-deps. When a new ABI gets added, add it to the
81 > >> list in the eclass and be done. You already have PM support for
82 > >> this :)
83 >
84 > Please keep in mind, that the USE flags are different, depending on
85 > your arch. E.g. on amd64, you may additionally have x86 and x32,
86 > while on ppc64, you may have ppc64 and ppc. You dont want the later
87 > on amd64 nor the first on ppc. So how do you want to add different
88 > (use-expanded) USE flags based on the arch the user is running?
89
90 no, the useflags are not different:
91
92 coma=""
93 for i in $MULTILIB_ABIS ; do
94 multilib_use_deps+="${coma}multilib_abi_${i}?"
95 coma=", "
96 done
97
98 deps like foo[multilib?] becomes foo[${multilib_use_deps}]
99 and voila, you are not anymore limited to multilib or not multilib but
100 really control the abis.
101
102 > >> You can leverage the generic multilib building code you have to an
103 > >> eclass, so that you don't need to spec it; spec-ing it has its
104 > >> problems too: what happens if next year pkg-config is deprecated
105 > >> and now we shall all use foo-config ? your spec adjusts
106 > >> PKG_CONFIG_PATH but not FOO_CONFIG_PATH. You probably need a small
107 > >> EAPI change to be able to implement sanely a generic solution into
108 > >> an eclass though.
109 > >>
110 > >> My question to you would be: what are we missing from current
111 > >> EAPIs to be able to perfectly support multilib builds ?
112 >
113 > While the variable export, the build for each target and the merge of
114 > the results should also be possible inside an eclass, the dependency
115 > and USE flag parts seems more tricky.
116
117 Even with what I've written above ? Why ?
118
119 > And additionally, with support of this in (multilib-)portage (not
120 > depending on EAPI, but enabled via FEATURES), i already get all of
121 > this without having to wait for a new EAPI/eclass and ebuilds moving
122 > to it.
123
124 You don't need an EAPI then, just get your changes merged in portage.
125
126 Alexis.

Replies