Skip to content

Commit

Permalink
bootstrap-prefix: use full path for do_emerge_pkgs
Browse files Browse the repository at this point in the history
In the stage3 bootstrap we always prefer to use tools that have been built for
stage3; to accomplish this we ensure that it is the first thing evaluated in PATH.
Unfortunately, Portage, Python, and Python-exec are often pulled into the depgraph
at some point before we're fully boostrapped. To ensure that we don't try and execute
${EPREFIX}/usr/bin/emerge before we're ready, always provide the full path to the
bootstrap Python interpreter and emerge script.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
Closes: #37
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
Kangie authored and thesamesam committed May 28, 2024
1 parent e3da80a commit b736fab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/bootstrap-prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1785,10 +1785,16 @@ do_emerge_pkgs() {
&& export CFLAGS="${OVERRIDE_CFLAGS}"
[[ -n ${OVERRIDE_CXXFLAGS} ]] \
&& export CXXFLAGS="${OVERRIDE_CXXFLAGS}"
# In the stage3 bootstrap we always prefer to use tools that have been built for
# stage3; to accomplish this we ensure that it is the first thing evaluated in PATH.
# Unfortunately, Portage, Python, and Python-exec are often pulled into the depgraph
# at some point before we're fully boostrapped. To ensure that we don't try and execute
# ${EPREFIX}/usr/bin/emerge before we're ready, always provide the full path to the
# bootstrap Python interpreter and emerge script.
PORTAGE_SYNC_STALE=0 \
FEATURES="-news ${FEATURES}" \
USE="${myuse[*]}" \
emerge "${eopts[@]}" "${pkg}"
"${EPREFIX}"/tmp/bin/python "${EPREFIX}"/tmp/usr/bin/emerge "${eopts[@]}" "${pkg}"
) || return 1
done
}
Expand Down Expand Up @@ -3021,7 +3027,7 @@ EOF
exit 1
fi
fi

if ! [[ -e ${EPREFIX}/.stage1-finished ]] && ! bootstrap_stage1_log ; then
# stage 1 fail
cat << EOF
Expand Down

0 comments on commit b736fab

Please sign in to comment.