public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup
@ 2022-10-28 17:51 Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 1/6] scons-utils.eclass: Remove support for EAPI 0..6 Michał Górny
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Hi,

Here's a patchset that removes support for all old EAPIs from
scons-utils.eclass and adds support for EAPI 8.  While at it, I'm
updating docs and removing custom MAKEOPTS parser in favor
of makeopts_jobs.

Note that this currently breaks one last rited package (that still
uses EAPI 6), so it won't be merged before that one goes.


Michał Górny (6):
  scons-utils.eclass: Remove support for EAPI 0..6
  scons-utils.eclass: Use python_has_version
  scons-utils.eclass: Enable EAPI 8 support
  scons-utils.eclass: Update documentation
  scons-utils.eclass: Default SCONS_MIN_VERSION to current stable
  scons-utils.eclass: Reuse makeopts_jobs

 eclass/scons-utils.eclass   | 246 +++++-------------------------------
 eclass/tests/scons-utils.sh |  64 ----------
 2 files changed, 29 insertions(+), 281 deletions(-)
 delete mode 100755 eclass/tests/scons-utils.sh

-- 
2.38.1



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

* [gentoo-dev] [PATCH 1/6] scons-utils.eclass: Remove support for EAPI 0..6
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 2/6] scons-utils.eclass: Use python_has_version Michał Górny
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass | 126 +++++---------------------------------
 1 file changed, 17 insertions(+), 109 deletions(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index ff6550ae048a..ef26b564fb8c 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: scons-utils.eclass
 # @MAINTAINER:
 # mgorny@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 7
 # @BLURB: helper functions to deal with SCons buildsystem
 # @DESCRIPTION:
 # This eclass provides a set of function to help developers sanely call
@@ -38,7 +38,7 @@
 # PYTHON_COMPAT=( python2_7 )
 # inherit python-any-r1 scons-utils toolchain-funcs
 #
-# EAPI=5
+# EAPI=7
 #
 # src_configure() {
 # 	MYSCONS=(
@@ -64,14 +64,6 @@
 # @DESCRIPTION:
 # The minimal version of SCons required for the build to work.
 
-# @VARIABLE: myesconsargs
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# DEPRECATED, EAPI 0..5 ONLY: pass options to escons instead
-#
-# List of package-specific options to pass to all SCons calls. Supposed to be
-# set in src_configure().
-
 # @ECLASS_VARIABLE: SCONSOPTS
 # @USER_VARIABLE
 # @DEFAULT_UNSET
@@ -88,24 +80,10 @@
 # Much like EXTRA_EMAKE, this is not supposed to be used in make.conf
 # and not in ebuilds!
 
-# @ECLASS_VARIABLE: USE_SCONS_TRUE
-# @DESCRIPTION:
-# DEPRECATED: use usex instead
-#
-# The default value for truth in scons-use() (1 by default).
-: ${USE_SCONS_TRUE:=1}
-
-# @ECLASS_VARIABLE: USE_SCONS_FALSE
-# @DESCRIPTION:
-# DEPRECATED: use usex instead
-#
-# The default value for false in scons-use() (0 by default).
-: ${USE_SCONS_FALSE:=0}
-
 # -- EAPI support check --
 
 case ${EAPI:-0} in
-	0|1|2|3|4|5|6|7) ;;
+	7) ;;
 	*) die "EAPI ${EAPI} unsupported."
 esac
 
@@ -132,16 +110,13 @@ elif [[ ${_PYTHON_SINGLE_R1} ]]; then
 	BDEPEND="
 		$(python_gen_cond_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]")
 		${PYTHON_DEPS}"
-elif [[ ${EAPI:-0} == [0123456] ]]; then
-	# in older EAPIs, just force Python 2.7
-	BDEPEND="${SCONS_DEPEND}[python_targets_python2_7]"
 elif [[ ${_PYTHON_R1} ]]; then
 	# when using python-r1, you need to depend on scons yourself
 	# (depending on whether you need any-r1 or full -r1 API)
 	# -- since this is a breaking API change, it applies to EAPI 7+ only
 	BDEPEND=""
-elif [[ ${EAPI:-0} != [0123456] ]]; then
-	# in EAPI 7+, require appropriate eclass use
+else
+	# require appropriate eclass use
 	eerror "Using scons-utils.eclass without any python-r1 suite eclass is not supported."
 	eerror "Please make sure to configure and inherit appropriate -r1 eclass."
 	eerror "For more information and examples, please see:"
