public inbox for gentoo-pms@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable
@ 2019-06-01 22:29 James Le Cuirot
  2019-06-02  6:10 ` Michał Górny
  2019-06-02 12:28 ` Ulrich Mueller
  0 siblings, 2 replies; 11+ messages in thread
From: James Le Cuirot @ 2019-06-01 22:29 UTC (permalink / raw
  To: gentoo-pms; +Cc: James Le Cuirot

Unfortunately my conception of ESYSROOT was a little short-sighted. It
was previously defined as SYSROOT + EPREFIX but if SYSROOT does not
equal ROOT then EPREFIX does not make sense in this context. Consider
a more concrete example:

BROOT=/foo
ROOT=/bar
PREFIX=/baz
EROOT=/bar/baz
SYSROOT=/

In this scenario, ESYSROOT should be /foo (matching BROOT), not
/baz. From the build system's perspective, /baz does not even exist.

It was also originally envisaged (but not stated in PMS) that SYSROOT
would only ever need to equal / or ROOT as a distinct SYSROOT would
have no benefit. A check was added to Portage to ensure this held.
Myself, the ChromiumOS team, and others have since been caught out by
this check when trying to bootstrap brand new systems from scratch.
You cannot bootstrap with no headers at all! The check will therefore
be adjusted to merely ensure that SYSROOT is / when ROOT is /.

As a result of this original design, no prefix variable for a distinct
SYSROOT was ever established. We therefore assume a blank prefix in
this context. A distinct SYSROOT is most likely to point to a crossdev
toolchain under /usr/${CHOST} but even if pointed elsewhere, it could
include a prefix and still work effectively.

A single variable to hold the SYSROOT prefix, whether determined by /,
ROOT, or the user, would have been nice but it is too late to
introduce one now. In practise, you are unlikely to need one as the
SYSROOT is almost entirely used as a source of headers and libraries
that are best referenced using ESYSROOT. Otherwise, you could simply
derive the value from ${ESYSROOT#${SYSROOT}}.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 dependencies.tex    | 12 ++++++------
 ebuild-env-vars.tex |  7 ++++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/dependencies.tex b/dependencies.tex
index 44382d1..acfebc1 100644
--- a/dependencies.tex
+++ b/dependencies.tex
@@ -32,13 +32,13 @@
     \label{tab:dep-class-api}
     \begin{tabular}{llll}
       \toprule
-                                & \t{BDEPEND}     & \t{DEPEND}         & \t{RDEPEND}, \t{PDEPEND} \\
+                                & \t{BDEPEND}     & \t{DEPEND}                                                                                                                     & \t{RDEPEND}, \t{PDEPEND} \\
       \midrule
-      Binary compatible with    & \t{CBUILD}      & \t{CHOST}          & \t{CHOST}         \\
-      Base unprefixed path      & \t{/}           & \t{\$\{SYSROOT\}}  & \t{\$\{ROOT\}}    \\
-      Relevant offset-prefix    & \t{\$\{BROOT\}} & \t{\$\{EPREFIX\}}  & \t{\$\{EPREFIX\}} \\
-      Path combined with prefix & \t{\$\{BROOT\}} & \t{\$\{ESYSROOT\}} & \t{\$\{EROOT\}}   \\
-      PM query command option   & \t{-b}          & \t{-d}             & \t{-r}            \\
+      Binary compatible with    & \t{CBUILD}      & \t{CHOST}                                                                                                                      & \t{CHOST}         \\
+      Base unprefixed path      & \t{/}           & \t{\$\{SYSROOT\}}                                                                                                              & \t{\$\{ROOT\}}    \\
+      Relevant offset-prefix    & \t{\$\{BROOT\}} & \t{\$\{BROOT\}}, \t{\$\{EPREFIX\}}, or blank if \t{\$\{SYSROOT\}} equals \t{/}, \t{\$\{ROOT\}}, or something else respectively & \t{\$\{EPREFIX\}} \\
+      Path combined with prefix & \t{\$\{BROOT\}} & \t{\$\{ESYSROOT\}}                                                                                                             & \t{\$\{EROOT\}}   \\
+      PM query command option   & \t{-b}          & \t{-d}                                                                                                                         & \t{-r}            \\
       \bottomrule
     \end{tabular}
 \end{centertable}
diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
index 660d17b..45f0a7b 100644
--- a/ebuild-env-vars.tex
+++ b/ebuild-env-vars.tex
@@ -141,9 +141,10 @@ variable.
 \t{ESYSROOT} &
     Ditto &
     No &
-    Contains the concatenation of the paths in the \t{SYSROOT} and \t{EPREFIX} variables,
-    for convenience. See also the \t{EPREFIX} variable. Only for EAPIs listed
-    in table~\ref{tab:offset-env-vars-table} as supporting \t{ESYSROOT}. \\
+    Contains the concatenation of the \t{SYSROOT} path and applicable prefix value. The prefix value
+    is \t{BROOT}, \t{EPREFIX}, or blank if \t{SYSROOT} is equal to /, \t{ROOT}, or something else
+    respectively. Only for EAPIs listed in table~\ref{tab:offset-env-vars-table} as supporting
+    \t{ESYSROOT}. \\
 \t{BROOT} &
     Ditto &
     No &
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-06-15  8:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-01 22:29 [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable James Le Cuirot
2019-06-02  6:10 ` Michał Górny
2019-06-12 22:05   ` James Le Cuirot
2019-06-02 12:28 ` Ulrich Mueller
2019-06-12 22:05   ` James Le Cuirot
2019-06-14  7:07     ` Ulrich Mueller
2019-06-13 20:09   ` James Le Cuirot
2019-06-13 22:17     ` Ulrich Mueller
2019-06-14 22:23       ` James Le Cuirot
2019-06-14 22:30         ` James Le Cuirot
2019-06-15  8:18         ` Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox