public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: /, bin/
Date: Mon,  4 Dec 2023 06:45:47 +0000 (UTC)	[thread overview]
Message-ID: <1701672345.632fea4f4aa4bdca63bf6d8db266b09a6954e313.sam@gentoo> (raw)

commit:     632fea4f4aa4bdca63bf6d8db266b09a6954e313
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  2 22:53:49 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec  4 06:45:45 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=632fea4f

Set SYSROOT for has/best_version so that they work when IPC is disabled

This issue broke cross-compiling.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1198
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                 |  7 +++++++
 bin/phase-helpers.sh | 10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index ce9ed282b5..5561c7fe40 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
 --------------
 

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index ec634e536d..45a1639c42 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -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
@@ -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 ;;
@@ -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


             reply	other threads:[~2023-12-04  6:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04  6:45 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-13  2:34 [gentoo-commits] proj/portage:master commit in: /, bin/ Sam James
2023-12-27 21:18 Ulrich Müller
2023-05-17  6:20 Sam James
2023-05-01  7:21 Sam James
2022-12-05  4:04 Sam James
2022-09-29 20:45 Sam James
2022-09-29 20:45 Sam James
2022-09-29 20:45 Sam James
2022-09-29 20:45 Sam James
2022-09-29 20:45 Sam James
2022-08-19 17:59 Mike Gilbert
2022-07-18 20:42 Sam James
2020-08-01  1:57 Zac Medico
2017-09-02 21:37 Michał Górny
2014-08-19  7:01 Michał Górny
2014-08-12 21:55 Alexander Berntsen
2012-03-27 15:19 Zac Medico
2012-03-27 14:40 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1701672345.632fea4f4aa4bdca63bf6d8db266b09a6954e313.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox