Hi,

On Sun, 2010-03-21 at 20:46 +0100, Enrico Scholz wrote:
> while trying bitbake 1.10 devel branch, I see that some of my old event
> handlers won't work anymore.  E.g. it is not possible to get value of
> ${PV} or ${PN} in TaskSucceeded or Failed handlers.

For this specific case, its assumed that the event itself should contain
the appropriate information such as the name and version of the task
that failed or succeeded. If events are missing information that would
be sensible/useful, lets add it.

> My old event handlers stored information into the local datastore and
> relied that event handlers are executed in same context as the executed
> task.  E.g. I did
> 
> | data.setVar('_PKG_RESOURCES_CHLD', 
> resource.getrusage(resource.RUSAGE_CHILDREN), e.data)
> 
> on PkgStarted and evaluated this later in TaskSucceeded to calculate the
> consumed resources[1].

> As events are fired asynchronously in 1.10 and are evaluated in an own
> process, this will not work anymore.

Right, that is a consequence of some of the changes that have been made.
We had problems with event delivery and the whole concept of the child
processes firing events is problematic at best as the child can have an
out of date copy of the handlers list leading to missing information and
so on.

> I played a little bit around and created a patch[2] which satisfies my
> requirements.  But it is very special and situated for my purposes.
> 
> I would like to get some kind of synchronous event- (or better: plugin-)
> handlers which are executed on top of bb.event.fire().  E.g.

My suggestion would be to use the persist_data module (patches to add
missing functionality are welcome), or write a new module for bitbake
that can be used to store/transfer data if you don't like that one :).

I really don't want to go back to synchronous events as there is no nice
way to have it work properly. Think about your synchronous handler
making a bb.debug() call and the headaches involved in making sure that
is logged properly...

Cheers,

Richard

_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to