Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o, Ambroz Bizjak <ambrop7@×××××.com>
Subject: Re: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions
Date: Sat, 22 Sep 2012 16:34:04
Message-Id: 505DE7D7.8060205@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions by Ambroz Bizjak
1 On 09/22/2012 09:08 AM, Ambroz Bizjak wrote:
2 > Yes, I think this is a good idea, it would allow the dependencies to
3 > be expressed nicely as conditions.
4 >
5 > But I'm not sure how this would be a USE flag. It should behave like
6 > one during the build, but it would be best if it was not written into
7 > the VDB as such, at least in a way that would be considered by
8 > --newuse. It don't want "emerge -unD" on the booted system want to
9 > reinstall all packages because the current ones were cross-compiled.
10 > Does the test flag already behave nicely like that? In that case, all
11 > is good, and I can try to implement this.
12
13 Simply add your special flag to the _feature_flags variable in
14 config.py, and it will be exempt from --newuse. See this commit:
15
16 http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b19f71b39b6af43307abf20654511bace041217
17
18 > On a slightly different subject: I've been porting some packages to
19 > HDEPEND and I've seen problems with packages that want to use the
20 > programs they build during the build (or in postinst). Of couse this
21 > works for native builds, and it can be fixed to work for cross-compile
22 > builds (build native version or HDEPEND on host package).
23 >
24 > But what do we do with the strange case where ROOT!=/ but
25 > --crosscompile/FEATURES=crosscompile is not in affect? Can we expect
26 > that we will be able to run the programs that were built? What if they
27 > link to libraries only available in ROOT?
28 >
29 > So, I think it would make sense for a lot of packages to treat ROOT!=/
30 > equivalently to cross-compilation, i.e. require host tool to be
31 > present. But with what has currently been proposed there is no
32 > conditional dependency on ROOT!=/, so a package cannot demand that a
33 > tool be present on the host. Then, it may be a good idea to add a
34 > conditional dependency on ROOT!=/.
35
36 If I understand correctly, that would be like a CROSS_TDEPEND? If we
37 translate that to a conditional, it would become DEPEND="crosscompile? (
38 foo )", since our plan was to make DEPEND apply to ROOT!=/ and HDEPEND
39 apply to ROOT=/, right?
40
41 > In fact, I think that --crosscompile or FEATURES=crosscompile could
42 > actually be abolished and only this condition would be available. It's
43 > true that some packages would only use the host dependency if there's
44 > actual cross-compilation going on, but nothing will break. This would
45 > ease configuration and reduce the number of cases to be tested.
46
47 Yeah, the split between HDEPEND and DEPEND might be enough so that you
48 don't need these conditionals. If you're not really sure that the
49 conditionals are needed, then maybe it's better to eliminate them for now.
50 --
51 Thanks,
52 Zac