Gentoo Archives: gentoo-pms

From: James Le Cuirot <chewi@g.o>
To: gentoo-pms@l.g.o
Subject: Re: [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable
Date: Thu, 13 Jun 2019 20:10:27
Message-Id: 20190613210956.165c5961@symphony.aura-online.co.uk
In Reply to: Re: [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable by Ulrich Mueller
1 On Thu, 13 Jun 2019 12:30 +0100
2 Ulrich Mueller <ulm@g.o> wrote in #gentoo-dev:
3
4 > <ulm> Chewi: tbh, I don't understand your update for ESYSROOT
5 > <ulm> SYSROOT is related to DEPEND/CHOST type dependencies
6 > <ulm> so why would you have ESYSROOT="/${BROOT}" if SYSROOT is equal to / ? <ulm> since BROOT is related to BDEPEND/CBUILD
7
8 I kind of see what you mean but I've been thinking of SYSROOT as being
9 more like a mechanism to choose between building against BROOT, EROOT
10 (previously the only two valid options), or some other unprefixed
11 location. There is no dedicated variable for SYSROOT's prefix so the
12 user cannot directly define it and it can therefore only be calculated
13 from BROOT when SYSROOT=/ or EROOT when SYSROOT=${ROOT}.
14
15 > <ulm> but if SYSROOT is blank, then ESYSROOT will be blank too, ignoring EPREFIX altogether? (or at least, that's how I read your patch)
16
17 What gave you that impression? The rule is that if the prefix cannot be
18 calculated because SYSROOT is neither / nor ROOT then we have to assume
19 no prefix. Where else could we get a prefix from?
20
21 You may think that we should just create that missing SYSROOT prefix
22 variable but consider that the distinct "somewhere else" location is
23 not intended for general use. In other words, you wouldn't execute
24 commands from it or chroot into it and therefore there is no value in
25 allowing it to be prefixed. Typically this location would
26 be /usr/${CHOST} as set up by crossdev.
27
28 I haven't forgotten about the cross-prefix case. In this scenario, both
29 ROOT=/ and SYSROOT=/ but BROOT and EPREFIX are different. Which prefix
30 do we choose? We pick EPREFIX because the prefix guys try to use the
31 target prefix as much as possible. Once SYSROOT has the OS headers and
32 libc headers, you should be able to build anything.
33
34 Does this help?
35
36 --
37 James Le Cuirot (chewi)
38 Gentoo Linux Developer

Replies