@@ -149,44 +124,30 @@ elif [[ ${EAPI:-0} != [0123456] ]]; then
 	die "Invalid use of scons-utils.eclass"
 fi
 
-if [[ ${EAPI:-0} == [0123456] ]]; then
-	DEPEND=${BDEPEND}
-	unset BDEPEND
-fi
-
 # -- public functions --
 
 # @FUNCTION: escons
 # @USAGE: [<args>...]
 # @DESCRIPTION:
 # Call scons, passing the supplied arguments. Like emake, this function
-# does die on failure in EAPI 4. Respects nonfatal in EAPI 6 and newer.
+# dies on failure, unless nonfatal is used.
 escons() {
 	local ret
 
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ ! ${EPYTHON} ]]; then
-		if [[ ${EAPI:-0} != [0123456] ]]; then
-			eerror "EPYTHON is unset while calling escons. This most likely means that"
-			eerror "the ebuild did not call the appropriate eclass function before calling scons."
-			if [[ ${_PYTHON_ANY_R1} ]]; then
-				eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()."
-			elif [[ ${_PYTHON_SINGLE_R1} ]]; then
-				eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()."
-			else # python-r1
-				eerror "Please ensure that python_setup is called before escons, or that escons"
-				eerror "is used within python_foreach_impl as appropriate."
-			fi
-			die "EPYTHON unset in escons"
-		else
-			local -x EPYTHON=python2.7
+		eerror "EPYTHON is unset while calling escons. This most likely means that"
+		eerror "the ebuild did not call the appropriate eclass function before calling scons."
+		if [[ ${_PYTHON_ANY_R1} ]]; then
+			eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()."
+		elif [[ ${_PYTHON_SINGLE_R1} ]]; then
+			eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()."
+		else # python-r1
+			eerror "Please ensure that python_setup is called before escons, or that escons"
+			eerror "is used within python_foreach_impl as appropriate."
 		fi
-	fi
-
-	# Use myesconsargs in EAPI 5 and older
-	if [[ ${EAPI} == [012345] ]]; then
-		set -- "${myesconsargs[@]}" "${@}"
+		die "EPYTHON unset in escons"
 	fi
 
 	# if SCONSOPTS are _unset_, use cleaned MAKEOPTS
@@ -200,22 +161,7 @@ escons() {
 
 	set -- scons ${SCONSOPTS} ${EXTRA_ESCONS} "${@}"
 	echo "${@}" >&2
-	"${@}"
-	ret=${?}
-
-	if [[ ${ret} -ne 0 ]]; then
-		case "${EAPI:-0}" in
-			0|1|2|3) # nonfatal in EAPIs 0 through 3
-				;;
-			4|5) # 100% fatal in 4 & 5
-				die "escons failed."
-				;;
-			*) # respect nonfatal in 6 onwards
-				die -n "escons failed."
-				;;
-		esac
-	fi
-	return ${ret}
+	"${@}" || die -n "escons failed."
 }
 
 # @FUNCTION: _scons_clean_makeopts
@@ -308,41 +254,3 @@ _scons_clean_makeopts() {
 	_SCONS_CACHE_SCONSOPTS=${SCONSOPTS}
 	debug-print "New SCONSOPTS: [${SCONSOPTS}]"
 }
