Skip to content

Commit

Permalink
Set SYSROOT for has/best_version so that they work when IPC is disabled
Browse files Browse the repository at this point in the history
This issue broke cross-compiling.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
  • Loading branch information
chewi committed Dec 2, 2023
1 parent 84e1358 commit efae923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Release notes take the form of the following optional categories:
* Bug fixes
* Cleanups

portage-3.0.57 (UNRELEASED)
--------------

Bug fixes:
* Set SYSROOT appropriately for best_version and has_version so that they work
when cross-compiling and IPC is disabled.

portage-3.0.56 (2023-12-01)
--------------

Expand Down
10 changes: 7 additions & 3 deletions bin/phase-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,11 @@ __eapi8_src_prepare() {

___best_version_and_has_version_common() {
local atom root root_arg
local -a cmd=()

# If ROOT is set to / below then SYSROOT cannot point elsewhere. Even if
# ROOT is untouched, setting SYSROOT=/ for this command will always work.
local -a cmd=(env SYSROOT=/)

case $1 in
--host-root|-r|-d|-b)
root_arg=$1
Expand All @@ -932,7 +936,7 @@ ___best_version_and_has_version_common() {
# Since portageq requires the root argument be consistent
# with EPREFIX, ensure consistency here (bug #655414).
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
cmd+=(EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
else
root=/
fi ;;
Expand All @@ -948,7 +952,7 @@ ___best_version_and_has_version_common() {
# Use /${PORTAGE_OVERRIDE_EPREFIX#/} to support older
# EAPIs, as it is equivalent to BROOT.
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
cmd+=(EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
;;
esac
else
Expand Down

0 comments on commit efae923

Please sign in to comment.