bitbake: bb.build: in _exec_task, catch errors from TaskStarted

We don't always want a traceback when an exception is raised by the
TaskStarted event handler. Silently return if we get a SystemExit or
HandledException, and print the error and return for FuncFailed.

This is done via a separate try/catch block, to avoid firing TaskFailed if all
the TaskStarted event handlers didn't complete, otherwise the bitbake UIs get
unhappy.

(Bitbake rev: ca5b788280ad4303cc08a376e847cbbeda31970c)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Christopher Larson 2016-10-04 09:11:23 -07:00 committed by Richard Purdie
parent 1110dde73a
commit 7d27275ef8
1 changed files with 24 additions and 16 deletions

View File

@ -565,7 +565,15 @@ def _exec_task(fn, task, d, quieterr):
flags = localdata.getVarFlags(task)
try:
try:
event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
except (bb.BBHandledException, SystemExit):
return 1
except FuncFailed as exc:
logger.error(str(exc))
return 1
try:
for func in (prefuncs or '').split():
exec_func(func, localdata)