Skip to contentSkip to conversation

build: Avoid duplicating logs in verbose mode

PATCH New Richard Purdie 1 participant 1 message Sep 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Avoid duplicating logs in verbose mode

With "bitbake -v", for task failures you'd see the log output twice. Avoid this by using the existing "did we print info" switch.

---
 lib/bb/build.py | 4 ++++
 1 file changed, 4 insertions(+)
lib/bb/build.py +4 -0
index 9862e8878e..1e062adb51 100644
@@ -699,6 +699,10 @@ def _exec_task(fn, task, d, quieterr):
                 event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata)
             else:
                 errprinted = errchk.triggered
+                # If the output is already on stdout, we've printed the information in the
+                # logs once already so don't duplicate
+                if verboseStdoutLogging:
+                    errprinted = True
                 logger.error(str(exc))
                 event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata)
             return 1
Signature · 1 line
2.32.0