summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
AgeCommit message (Collapse)Author
2011-06-09bitbake/event/ast: Add RecipePreFinalise eventRichard Purdie
One of the implications is we need to register the event handlers before executing the anonymous python functions. I can't find any issue with making that change in any existing metadata use cases. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08xmlrpc/event: Add ability to send pickled events to UI if requestedRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-02event: don't catch systemexit from handler executionChris Larson
This means that anyone firing an event can get a systemexit and result in their process exiting, which isn't ideal, but behaves the way it used to (in particular, ensures that a sanity check failure will halt the build). This should be revisited in the future. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-05-16Shift exception formatting into the UIChris Larson
Now we use bb.exceptions to pass pickleable traceback entries to the UI, and the UI is free to do whatever it wants to do with this information. By default, the log formatter for the UIs formats it with bb.exceptions. This also means that all exceptions should now show 3 lines of context and limit to 5 entries. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-04event: improve output for syntax errors in handlersChris Larson
Note: this includes IndentationError, which is a subclass of SyntaxError. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-04event: improve output when eventhandler exec failsChris Larson
- Name the event handler by its actual name, so the traceback shows it rather than 'tmpHandler'. - Rather than immediately aborting when encountering an event handler error, display an error message and try to continue. - Show a traceback for ordinary exceptions, skipping the first entry in the traceback, so it only shows the useful information. - Show an error, but no traceback, for SystemExit with a code other than 0. - For for SystemExit with a code of 0, simply continue silently. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-04-04event: register event handler functions, not code objectsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-03-03bitbake/event: fix some whitespace issuesJoshua Lock
(From Poky rev: b14cda62d075d1213fc4769aa6b3622a491b57d5) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03implement command to find configuration files for a config variableJoshua Lock
Some configuration variables (MACHINE, MACHINE-SDK and DISTRO) set which confguration files bitbake should use. The added command , findConfigFiles, enables a UI to query which files are suitable values for a specified parameter. (From Poky rev: 3939a216a53f58831e640e85ed95f7edff3ca76f) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03implement command to get all possible targets and their dependenciesJoshua Lock
Add a new command generateTargetsTree() which returns a dependency tree of possible targets (tasks and recipes) as well as their dependency information. Optional parameter 'klass' also ensures any recipes which inherit the specified class path (i.e. 'classes/image.bbclass') are included in the model (From Poky rev: 1b3eb0c35f504e8f652303a4b238034ecc5c5d02) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-08event: fix exception formatChris Larson
Forgot to concatenate the lines returned by format_exception. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-08event: limit the number of traceback entries to 5Chris Larson
This is slightly more sane. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-02-08Shift traceback pre-formatting into LogHandlerChris Larson
It's cleaner to leave it behaving as usual, passing the exception data in the exc_info attribute of the LogRecord where it normally lies, and then let LogHandler make it pickleable so it can be sent to the UI. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-10Inject taskpid into log records via our log handlerChris Larson
It turns out that while log filters added with addFilter are only associated with that logger, and not its children, handlers are inherited, and handlers can be filters. So, let's add filtering to our existing LogHandler class which dispatches our log records as bitbake events. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-10event.py: Improve debug about invalid eventsRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07Merge branch 'poky-sync'Chris Larson
* poky-sync: build: kill unneeded environment setup bits parse: save python functions into the metadata Include exported variables in task process env runqueue: start implementing quieterrors Overhaul environment handling runqueue: resurrect use of file objects for pipein/pipeout runqueue: clean up message log levels runqueue: use correct task ID when checking validity of setscene tasks Add support for 'noexec' tasks runqueue: implement cache checking from metadata runqueue: pass task hash information to tasks runqueue: avoid unnecessary delays Implement task signatures data: Add emit_func and generate_dependencies codeparser: Implement persistent cache data_smart: track variable references codeparser: add module for parsing shell/python runqueue: implement scenequeue fetch: add SRC_URI checksum Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-05event: use BBLogFormatter in print_ui_queueChris Larson
This ensures that when a failure occurs very early on in bitbake startup, the message formatting ematches that used by the UIs. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2011-01-04event: fix unicode handler registrationBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-29runqueue: resurrect use of file objects for pipein/pipeoutChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-16server: fix interrupt handling for processBob Foerster
SIGINT is now blocked within the server context, thus allowing the UI to fully handle all user interaction. There is no longer a need to check for KeyboardInterrupt Exceptions anywhere within the server context. Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-16Show the user progress when loading the cacheBob Foerster
Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-16Run the server and UI in separate processesBob Foerster
This uses the python multiprocessing module, both to spawn the server process and for communication between the processes. Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-10event: use cPickle for eventsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-12-10bb.event: fix MsgBase ref in fire_class_handlersChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-30cooker: no cached in progressbar and add ETAChris Larson
Rather than updating the progress bar based on the recipe being processed (whether cached or parsed), consider only parsed recipes. This reduces the instability in progress rate introduced by the cached entries, and allows the ETA to be resurrected and be a bit more useful. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-11-21Split up the ParseProgress eventChris Larson
We now have ParseStarted, ParseProgress, and ParseCompleted. I think this clarifies matters, and avoids sending all our statistics with every parse progress event. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-28Fix syntax issue and don't include 'd' in ui_queueChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-28Queue up events before the UI is spawnedChris Larson
- Queue up any events fired to the UI before the UI exists - At exit, check if UIs exist, and if not, flush the queue of LogRecords to the console directly. - When establishing a connection from the UI to the server, flush the queue of events to the queue in the server connection, so the UI will receive them when it begins its event loop. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-09-09Turn Event into a new style classChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-08-27Use logging in the knotty ui, and pass the log record across directlyChris Larson
This kills firing of Msg* events in favor of just passing along LogRecord objects. These objects hold more than just level and message, but can also have exception information, so the UI can decide what to do with that. As an aside, when using the 'none' server, this results in the log messages in the server being displayed directly via the logging module and the UI's handler, rather than going through the server's event queue. As a result of doing it this way, we have to override the event handlers of the base logger when spawning a worker process, to ensure they log via events rather than directly. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-08-27Use the python logging module under the hood for bb.msgChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-06-08Move the output of no provider and multiple provider messages into the UIChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Apply the 2to3 print function transformChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Import fixupsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Formatting cleanupsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09Don't run metadata event handlers for bb.msg eventsChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-04-09bb.event: NotHandled and Handled are on the way outChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-31Add & utilize a simple_exec utility functionChris Larson
Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-30Consolidate the exec/eval bits, switch anonfunc to better_exec, etcChris Larson
The methodpool, ${@} expansions, anonymous python functions, event handlers now all run with the same global context, ensuring a consistent environment for them. Added a bb.utils.better_eval function which does an eval() with the same globals as better_exec. Signed-off-by: Chris Larson <chris_larson@mentor.com>
2010-03-25bitbake/event.py: Run class eventhandlers in the task context but ensure UI ↵Richard Purdie
handlers run in the server context (From Poky rev: d3d36d9f440288fa8bc0901ebefe875fc92409c4) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21bitbake/event: If the server disappears, we just exit tooRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20Improve BBCLASSEXTEND handling for skipped packages and report better ↵Richard Purdie
parsing statistics Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19runqueue.py: Improve IPC between worker threads and the server allowing ↵Richard Purdie
proper event handling Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19event.py: Convert to using pickle for events and isinstance in knotty UI handlerRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19event.py: Drop unused eventsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-19event.py: Pass the datastore to the fire command, don't build it into eventsRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-14Add a RecipeParsed event, which can be used as an alternative to anonymous ↵Chris Larson
functions. Signed-off-by: Chris Larson <clarson@mvista.com>
2008-12-06event.py: Remove the Pkg* events, the make no sense in the task based model ↵Richard Purdie
bitbake now uses (From Rob Bradford in Poky)
2008-12-06Add the pid to the event messages so we can identify which worker events ↵Richard Purdie
come from (From Rob Bradford in Poky)
2008-04-06event.py: Clean up the event handling code and some legacy funtionsRichard Purdie