commit:     ab0b90331a2a4810eedb5cec4f50d7777ac9d848
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 19 14:39:12 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jun 25 08:32:29 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ab0b9033

introduce the 'stacked-prefix' FEATURE

When we merge into another EPREFIX, but not into some ROOT,
and CHOST is equal to CBUILD, build tools found in EPREFIX
perfectly work for the current build environment.
In a "stacked prefix" we explicitly utilize this situation.

This is useful during prefix bootstrap (#655414, #655326), but also to
build packages for targets unable to support the full portage toolchain
(native Windows, MinGW), but otherwise do not require a full cross
compilation setup.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 bin/phase-helpers.sh | 14 ++++++++++++++
 pym/portage/const.py |  1 +
 2 files changed, 15 insertions(+)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 75d92b407..c5a818db7 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -927,6 +927,20 @@ ___best_version_and_has_version_common() {
                        fi ;;
        esac
 
+       if ___eapi_has_prefix_variables         &&
+          has "${root_arg}" '--host-root' '-b' &&
+          has stacked-prefix ${FEATURES}       &&
+          [[ -z ${ROOT%/} ]]                   &&
+          [[ ${CBUILD} == ${CHOST} ]]          &&
+          [[ ${EPREFIX} != ${BROOT-${PORTAGE_OVERRIDE_EPREFIX}} ]] &&
+       :; then
+               # When we merge into another EPREFIX, but not into some ROOT,
+               # and CHOST is equal to CBUILD, build tools found in EPREFIX
+               # perfectly work for the current build environment.
+               # In a "stacked prefix" we explicitly utilize this situation.
+               "${FUNCNAME[1]}" "${atom}" && return 0
+       fi
+
        if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
                cmd+=("${PORTAGE_BIN_PATH}"/ebuild-ipc "${FUNCNAME[1]}" 
"${root}" "${atom}")
        else

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 3c23c85ed..342b09174 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -202,6 +202,7 @@ SUPPORTED_FEATURES       = frozenset([
        "splitdebug",
        "split-elog",
        "split-log",
+       "stacked-prefix",
        "strict",
        "strict-keepdir",
        "stricter",

Reply via email to