public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/4] waf-utils.eclass: various improvements
@ 2022-11-19  9:23 Matthew Smith
  2022-11-19  9:23 ` [gentoo-dev] [PATCH 1/4] waf-utils.eclass: add default mandir setting Matthew Smith
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Matthew Smith @ 2022-11-19  9:23 UTC (permalink / raw
  To: gentoo-dev

Patch series to fix the remaining open waf-utils.eclass bugs.

--
Matthew Smith (4):
      waf-utils.eclass: add default mandir setting
      waf-utils.eclass: pass EXTRA_ECONF to configure
      waf-utils.eclass: set --jobs=1 for configure and install
      waf-utils.eclass: set PYTHONHASHSEED environment variable

 eclass/waf-utils.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-dev] [PATCH 1/4] waf-utils.eclass: add default mandir setting
  2022-11-19  9:23 [gentoo-dev] [PATCH 0/4] waf-utils.eclass: various improvements Matthew Smith
@ 2022-11-19  9:23 ` Matthew Smith
  2022-11-19  9:23 ` [gentoo-dev] [PATCH 2/4] waf-utils.eclass: pass EXTRA_ECONF to configure Matthew Smith
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Matthew Smith @ 2022-11-19  9:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: Matthew Smith

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

diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index cfcefed5227..b73866072f7 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -88,6 +88,9 @@ waf-utils_src_configure() {
 	if [[ ${waf_help} == *--libdir* ]]; then
 		conf_args+=( --libdir="${EPREFIX}/usr/$(get_libdir)" )
 	fi
+	if [[ ${waf_help} == *--mandir* ]]; then
+		conf_args+=( --mandir="${EPREFIX}"/usr/share/man )
+	fi
 
 	tc-export AR CC CPP CXX RANLIB
 
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-dev] [PATCH 2/4] waf-utils.eclass: pass EXTRA_ECONF to configure
  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 ` 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 ` [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable Matthew Smith
  3 siblings, 0 replies; 6+ messages in thread
From: Matthew Smith @ 2022-11-19  9:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: Matthew Smith

Allows users to override configure flags as in other build systems.

Closes: https://bugs.gentoo.org/817419
Signed-off-by: Matthew Smith <matthew@gentoo.org>
---
 eclass/waf-utils.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index b73866072f7..2a386e99165 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -102,6 +102,7 @@ waf-utils_src_configure() {
 		"--prefix=${EPREFIX}/usr"
 		"${conf_args[@]}"
 		"${@}"
+		${EXTRA_ECONF}
 		configure
 	)
 
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-dev] [PATCH 3/4] waf-utils.eclass: set --jobs=1 for configure and install
  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 ` Matthew Smith
  2022-11-19  9:23 ` [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable Matthew Smith
  3 siblings, 0 replies; 6+ messages in thread
From: Matthew Smith @ 2022-11-19  9:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: Matthew Smith

MAKEOPTS was only respected for src_compile, leading to out-of-memory
issues for some users. Force number of concurrent jobs to 1 in src_configure
and src_install phases as it doesn't provide much of a benefit anyway.

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

diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 2a386e99165..66041fc3f60 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -99,6 +99,7 @@ waf-utils_src_configure() {
 		LINKFLAGS="${CFLAGS} ${LDFLAGS}"
 		PKGCONFIG="$(tc-getPKG_CONFIG)"
 		"${WAF_BINARY}"
+		"--jobs=1"
 		"--prefix=${EPREFIX}/usr"
 		"${conf_args[@]}"
 		"${@}"
@@ -129,8 +130,8 @@ waf-utils_src_compile() {
 waf-utils_src_install() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	echo "\"${WAF_BINARY}\" --destdir=\"${D}\" ${*} install"
-	"${WAF_BINARY}" --destdir="${D}" "${@}" install  || die "Make install failed"
+	echo "\"${WAF_BINARY}\" --jobs=1 --destdir=\"${D}\" ${*} install"
+	"${WAF_BINARY}" --jobs=1 --destdir="${D}" "${@}" install || die "Make install failed"
 
 	# Manual document installation
 	einstalldocs
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable
  2022-11-19  9:23 [gentoo-dev] [PATCH 0/4] waf-utils.eclass: various improvements Matthew Smith
                   ` (2 preceding siblings ...)
  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
  2022-11-19 10:11   ` Michał Górny
  3 siblings, 1 reply; 6+ messages in thread
From: Matthew Smith @ 2022-11-19  9:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: Matthew Smith

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable
  2022-11-19  9:23 ` [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable Matthew Smith
@ 2022-11-19 10:11   ` Michał Górny
  0 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2022-11-19 10:11 UTC (permalink / raw
  To: gentoo-dev; +Cc: Matthew Smith

On Sat, 2022-11-19 at 09:23 +0000, Matthew Smith wrote:
> 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.
> 

Normally I'd say that avoiding build system bugs like this goes against
Gentoo principles but given this is waf...

-- 
Best regards,
Michał Górny



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-19 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [gentoo-dev] [PATCH 4/4] waf-utils.eclass: set PYTHONHASHSEED environment variable Matthew Smith
2022-11-19 10:11   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox