Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] crossdev: installing _host_ build dependencies not automatic?
Date: Thu, 04 May 2017 08:21:29
Message-Id: 20170504102113.789c9c78@gentoo.org
In Reply to: Re: [gentoo-dev] crossdev: installing _host_ build dependencies not automatic? by James Le Cuirot
1 On Wed, 3 May 2017 22:47:18 +0100
2 James Le Cuirot <chewi@g.o> wrote:
3
4 > On Wed, 3 May 2017 17:56:43 +0200
5 > Alexis Ballier <aballier@g.o> wrote:
6 >
7 > > On Wed, 3 May 2017 12:05:48 +0200
8 > > "Paweł Hajdan, Jr." <phajdan.jr@g.o> wrote:
9 > >
10 > > > I encountered <https://bugs.gentoo.org/show_bug.cgi?id=617276>
11 > > > while working on some cross-compiling project.
12 > > >
13 > > > Admittedly, it may not be that easy to handle host package
14 > > > dependencies fully automatically.
15 > > >
16 > > > I'm wondering - is it documented what portage guarantees, and
17 > > > what I'm expected to just manually handle to provide host build
18 > > > dependencies?
19 > > >
20 > > > Any other advice about properly using crossdev would also be
21 > > > appreciated. I'd be happy to test and help improve things.
22 > >
23 > >
24 > > From man emerge:
25 > >
26 > >
27 > > --root-deps[=rdeps]
28 > > If no argument is given then build-time dependencies
29 > > of packages for ROOT are installed to ROOT instead of /. If the
30 > > rdeps argument is given then discard all build-time
31 > > dependencies of packages for ROOT. This option is only meaningful
32 > > when used together with ROOT and it should not be enabled under
33 > > normal circumstances!
34 > >
35 > > Does not affect EAPIs that support HDEPEND.
36 > > Experimental EAPI 5-hdepend provides HDEPEND as a new means to
37 > > adjust installation into "/" and ROOT. If ebuilds using EAPIs
38 > > which do not support HDEPEND are built in the same
39 > > emerge run as those using EAPIs which do support
40 > > HDEPEND, this option affects only the former.
41 > >
42 > >
43 > > crossdev wrappers set --root-deps=rdeps (read cross-emerge, this
44 > > can be overriden), but be careful: If you only care about getting
45 > > all the deps and maybe more then removing --root-deps might help
46 > > you. However, when cross compiling you will likely run into broken
47 > > deps since / and ROOT will not use the same keyword visibility.
48 >
49 > I was going to point to crossdev's use of --root-deps=rdeps too. I did
50 > wonder why on earth this was even added. I overrode it for quite a
51 > while and didn't have any issue. History showed that it was added by
52 > solar without much of an explanation. He's no longer around to ask. It
53 > wasn't until I tried to build a brand new ppc64le system recently that
54 > I finally found a reason for it, though I'm not sure it was the
55 > original reason. The multilib ABI USE flags start conflicting horribly
56 > in cross situations and this option seems to be the only way around it
57 > at present.
58
59 there's that and e.g. you might want to enable USE=mmal for cross
60 compiling to a raspberry pi; raspberrypi-userland will be in DEPEND but
61 you wont be able to merge it into /
62
63 > I doubt keyword visibility is an issue. Portage uses a different
64 > configuration between / and ROOT when cross-compiling. I don't think
65 > it tries to force the same package versions beyond what is specified
66 > in the ebuild. For pure build-time dependencies, the package will
67 > only be installed to / anyway (i.e. you don't need cmake in ROOT) so
68 > there is nothing to enforce here.
69
70
71 The issue is that we can't distinguish between target build time
72 dependencies (libraries, headers, etc.) and host build time
73 dependencies (cmake, autotools, etc.). While --root-deps=rdeps avoids
74 most of the problems at the cost of missing host deps, it still fails
75 horribly for target build time only deps (e.g. pure headers libraries).