-
-# @FUNCTION: use_scons
-# @USAGE: <use-flag> [var-name] [var-opt-true] [var-opt-false]
-# @DESCRIPTION:
-# DEPRECATED, EAPI 0..5 ONLY: use usex instead
-#
-# Output a SCons parameter with value depending on the USE flag state.
-# If the USE flag is set, output <var-name>=<var-opt-true>; otherwise
-# <var-name>=<var-opt-false>.
-#
-# If <var-name> is omitted, <use-flag> will be used instead. However,
-# if <use-flag> starts with an exclamation mark (!flag), 'no' will be
-# prepended to the name (e.g. noflag).
-#
-# If <var-opt-true> and/or <var-opt-false> are omitted,
-# ${USE_SCONS_TRUE} and/or ${USE_SCONS_FALSE} will be used instead.
-use_scons() {
-	[[ ${EAPI} == [012345] ]] \
-		|| die "${FUNCNAME} is banned in EAPI ${EAPI}, use usex instead"
-
-	local flag=${1}
-	local varname=${2:-${flag/\!/no}}
-	local vartrue=${3:-${USE_SCONS_TRUE}}
-	local varfalse=${4:-${USE_SCONS_FALSE}}
-
-	debug-print-function ${FUNCNAME} "${@}"
-
-	if [[ ${#} -eq 0 ]]; then
-		eerror "Usage: scons-use <use-flag> [var-name] [var-opt-true] [var-opt-false]"
-		die 'scons-use(): not enough arguments'
-	fi
-
-	if use "${flag}"; then
-		echo "${varname}=${vartrue}"
-	else
-		echo "${varname}=${varfalse}"
-	fi
-}
-- 
2.38.1



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

* [gentoo-dev] [PATCH 2/6] scons-utils.eclass: Use python_has_version
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 1/6] scons-utils.eclass: Remove support for EAPI 0..6 Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 3/6] scons-utils.eclass: Enable EAPI 8 support Michał Górny
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index ef26b564fb8c..78a9958ec422 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -102,7 +102,7 @@ if [[ ${_PYTHON_ANY_R1} ]]; then
 	BDEPEND="$(python_gen_any_dep "${SCONS_DEPEND}[\${PYTHON_USEDEP}]")"
 
 	scons-utils_python_check_deps() {
-		has_version "${SCONS_DEPEND}[${PYTHON_USEDEP}]"
+		python_has_version "${SCONS_DEPEND}[${PYTHON_USEDEP}]"
 	}
 	python_check_deps() { scons-utils_python_check_deps; }
 elif [[ ${_PYTHON_SINGLE_R1} ]]; then
-- 
2.38.1



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

* [gentoo-dev] [PATCH 3/6] scons-utils.eclass: Enable EAPI 8 support
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 1/6] scons-utils.eclass: Remove support for EAPI 0..6 Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 2/6] scons-utils.eclass: Use python_has_version Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 4/6] scons-utils.eclass: Update documentation Michał Górny
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index 78a9958ec422..212b29e089e8 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: scons-utils.eclass
 # @MAINTAINER:
 # mgorny@gentoo.org
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: helper functions to deal with SCons buildsystem
 # @DESCRIPTION:
 # This eclass provides a set of function to help developers sanely call
@@ -35,10 +35,10 @@
 #
 # @EXAMPLE:
 # @CODE
-# PYTHON_COMPAT=( python2_7 )
+# PYTHON_COMPAT=( python3_{8..11} )
 # inherit python-any-r1 scons-utils toolchain-funcs
 #
-# EAPI=7
+# EAPI=8
 #
 # src_configure() {
 # 	MYSCONS=(
@@ -83,7 +83,7 @@
 # -- EAPI support check --
 
 case ${EAPI:-0} in
-	7) ;;
+	7|8) ;;
 	*) die "EAPI ${EAPI} unsupported."
 esac
 
-- 
2.38.1



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

* [gentoo-dev] [PATCH 4/6] scons-utils.eclass: Update documentation
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
                   ` (2 preceding siblings ...)
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 3/6] scons-utils.eclass: Enable EAPI 8 support Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 5/6] scons-utils.eclass: Default SCONS_MIN_VERSION to current stable Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 6/6] scons-utils.eclass: Reuse makeopts_jobs Michał Górny
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index 212b29e089e8..b8e3332a1263 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -16,12 +16,13 @@
 # and use appropriate Python suite eclass to select the implementation.
 # The eclass needs to be inherited before scons-utils, and scons-utils
 # will automatically take advantage of it. For more details, please see:
-# https://wiki.gentoo.org/wiki/Project:Python/scons-utils_integration
+# https://projects.gentoo.org/python/guide/buildsys.html#scons
 #
 # Please note that SCons is more like a 'build system creation kit',
 # and requires a lot of upstream customization to be used sanely.
-# You will often need to request fixes upstream and/or patch the build
-# system. In particular:
+# We attempt to force sane behavior via custom patching but this is not
+# guaranteed to work. You will sometimes need to request fixes upstream
+# and/or patch the build system. In particular, normally:
 #
 # 1. There are no 'standard' variables. To respect CC, CXX, CFLAGS,
 # CXXFLAGS, CPPFLAGS, LDFLAGS, upstream needs to define appropriate
-- 
2.38.1



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

* [gentoo-dev] [PATCH 5/6] scons-utils.eclass: Default SCONS_MIN_VERSION to current stable
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
                   ` (3 preceding siblings ...)
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 4/6] scons-utils.eclass: Update documentation Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 6/6] scons-utils.eclass: Reuse makeopts_jobs Michał Górny
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index b8e3332a1263..cbe92f6fc385 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -64,6 +64,7 @@
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # The minimal version of SCons required for the build to work.
+: "${SCONS_MIN_VERSION:=4.4.0}"
 
 # @ECLASS_VARIABLE: SCONSOPTS
 # @USER_VARIABLE
