-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Wed, 31 Jul 2019 21:40:19 +0100 James Le Cuirot <ch...@gentoo.org> wrote:
> On Wed, 31 Jul 2019 15:51:58 +0200 > Alexis Ballier <aball...@gentoo.org> wrote: > > > On Tue, 30 Jul 2019 23:26:27 +0100 > > James Le Cuirot <ch...@gentoo.org> wrote: > > > > > > Admittedly without a full understanding of the problem, but this > > > > looks wrong to me: SYSROOT, EPREFIX and BROOT are only relevant > > > > in build phases (src_*); (EPREFIX is a little special here but > > > > mostly for convenience). ROOT is only relevant in pkg_* phases. > > > > I don't see how this can work. Say I build a binpkg with ROOT=/ > > > > then use that binpkg with ROOT=/somewhere, you can't go back > > > > and change SYSROOT. > > > > > > ROOT is used to determine ESYSROOT, not the other way around. As > > > you say, (E)SYSROOT is only relevant in src phases so it doesn't > > > matter if ROOT has changed when installing a binpkg. > > > > I am missing something here: You are making ESYSROOT depend on the > > value of ROOT, so how can it not matter ? > > What I am trying to say (somewhat unsuccessfully!) is that the value > of (E)SYSROOT only changes how the package is built, not what the > resulting package looks like. It's where all the headers and libraries > are sourced from at build time, which is irrelevant at runtime. err, SYSROOT does change what the resulting package looks like: it defines ABI (headers and needed entries for example). > So why does ROOT affect it? Normally you install the packages for > BDEPEND, DEPEND, and RDEPEND to the same location. If BDEPEND and > RDEPEND are installed to different locations (ROOT!=/) then DEPEND > will almost always be installed to one of the other two. If either of > those two locations is prefixed then we need the prefix for DEPEND's > location to match, otherwise it wouldn't actually be the same > location. Using ROOT allows us to figure this out automatically in a > way that covers all sensible use cases and avoids accidentally > falling into an unsupported case. So, now let's simplify this a bit and forget about prefix and crossdev for a moment. Say I am building an atom chroot (for nfs root) on an haswell desktop. I set ROOT=SYSROOT=/atomchroot. My desktop has CFLAGS for haswell, and I have atom CFLAGS in /atomchroot/etc/portage/make.conf. When I build something and portage installs a BDEPEND to /, I want it to use my / configuration, and when it is in /atomchroot I want it to use the configuration from there. emerge has command line options to do that but I am not sure if this is properly specified in PMS. Now, say I am doing the same on a prefix haswell desktop. With your algorithm, we have SYSROOT==ROOT so ESYSROOT is EPREFIX/SYSROOT. However, what I want is a normal chroot with EPREFIX=/ here, so when should one use ESYSROOT in an ebuild in that case ? where does this EPREFIX comes from by the way ? To me, this looks more of a general problem of defining where the configuration is taken from, so that we can set EPREFIX independently if it is SYSROOT or BROOT. > I hope that's clearer. Sorry :-( -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQSpOxaxaZikKNVNlsYOJUi7xgflrgUCXUL2ygAKCRAOJUi7xgfl rkwRAP9LDImZBCYxsWKMjT/ckCeK0hOLtctdpZuBwzjv5RIuiAD/cTUj7P7h9rBd gYaEEI+pqdN25ZNbjao/8w/j7SsXUMo= =WYef -----END PGP SIGNATURE-----