Bug 9293

Summary: bitbake: Add support for trigger event on errors like exceptions
Product: [Infrastructure] AutoBuilder Reporter: Aníbal Limón <anibal.limon>
Component: autobuilderAssignee: Aníbal Limón <anibal.limon>
Status: VERIFIED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: enhancement    
Priority: High CC: benjamin.esquivel, infras.ab.watcher, Infras.watcher, jose.perez.carranza, joshuagloe, pidge, poky.bs.watcher, poky.watcher
Version: 2.2   
Target Milestone: 2.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Aníbal Limón 2016-03-17 17:27:38 UTC
We need a mechanism for trigger events in error scenarios like exceptions, currently we have bb.build.TaskFailed event when tasks fails.

It could be done adding event trigger when call bb.error().

The performance needs to be evaluated to don't slow build times.
Comment 1 Joshua Lock 2016-03-29 15:59:58 UTC
Is it truly necessary to integrate this into the core of bitbake? Perhaps we would be better served by providing a wrapper which catches the non-zero exit codes and performs error reporting.

This way we make the feature (and any negative impact) opt-in and furthermore don't complicate the core bitbake code base unnecessarily.
Comment 2 Aníbal Limón 2016-03-29 16:09:30 UTC
(In reply to comment #1)
> Is it truly necessary to integrate this into the core of bitbake? Perhaps we
> would be better served by providing a wrapper which catches the non-zero
> exit codes and performs error reporting.
> 
> This way we make the feature (and any negative impact) opt-in and
> furthermore don't complicate the core bitbake code base unnecessarily.

This bug was filed by me for enable support for send generic errors to error-report web, currently the error-report class looks into task errors triggered by TaskFailed event.

Certainly we should take into account the performance metrics and the complexity of the implementation. I'll try to implement this approach but if it becomes too difficult to implement/maintain/performance then i'll change the implementation to review the retcode and if error parse output/logs but this requires another changes in the AB infrastructure also to get rid/move to script error-report class.
Comment 3 Aníbal Limón 2016-05-30 16:01:41 UTC
We decided that is better to have a process to monitor stdout of bitbake process and looks for exception/errors instead of modify bitbake code base for do it.

The current implementation is at level of Autobuilder and is almost finish, see [1].

[1] http://git.yoctoproject.org/cgit/cgit.cgi/yocto-autobuilder/log/?h=contrib/alimon/devel
Comment 4 Aníbal Limón 2016-06-21 23:12:16 UTC
This support was implemented inside of Yocto Autobuilder that's the reason for move to Autobuilder and now is on review at,

https://lists.yoctoproject.org/pipermail/yocto/2016-June/030742.html

Beth ack'ed the first part of changes so only need to review the v2.
Comment 6 Libertad 2016-07-20 19:35:21 UTC
From the nightly autobuilder you can see that in 

https://autobuilder.yoctoproject.org/main/builders/nightly-oe-selftest/builds/602

the error report is collected and sent.