On Wed, 2010-03-24 at 13:24 +0000, Richard Purdie wrote:
> 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.
I stand by this.
> > 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 :).
and I still believe that data transfer should not be relied upon by
poking into the data store directly by event handlers. Writes to the
datastore from the event handlers has never been supported and could
well break so some defined method of communication needs to be
established.
As someone just pointed out to me on IRC, that data store that is being
passed does not correspond to the current running task. This *is* a
problem.
For that reason I'm therefore thinking we should apply:
http://dan.rpsys.net/rp1
This makes sure the dictionary does correspond and probably unbreaks
some of your handlers but please consider my points above as writing to
the store is not supported, I can't stress that enough. It happens to
work, great but its pure luck.
I (and some others) are going to test that patch a bit and if it doesn't
break anything I'll apply it in a couple of days.
The -b fix you sent is also good and I plan to apply that after some
testing FWIW.
Cheers,
Richard
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev