From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 07E63138334 for ; Sat, 1 Jun 2019 22:29:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 15D31E07EA; Sat, 1 Jun 2019 22:29:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8F2F7E07EA for ; Sat, 1 Jun 2019 22:29:49 +0000 (UTC) Received: from symphony.aura-online.co.uk (154.189.187.81.in-addr.arpa [81.187.189.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chewi) by smtp.gentoo.org (Postfix) with ESMTPSA id 96FDB34551E; Sat, 1 Jun 2019 22:29:47 +0000 (UTC) From: James Le Cuirot To: gentoo-pms@lists.gentoo.org Cc: James Le Cuirot Subject: [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable Date: Sat, 1 Jun 2019 23:29:21 +0100 Message-Id: <20190601222921.12072-1-chewi@gentoo.org> X-Mailer: git-send-email 2.21.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Package Manager Specification discussions X-BeenThere: gentoo-pms@gentoo.org X-BeenThere: gentoo-pms@lists.gentoo.org Reply-To: gentoo-pms@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 9fe3daaf-e2dc-4615-9217-a5e05e61dda5 X-Archives-Hash: 3ce6aff4045f518e8f5f2fbd0f22811d 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 --- 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