commit:     010d688e6bd9bb19460b920896549e67a8cb5004
Author:     Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com>
AuthorDate: Sat Nov 19 07:02:21 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 00:52:11 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=010d688e

ebuild/doebuild.py: use -Oline if MAKEOPTS unset

If `MAKEOPTS` is unset in `make.conf`, add
`GNUMAKEFLAGS="--output-sync=line"` to the environment to ensure proper
synchronization of output when doing parallel builds. `GNUMAKEFLAGS` is
used to avoid portability issues from passing the non-standard option
directly to `make`.

Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/package/ebuild/doebuild.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/portage/package/ebuild/doebuild.py 
b/lib/portage/package/ebuild/doebuild.py
index b72d61c7a..2226812e3 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -592,6 +592,8 @@ def doebuild_environment(
             nproc = get_cpu_count()
             if nproc:
                 mysettings["MAKEOPTS"] = "-j%d" % (nproc)
+            if "GNUMAKEFLAGS" not in mysettings:
+                mysettings["GNUMAKEFLAGS"] = "--output-sync=line"
 
         if not eapi_exports_KV(eapi):
             # Discard KV for EAPIs that don't support it. Cached KV is restored

Reply via email to