[bitbake-devel] [PATCH 1/2] bb.build: in _exec_task, move TaskStarted into try/except

Christopher Larson kergoth at gmail.com
Thu Sep 15 21:15:46 UTC 2016


From: Christopher Larson <chris_larson at mentor.com>

We want any exceptions raised by the TaskStarted event handlers to be caught
by the existing exception handling, rather than unconditionally hitting the
exception formatting + traceback in exec_task, otherwise we can't cleanly exit
the task with a nice message from such a handler.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 lib/bb/build.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index fcf0149..28401b3 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -560,8 +560,8 @@ def _exec_task(fn, task, d, quieterr):
 
     flags = localdata.getVarFlags(task)
 
-    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
     try:
+        event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
         for func in (prefuncs or '').split():
             exec_func(func, localdata)
         exec_func(task, localdata)
-- 
2.8.0




More information about the bitbake-devel mailing list