[bitbake-devel] [PATCH 2/2] bb.build: in _exec_task, catch BBHandledException

Christopher Larson chris_larson at mentor.com
Fri Sep 16 20:02:04 UTC 2016


On Fri, Sep 16, 2016 at 9:34 AM, Christopher Larson <chris_larson at mentor.com
> wrote:

> On Thu, Sep 15, 2016 at 2:15 PM, Christopher Larson <kergoth at gmail.com>
> wrote:
>
>> From: Christopher Larson <chris_larson at mentor.com>
>>
>> We don't want a traceback for this exception, we need to catch it, fire
>> TaskFailed, and return failure.
>>
>> Signed-off-by: Christopher Larson <chris_larson at mentor.com>
>> ---
>>  lib/bb/build.py | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/lib/bb/build.py b/lib/bb/build.py
>> index 28401b3..8581e72 100644
>> --- a/lib/bb/build.py
>> +++ b/lib/bb/build.py
>> @@ -575,6 +575,9 @@ def _exec_task(fn, task, d, quieterr):
>>              logger.error(str(exc))
>>              event.fire(TaskFailed(task, logfn, localdata, errprinted),
>> localdata)
>>          return 1
>> +    except bb.BBHandledException:
>> +        event.fire(TaskFailed(task, logfn, localdata, True), localdata)
>> +        return 1
>>
>
> Don’t merge this, v2 is forthcoming. Apparently firing the TaskFailed is
> problematic if it was the TaskStarted event handler which failed, as the UI
> won’t have the pid of the task, resulting in this:
>
> Traceback (most recent call last):
>   File "/scratch/dogwood/pdk-licensing/poky/bitbake/lib/bb/ui/knotty.py",
> line 426, in main
>     helper.eventHandler(event)
>   File "/scratch/dogwood/pdk-licensing/poky/bitbake/lib/bb/ui/uihelper.py",
> line 48, in eventHandler
>     del self.running_tasks[event.pid]
>

This is superceded by 'bb.build: in _exec_task, catch errors from
TaskStarted’. Please review/apply that rather than this. Thanks.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160916/9467a5bb/attachment-0002.html>


More information about the bitbake-devel mailing list