public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matthew Smith <matthew@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Matthew Smith <matthew@gentoo.org>
Subject: [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable
Date: Sat, 19 Nov 2022 09:23:58 +0000	[thread overview]
Message-ID: <20221119092358.280588-5-matthew@gentoo.org> (raw)
In-Reply-To: <20221119092358.280588-1-matthew@gentoo.org>

waf relies on Python set order, so let's make it consistent to avoid
brittle builds.

Added into existing phase functions instead of pkg_setup to retain
compatibility with existing ebuilds.

Signed-off-by: Matthew Smith <matthew@gentoo.org>
---
 eclass/waf-utils.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 66041fc3f60..3ff74db0d79 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -95,6 +95,7 @@ waf-utils_src_configure() {
 	tc-export AR CC CPP CXX RANLIB
 
 	local CMD=(
+		PYTHONHASHSEED=1
 		CCFLAGS="${CFLAGS}"
 		LINKFLAGS="${CFLAGS} ${LDFLAGS}"
 		PKGCONFIG="$(tc-getPKG_CONFIG)"
@@ -119,6 +120,8 @@ waf-utils_src_compile() {
 	local _mywafconfig
 	[[ ${WAF_VERBOSE} == ON ]] && _mywafconfig="--verbose"
 
+	export PYTHONHASHSEED=1
+
 	local jobs="--jobs=$(makeopts_jobs)"
 	echo "\"${WAF_BINARY}\" build ${_mywafconfig} ${jobs} ${*}"
 	"${WAF_BINARY}" ${_mywafconfig} ${jobs} "${@}" || die "build failed"
@@ -130,6 +133,8 @@ waf-utils_src_compile() {
 waf-utils_src_install() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	export PYTHONHASHSEED=1
+
 	echo "\"${WAF_BINARY}\" --jobs=1 --destdir=\"${D}\" ${*} install"
 	"${WAF_BINARY}" --jobs=1 --destdir="${D}" "${@}" install || die "Make install failed"
 
-- 
2.38.1



  parent reply	other threads:[~2022-11-19  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19  9:23 [gentoo-dev] [PATCH 0/4] waf-utils.eclass: various improvements Matthew Smith
2022-11-19  9:23 ` [gentoo-dev] [PATCH 1/4] waf-utils.eclass: add default mandir setting Matthew Smith
2022-11-19  9:23 ` [gentoo-dev] [PATCH 2/4] waf-utils.eclass: pass EXTRA_ECONF to configure Matthew Smith
2022-11-19  9:23 ` [gentoo-dev] [PATCH 3/4] waf-utils.eclass: set --jobs=1 for configure and install Matthew Smith
2022-11-19  9:23 ` Matthew Smith [this message]
2022-11-19 10:11   ` [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable Michał Górny

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=20221119092358.280588-5-matthew@gentoo.org \
    --to=matthew@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