bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Anuj Mittal <anuj.mittal@intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [1.50][PATCH 2/3] build: Avoid duplicating logs in verbose mode
Date: Wed, 29 Sep 2021 22:57:12 +0800	[thread overview]
Message-ID: <58a63ad099521cbb514fa53ae97840fc12ce8813.1632902709.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1632902709.git.anuj.mittal@intel.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e2c1afda4cb8023ed4ffeb5dc5bee4f0055659a8)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/build.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 24ce327c5..39e7dba02 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -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
-- 
2.31.1



  parent reply	other threads:[~2021-09-29 14:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 14:57 [1.50][PATCH 0/3] Review request Anuj Mittal
2021-09-29 14:57 ` [1.50][PATCH 1/3] process: Don't include logs in error message if piping them Anuj Mittal
2021-09-29 14:57 ` Anuj Mittal [this message]
2021-09-29 14:57 ` [1.50][PATCH 3/3] build: Handle SystemExit in python tasks correctly Anuj Mittal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58a63ad099521cbb514fa53ae97840fc12ce8813.1632902709.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).