summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: event.py, knotty.py, ncurses.py, runningbuild.py: Add support for ↵Jason Wessel2012-09-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | LogExecTTY event The LogExecTTY even is intended to provide the ability to spawn a task on a the controlling tty, if a tty is availble. When a controlling tty is not availble the previous behavior is preserved where a warning is issued about the action an end user must execute. All the available UI's were tested against the new event type. This feature is primarily intended for hooking up a screen client session automatically on the controlling tty to allow for a more streamlined end user experience when using a pure command line driven environment. The changes that send the LogExecTTY event are in the oe-core side. (Bitbake rev: cffe80d82a46aaf52ff4a7b6409435754043553f) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: compat, event: use OrderedDict from py2.7 for the event handlersChristopher Larson2012-09-201-1/+2
| | | | | | | | | | | | This ensures that our event handlers get run in registration order, making the behavior more deterministic. I pulled in the python2.7 OrderedDict to avoid essentially reimplementing a version of it ourselves, figuring we can drop it when we bump our required python version next. (Bitbake rev: 44aa0b0537d3fbd1272015e7677948f84d8c0607) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/event: improve handling of event queue on exitPaul Eggleton2012-09-141-0/+12
| | | | | | | | | | | | | | If BitBake exits before a UI handler (server) has been registered, we print the event queue; if there are any errors or other non-debug messages just print these and suppress the rest of the message queue. This improves the output when sanity check failures occur with OE-Core by avoiding printing a long stream of uninformative debug messages. (Bitbake rev: 8668a94cb1841798636b68fe123400d6b81f6574) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: event/ast: Use better_exec instead of simple_execRichard Purdie2012-08-221-1/+1
| | | | | | | | | | | | This improves the stacktraces dumped by bitbake when for example anonymous python functions fail. Also default to passing code strings to better_exec to match the behaviour of simple_exec to aid the transition. (Bitbake rev: 7e8205929ae953731a6854ea80b197847cff5771) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk: fire event DISKFULL when terminate buildKang Kai2012-08-021-0/+8
| | | | | | | | | | | | | | | Part of [Yocto #2168] Add a event DiskFull to descript the termination by disk monitor. Update check() to fire the event DiskFull when terminates the build. This could help UIs to deal this scenario and show more information to end user. (Bitbake rev: 0a0fca3d94a1db6458ae21501a66461a334410ed) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* hob: handle sanity check failures as a separate eventPaul Eggleton2012-05-301-0/+8
| | | | | | | | | | | | | | | | In order to show a friendlier error message that does not bury the actual sanity error in our typical preamble about disabling sanity checks, use a separate event to indicate that sanity checks failed. This change is intended to work together with the related change to sanity.bbclass in OE-Core. Fixes [YOCTO #2336]. (Bitbake rev: 24b631acdaa143a4de39c6e1328849660c66f219) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event.py: Add SanityCheck and SanityCheckPassed eventsDongxiao Xu2012-04-241-0/+10
| | | | | | | (Bitbake rev: 4d7bf9d813229b78b1cd87d06f7042e7923b7db4) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: change for adding progress bar in Hob2.Shane Wang2012-02-231-23/+60
| | | | | | | | | | | | | The changes include: - Clean some events in event.py - Fire essential events for Hob2 to handle with more information. - knotty changes (Bitbake rev: 9ede881620c501574f014e600cea6947ea908ac2) Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event.py: Add new events RequestPackageInfo and PackageInfoDongxiao Xu2012-02-231-0/+13
| | | | | | | | | | | | RequestPackageInfo is triggered by GUI client to request the available package information. PackageInfo event is to pass package information back to GUI. (Bitbake rev: 9020c2d4476766f63ff7e024bbd99043d06feefc) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cooker: remove command import in cooker.pyDongxiao Xu2012-01-061-0/+8
| | | | | | | | | | | | | There is no direct use of command in cooker.py, and it is using bb.command instead. Remove command in the import list. This fixes a problem of embedded import between command.py and cooker.py. (Bitbake rev: c353316b2efcc7a893d6b4aa9a9647d51a6f69e3) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/event: Allow event handlers to quietly raise SkipPackage eventsRichard Purdie2011-09-021-0/+2
| | | | | | (Bitbake rev: 2a7c92bdadf9a86d9ea2ea0c128108e38e0e97e5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: show more information for NoProvider errorsPaul Eggleton2011-07-271-1/+2
| | | | | | | | | | | | | | | | | | "Nothing PROVIDES" errors often come up when a recipe has been skipped for some reason, and therefore it is useful to print out that reason information when showing the error so that the user understands why the error has occurred. Given that we already feed the reason information into the skiplist for various situations (COMMERCIAL_LICENSE, COMPATIBLE_MACHINE etc.) this should now output a useful error message for skipped recipes. Fixes [YOCTO #846], [YOCTO #1127] (Bitbake rev: 6765218430e31c165888f26fbc75023c89a6eab2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: fix the event display order when exiting earlyChris Larson2011-07-211-2/+1
| | | | | | | | | | | | It was displaying the log messages in LIFO order, which isn't what we expect to see. Thankfully this only occurred during an early abort (e.g. config file parsing error), but those are the cases where it's very important to see accurate messages, to diagnose. (Bitbake rev: b838e0f3a1b481c295f66f5c9f561fa4d51de673) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cooker|command|event: add new command findFilesMatchingInDirJoshua Lock2011-07-011-0/+10
| | | | | | | | | | | | | | This command can be used to search each BBPATH for files in the passed directory which have a filename matching the supplied pattern. This is implemented for use from the GUI (to determine the available PACKAGE_CLASSES) but has been written so as to be generically useful and reusable. (Bitbake rev: 2a599812a57cb0b964880a6a2b7548423497ea92) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* command|cooker|event: add findConfigFilePath commandJoshua Lock2011-07-011-0/+8
| | | | | | | | | This takes the name of a .conf file and returns the full path to it (Bitbake rev: 22c8600b885faf841795b872d82f68dfb644a26e) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/event/ast: Add RecipePreFinalise eventRichard Purdie2011-06-091-3/+7
| | | | | | | | | | 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. (Bitbake rev: a981df3cc9bf410d24f39919959952bdc6c76d03) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Shift exception formatting into the UIChris Larson2011-06-081-0/+7
| | | | | | | | | | | | | 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. (Bitbake rev: ee48d628ee038bd72e1cd94aa75f5ccbacbcee4c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake none/xmlrpc servers: Only send pickled events to the xmlrpc serverRichard Purdie2011-06-081-1/+4
| | | | | | | Only the xmlrpc server needs pickled events. Use the function names to signify this requirement. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: don't catch systemexit from handler executionChris Larson2011-06-021-1/+1
| | | | | | | | | | | | 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. (Bitbake rev: d6a0ffdd583be3df734171d7e91d334f798a79ce) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: improve output for syntax errors in handlersChris Larson2011-05-061-3/+9
| | | | | | | | | Note: this includes IndentationError, which is a subclass of SyntaxError. (Bitbake rev: 156ea134e82d873ca4b5343261da2291a2b32ef6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: improve output when eventhandler exec failsChris Larson2011-05-061-11/+31
| | | | | | | | | | | | | | | | - 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. (Bitbake rev: faf682dfc23b7ef2ece04f7d50f9741224bb3bb0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: register event handler functions, not code objectsChris Larson2011-05-061-12/+10
| | | | | | | (Bitbake rev: be647dac9d458ee4b289ff5f66ed95b311d398d8) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/event: fix some whitespace issuesJoshua Lock2011-02-241-3/+1
| | | | Signed-off-by: Joshua Lock <josh@linux.intel.com>
* bitbake: implement command to find configuration files for a config variableJoshua Lock2011-02-241-0/+10
| | | | | | | | | 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. Signed-off-by: Joshua Lock <josh@linux.intel.com>
* bitbake: implement command to get all possible targets and their dependenciesJoshua Lock2011-02-241-0/+9
| | | | | | | | | | 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 Signed-off-by: Joshua Lock <josh@linux.intel.com>
* bitbake: event/build: Drop stdout specific handling for python messages as ↵Richard Purdie2011-02-071-4/+0
| | | | | | this is no longer needed with newer log handling Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Inject taskpid into log records via our log handlerChris Larson2011-01-101-0/+4
| | | | | | | | | | | | 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. (Bitbake rev: 0153ace246e7c88366f45c8f035a2b4505a1c115) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Update event queue handling to match upstream bitbakeRichard Purdie2011-01-101-2/+0
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: use BBLogFormatter in print_ui_queueChris Larson2011-01-061-1/+2
| | | | | | | | | | This ensures that when a failure occurs very early on in bitbake startup, the message formatting ematches that used by the UIs. (Bitbake rev: c8ff0fd3e9f050a668f1a069cf37ee37db3664fa) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* event: fix unicode handler registrationBernhard Reutner-Fischer2011-01-041-1/+1
| | | | | | | (Bitbake rev: 413af91e56a6d2368f6cbe22c0e2a337e1289e55) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Sync a load of whitespace and other non-functionality changes with ↵Richard Purdie2011-01-041-1/+1
| | | | | | bitbake uptream Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Show the user progress when loading the cacheBob Foerster2011-01-041-0/+19
| | | | | | | | (Bitbake rev: bdd7813d8eecf7b6b636322e748ca6bf69118513) Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* event: use cPickle for eventsChris Larson2011-01-041-1/+4
| | | | | | | (Bitbake rev: b16c0c1dc3b7e03b02555e9803767a0d695e67f1) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bb.event: fix MsgBase ref in fire_class_handlersChris Larson2011-01-041-2/+1
| | | | | | | (Bitbake rev: db7f960e5f103a424a4319f1867fb540e643c1ec) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: no cached in progressbar and add ETAChris Larson2011-01-041-3/+1
| | | | | | | | | | | | 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. (Bitbake rev: 618480f7739f6ae846f67a57bee5a78efb37839d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: sync the cache file to disk in the backgroundChris Larson2011-01-041-4/+16
| | | | | | | | | | | | | | | | This version uses a thread rather than a process, to avoid problems with waitpid handling. This gives slightly less overall build time reduction than the separate process for it did (this reduces a -c compile coreutils-native by about 3 seconds, while the process reduced it by 7 seconds), however this time is quite insignificant relative to a typical build. The biggest issue with non-backgrounded syncing is the perceived delay before work begins, and this resolves that without breaking anything, or so it seems. (Bitbake rev: 5ab6c5c7b007b8c77c751582141afc07c183d672) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Fix syntax issue and don't include 'd' in ui_queueChris Larson2011-01-041-2/+2
| | | | | | | (Bitbake rev: bed8e09971dc577f5443ad3d89aa14634c54eb16) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Queue up events before the UI is spawnedChris Larson2011-01-041-0/+21
| | | | | | | | | | | | | | - 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. (Bitbake rev: 73488aeb317ed306f2ecf99cc9d3708526a5933c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Turn Event into a new style classChris Larson2011-01-041-1/+1
| | | | | | | (Bitbake rev: b42221cabeb1193ade134d1d3c0318203ab8eb93) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Use logging in the knotty ui, and pass the log record across directlyChris Larson2011-01-041-15/+3
| | | | | | | | | | | | | | | | | | 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. (Bitbake rev: c23c015cf8af1868faf293b19b80a5faf7e736a5) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Use the python logging module under the hood for bb.msgChris Larson2011-01-041-2/+49
| | | | | | | (Bitbake rev: 47ca82397bc395b598c6b68b24cdee9e0d8a76d8) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Correctly route events from the worker to the serverRichard Purdie2010-08-201-0/+1
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Switch to use subprocess for forking tasks and FAKEROOTENV to run ↵Richard Purdie2010-08-191-6/+5
| | | | | | shell and python under a fakeroot environment Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Move the output of no provider and multiple provider messages into the UIChris Larson2010-07-021-1/+2
| | | | | | | (Bitbake rev: 36b980c16bf74b3c2066cc120f9f27e11f189a63) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Apply the 2to3 print function transformChris Larson2010-07-021-2/+2
| | | | | | | (Bitbake rev: ff2e28d0d9723ccd0e9dd635447b6d889cc9f597) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Import fixupsChris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Formatting cleanupsChris Larson2010-07-021-3/+2
| | | | | | | (Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Don't run metadata event handlers for bb.msg eventsChris Larson2010-07-021-0/+4
| | | | | | | (Bitbake rev: 297305b3742323d09d9ca58e958c4f18e945a148) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bb.event: NotHandled and Handled are on the way outChris Larson2010-07-021-2/+6
| | | | | | | (Bitbake rev: ed35b30f8e09b0bfc15102fa6483c55d6b7d61de) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Add & utilize a simple_exec utility functionChris Larson2010-07-021-1/+1
| | | | | | | (Bitbake rev: 5ead16f14f996bcbb2fb14277b8ce5a9317b8160) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>