@@ -92,11 +93,7 @@ inherit multiprocessing
 
 # -- ebuild variables setup --
 
-if [[ -n ${SCONS_MIN_VERSION} ]]; then
-	SCONS_DEPEND=">=dev-util/scons-${SCONS_MIN_VERSION}"
-else
-	SCONS_DEPEND="dev-util/scons"
-fi
+SCONS_DEPEND=">=dev-util/scons-${SCONS_MIN_VERSION}"
 
 if [[ ${_PYTHON_ANY_R1} ]]; then
 	# when using python-any-r1, use any-of dep API
-- 
2.38.1



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

* [gentoo-dev] [PATCH 6/6] scons-utils.eclass: Reuse makeopts_jobs
  2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
                   ` (4 preceding siblings ...)
  2022-10-28 17:51 ` [gentoo-dev] [PATCH 5/6] scons-utils.eclass: Default SCONS_MIN_VERSION to current stable Michał Górny
@ 2022-10-28 17:51 ` Michał Górny
  5 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-28 17:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/scons-utils.eclass   | 102 ++----------------------------------
 eclass/tests/scons-utils.sh |  64 ----------------------
 2 files changed, 4 insertions(+), 162 deletions(-)
 delete mode 100755 eclass/tests/scons-utils.sh

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index cbe92f6fc385..acb51300f348 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -71,8 +71,8 @@
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # The default set of options to pass to scons. Similar to MAKEOPTS,
-# supposed to be set in make.conf. If unset, escons() will use cleaned
-# up MAKEOPTS instead.
+# supposed to be set in make.conf. If unset, escons() will set -j
+# based on MAKEOPTS.
 
 # @ECLASS_VARIABLE: EXTRA_ESCONS
 # @USER_VARIABLE
@@ -148,11 +148,8 @@ escons() {
 		die "EPYTHON unset in escons"
 	fi
 
-	# if SCONSOPTS are _unset_, use cleaned MAKEOPTS
-	if [[ ! ${SCONSOPTS+set} ]]; then
-		local SCONSOPTS
-		_scons_clean_makeopts
-	fi
+	# if SCONSOPTS are unset, grab -j from MAKEOPTS
+	: "${SCONSOPTS:=-j$(makeopts_jobs)}"
 
 	# pass ebuild environment variables through!
 	local -x GENTOO_SCONS_ENV_PASSTHROUGH=1
@@ -161,94 +158,3 @@ escons() {
 	echo "${@}" >&2
 	"${@}" || die -n "escons failed."
 }
-
-# @FUNCTION: _scons_clean_makeopts
-# @USAGE: [makeflags] [...]
-# @INTERNAL
-# @DESCRIPTION:
-# Strip the supplied makeflags (or ${MAKEOPTS} if called without
-# an argument) of options not supported by SCons and make sure --jobs
-# gets an argument. Output the resulting flag list (suitable
-# for an assignment to SCONSOPTS).
-_scons_clean_makeopts() {
-	local new_makeopts=()
-
-	debug-print-function ${FUNCNAME} "${@}"
-
-	if [[ ${#} -eq 0 ]]; then
-		debug-print "Using MAKEOPTS: [${MAKEOPTS}]"
-		set -- ${MAKEOPTS}
-	else
-		# unquote if necessary
-		set -- ${*}
-	fi
-
-	# empty MAKEOPTS give out empty SCONSOPTS
-	# thus, we do need to worry about the initial setup
-	if [[ ${*} = ${_SCONS_CACHE_MAKEOPTS} ]]; then
-		SCONSOPTS=${_SCONS_CACHE_SCONSOPTS}
-		debug-print "Cache hit: [${SCONSOPTS}]"
-		return
-	fi
-	_SCONS_CACHE_MAKEOPTS=${*}
-
-	while [[ ${#} -gt 0 ]]; do
-		case ${1} in
-			# clean, simple to check -- we like that
-			--jobs=*|--keep-going)
-				new_makeopts+=( ${1} )
-				;;
-			# need to take a look at the next arg and guess
-			--jobs)
-				if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then
-					new_makeopts+=( ${1} ${2} )
-					shift
-				else
-					# no value means no limit, let's pass a default instead
-					new_makeopts+=( ${1}=$(( $(get_nproc) + 1 )) )
-				fi
-				;;
-			# strip other long options
-			--*)
-				;;
-			# short option hell
-			-*)
-				local str new_optstr
-				new_optstr=
-				str=${1#-}
-
-				while [[ -n ${str} ]]; do
-					case ${str} in
-						k*)
-							new_optstr+=k
-							;;
-						# -j needs to come last
-						j)
-							if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then
-								new_optstr+="j ${2}"
-								shift
-							else
-								new_optstr+="j $(( $(get_nproc) + 1 ))"
-							fi
-							;;
-						# otherwise, everything after -j is treated as an arg
-						j*)
-							new_optstr+=${str}
-							break
-							;;
-					esac
-					str=${str#?}
-				done
-
-				if [[ -n ${new_optstr} ]]; then
-					new_makeopts+=( -${new_optstr} )
-				fi
-				;;
-		esac
-		shift
-	done
-
-	SCONSOPTS=${new_makeopts[*]}
-	_SCONS_CACHE_SCONSOPTS=${SCONSOPTS}
-	debug-print "New SCONSOPTS: [${SCONSOPTS}]"
-}
diff --git a/eclass/tests/scons-utils.sh b/eclass/tests/scons-utils.sh
deleted file mode 100755
index 5f1cd2036047..000000000000
--- a/eclass/tests/scons-utils.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-_PYTHON_R1=1
-source tests-common.sh || exit
-
-inherit scons-utils
-
-test-scons_clean_makeopts() {
-	tbegin "scons_clean_makeopts() for ${1}"
-
-	local SCONSOPTS ret=0
-	_scons_clean_makeopts ${1}
-
-	if [[ ${SCONSOPTS} != ${2-${1}} ]]; then
-		eerror "Self-test failed:"
-		eindent
-		eerror "MAKEOPTS: ${1}"
-		eerror "Expected: ${2-${1}}"
-		eerror "Actual: ${SCONSOPTS}"
-		eoutdent
-		ret=1
-	fi
-
-	tend ${ret}
-	return ${ret}
-}
-
-# jobcount expected for non-specified state
-jc=$(( $(get_nproc) + 1 ))
-# failed test counter
-failed=0
-
-# sane MAKEOPTS
-test-scons_clean_makeopts '--jobs=14 -k'
-test-scons_clean_makeopts '--jobs=14 -k'
-test-scons_clean_makeopts '--jobs 15 -k'
-test-scons_clean_makeopts '--jobs=16 --keep-going'
-test-scons_clean_makeopts '-j17 --keep-going'
-test-scons_clean_makeopts '-j 18 --keep-going'
-
-# needing cleaning
-test-scons_clean_makeopts '--jobs -k' "--jobs=${jc} -k"
-test-scons_clean_makeopts '--jobs --keep-going' "--jobs=${jc} --keep-going"
-test-scons_clean_makeopts '-kj' "-kj ${jc}"
-
-# broken by definition (but passed as it breaks make as well)
-test-scons_clean_makeopts '-jk'
-test-scons_clean_makeopts '--jobs=randum'
-test-scons_clean_makeopts '-kjrandum'
-
-# needing stripping
-test-scons_clean_makeopts '--load-average=25 -kj16' '-kj16'
-test-scons_clean_makeopts '--load-average 25 -k -j17' '-k -j17'
-test-scons_clean_makeopts '-j2 HOME=/tmp' '-j2'
-test-scons_clean_makeopts '--jobs funnystuff -k' "--jobs=${jc} -k"
-
-# bug #388961
-test-scons_clean_makeopts '--jobs -l3' "--jobs=${jc}"
-test-scons_clean_makeopts '-j -l3' "-j ${jc}"
-
-texit
-- 
2.38.1



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

end of thread, other threads:[~2022-10-28 17:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 17:51 [gentoo-dev] [PATCH 0/6] scons-utils.eclass: EAPI 8 support and cleanup Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 1/6] scons-utils.eclass: Remove support for EAPI 0..6 Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 2/6] scons-utils.eclass: Use python_has_version Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 3/6] scons-utils.eclass: Enable EAPI 8 support Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 4/6] scons-utils.eclass: Update documentation Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 5/6] scons-utils.eclass: Default SCONS_MIN_VERSION to current stable Michał Górny
2022-10-28 17:51 ` [gentoo-dev] [PATCH 6/6] scons-utils.eclass: Reuse makeopts_jobs 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