Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: James Le Cuirot <chewi@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PMS] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable
Date: Thu, 01 Aug 2019 14:27:34
Message-Id: 20190801162722.1c4bc536@gentoo.org
In Reply to: Re: [gentoo-dev] [PMS] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable by James Le Cuirot
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On Wed, 31 Jul 2019 21:40:19 +0100
5 James Le Cuirot <chewi@g.o> wrote:
6
7 > On Wed, 31 Jul 2019 15:51:58 +0200
8 > Alexis Ballier <aballier@g.o> wrote:
9 >
10 > > On Tue, 30 Jul 2019 23:26:27 +0100
11 > > James Le Cuirot <chewi@g.o> wrote:
12 > >
13 > > > > Admittedly without a full understanding of the problem, but this
14 > > > > looks wrong to me: SYSROOT, EPREFIX and BROOT are only relevant
15 > > > > in build phases (src_*); (EPREFIX is a little special here but
16 > > > > mostly for convenience). ROOT is only relevant in pkg_* phases.
17 > > > > I don't see how this can work. Say I build a binpkg with ROOT=/
18 > > > > then use that binpkg with ROOT=/somewhere, you can't go back
19 > > > > and change SYSROOT.
20 > > >
21 > > > ROOT is used to determine ESYSROOT, not the other way around. As
22 > > > you say, (E)SYSROOT is only relevant in src phases so it doesn't
23 > > > matter if ROOT has changed when installing a binpkg.
24 > >
25 > > I am missing something here: You are making ESYSROOT depend on the
26 > > value of ROOT, so how can it not matter ?
27 >
28 > What I am trying to say (somewhat unsuccessfully!) is that the value
29 > of (E)SYSROOT only changes how the package is built, not what the
30 > resulting package looks like. It's where all the headers and libraries
31 > are sourced from at build time, which is irrelevant at runtime.
32
33 err, SYSROOT does change what the resulting package looks like: it
34 defines ABI (headers and needed entries for example).
35
36 > So why does ROOT affect it? Normally you install the packages for
37 > BDEPEND, DEPEND, and RDEPEND to the same location. If BDEPEND and
38 > RDEPEND are installed to different locations (ROOT!=/) then DEPEND
39 > will almost always be installed to one of the other two. If either of
40 > those two locations is prefixed then we need the prefix for DEPEND's
41 > location to match, otherwise it wouldn't actually be the same
42 > location. Using ROOT allows us to figure this out automatically in a
43 > way that covers all sensible use cases and avoids accidentally
44 > falling into an unsupported case.
45
46
47 So, now let's simplify this a bit and forget about prefix and crossdev
48 for a moment. Say I am building an atom chroot (for nfs root) on an
49 haswell desktop. I set ROOT=SYSROOT=/atomchroot. My desktop has CFLAGS
50 for haswell, and I have atom CFLAGS in
51 /atomchroot/etc/portage/make.conf. When I build something and portage
52 installs a BDEPEND to /, I want it to use my / configuration, and when
53 it is in /atomchroot I want it to use the configuration from there.
54 emerge has command line options to do that but I am not sure if this is
55 properly specified in PMS.
56
57
58 Now, say I am doing the same on a prefix haswell desktop. With your
59 algorithm, we have SYSROOT==ROOT so ESYSROOT is EPREFIX/SYSROOT.
60 However, what I want is a normal chroot with EPREFIX=/ here, so when
61 should one use ESYSROOT in an ebuild in that case ? where does this
62 EPREFIX comes from by the way ?
63
64
65 To me, this looks more of a general problem of defining where the
66 configuration is taken from, so that we can set EPREFIX independently
67 if it is SYSROOT or BROOT.
68
69
70
71 > I hope that's clearer.
72
73 Sorry :-(
74 -----BEGIN PGP SIGNATURE-----
75
76 iHUEAREIAB0WIQSpOxaxaZikKNVNlsYOJUi7xgflrgUCXUL2ygAKCRAOJUi7xgfl
77 rkwRAP9LDImZBCYxsWKMjT/ckCeK0hOLtctdpZuBwzjv5RIuiAD/cTUj7P7h9rBd
78 gYaEEI+pqdN25ZNbjao/8w/j7SsXUMo=
79 =WYef
80 -----END PGP SIGNATURE-----

Replies