summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-19 17:41:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-24 11:05:16 +0000
commitd3f32d158427725385011ba146e1415f658a8651 (patch)
tree33755f97cc913a188398c089a46cb086723cb44b
parentca162b5063ac877eac4987c1b5312109b5157a2a (diff)
downloadpoky-d3f32d158427725385011ba146e1415f658a8651.tar.gz
bitbake: build: Tweak exception handling for setscene tasks
If an unexpected exception occurs in a setscene task, it is currently hidden from the user and not recorded in any logs. This isn't helpful to debug such failures. Change the code so that even in the "silent" or "quiet" task case (setscene tasks), a warning is shown with the traceback unless it was an "handled" exception. This means the failing function can show it's own warning/error instead if it wants to and then raise a handled event. (Bitbake rev: 43dcb2b2a2b95a5c959be57bca94fb7190ea6257) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 41dcdc61eb40def8c14a42e8d7bb9ce5a34afa57) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/build.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 7e4ab9f64c..44d1d9d981 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -715,19 +715,23 @@ def _exec_task(fn, task, d, quieterr):
715 logger.debug2("Zero size logfn %s, removing", logfn) 715 logger.debug2("Zero size logfn %s, removing", logfn)
716 bb.utils.remove(logfn) 716 bb.utils.remove(logfn)
717 bb.utils.remove(loglink) 717 bb.utils.remove(loglink)
718 except bb.BBHandledException:
719 event.fire(TaskFailed(task, fn, logfn, localdata, True), localdata)
720 return 1
721 except (Exception, SystemExit) as exc: 718 except (Exception, SystemExit) as exc:
719 handled = False
720 if isinstance(exc, bb.BBHandledException):
721 handled = True
722
722 if quieterr: 723 if quieterr:
724 if not handled:
725 logger.warning(repr(exc))
723 event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata) 726 event.fire(TaskFailedSilent(task, fn, logfn, localdata), localdata)
724 else: 727 else:
725 errprinted = errchk.triggered 728 errprinted = errchk.triggered
726 # If the output is already on stdout, we've printed the information in the 729 # If the output is already on stdout, we've printed the information in the
727 # logs once already so don't duplicate 730 # logs once already so don't duplicate
728 if verboseStdoutLogging: 731 if verboseStdoutLogging or handled:
729 errprinted = True 732 errprinted = True
730 logger.error(repr(exc)) 733 if not handled:
734 logger.error(repr(exc))
731 event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata) 735 event.fire(TaskFailed(task, fn, logfn, localdata, errprinted), localdata)
732 return 1 736 return 1
733 737