commit:     da7c15042191648cb21a886b8afcf739b55c66c3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  9 00:11:57 2025 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Nov  9 00:39:02 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=da7c1504

emake: ignore MAKEOPTS if MAKEFLAGS is set

The two variables are currently mutually exclusive because
MAKEOPTS resets the MAKEFLAGS jobserver mode like this:

make -j8 -l8
make: warning: -j8 forced in submake: resetting jobserver mode.

Since functions like ___makeopts_jobs currently support MAKEOPTS
and not MAKEFLAGS, it can still be useful to set MAKEOPTS in
addition to MAKEFLAGS.

Fixes: 6f958be3cfa5054541ab3db0bcff73a496ecd0be
Bug: https://bugs.gentoo.org/692576
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild-helpers/emake | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake
index 33af49f831..d52adb5843 100755
--- a/bin/ebuild-helpers/emake
+++ b/bin/ebuild-helpers/emake
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # emake: Run make and automatically pass along flags set in the env.  We 
support
@@ -11,6 +11,9 @@
 
 source "${PORTAGE_BIN_PATH:?}"/isolated-functions.sh || exit
 
+# Prevent MAKEOPTS from resetting MAKEFLAGS jobserver mode for bug 692576.
+[[ -n ${MAKEFLAGS} ]] && unset MAKEOPTS
+
 cmd=(
        ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
 )

Reply via email to