summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-07-19fetch2: fire an event when there are missing checksumspaule/tinfoil-fixes-bb3Paul Eggleton
If BB_STRICT_CHECKSUMS is set to anything other than "1" i.e. we're not going to raise an error, then fire an event so that scripts can listen for it and get the checksums. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19fetch2: allow hiding checksum warningPaul Eggleton
If BB_STRICT_CHECKSUMS is set to "ignore" then don't display a warning if no checksums are specified in the recipe. This is not intended to be used from recipes - it is needed when we move to using more standard code paths to fetch new files from scripts i.e. where we don't know what the checksums are in advance. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: add more doc commentsPaul Eggleton
We want this API to be easier to use, so add missing function documentation to help with that. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: add simple API for getting cached recipe informationPaul Eggleton
A common task for tinfoil-using scripts is to iterate over all recipes. This isn't too difficult with the current API, but the pkg_* variables are a little awkward and are really designed for bitbake's internal usage - and it gets a bit more difficult when you want to access some of the other information such as packages and rprovides. To resolve this, create a new recipe info class and add an all_recipes() function to generate this for all recipes. Also add a get_recipe_info() function to get the information for a specific recipe (by PN). (It might perhaps be suggested that we already have a structure similar to this in the cache, however the one we add here is designed for external use and allows the internal structures to change if needed without affecting the API). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: enable access to additional cached itemsPaul Eggleton
Add access to fn_provides, packages, packages_dynamic and rproviders on the recipecache object. This requires an additional corresponding command plumbing to be added. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: add functionality for running full buildsPaul Eggleton
Up to this point, if you wanted to run build tasks in the normal way they get run from a python script, there was no other way than to shell out to bitbake. Worse than that, you couldn't have tinfoil active during that because only one bitbake instance could be running at once. As long as we're prepared to handle the events produced, we can create a wrapper around calling the buildTargets command. Borrow code from knotty to do this in such a way that we get the expected running task display (courtesy of TermFilter) and Ctrl+C handling. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19knotty: make it possible to use termfilter without either consolePaul Eggleton
This isn't useful for knotty itself, but for use from tinfoil in case we can't get access to either the console or errconsole, allow either to be unspecified (None). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19lib/bb/ui/uihelper: indicate to caller of eventHandler() if events handledPaul Eggleton
It is useful for the caller to know whether the uihelper has handled the event passed so that it can skip other event handling code if so. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19lib/bb/event: refactor printing eventsPaul Eggleton
We really ought to have just one place where the string representation of these events is produced. This doesn't take any real control away from the UI - if an alternative representation is desired, that can still be made. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: set a flag when recipes have been parsedPaul Eggleton
Make it easy to determine if recipes are parsed (and thus information about available recipes is in memory). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: add a parse_recipes() functionPaul Eggleton
Python style recommends underscore based naming rather than camelCase, and thus the former has been used for most of tinfoil's functions. Add an underscored version of parseRecipes() for consistency and change the one place we call it to use the new version. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-19tinfoil: add internal mode to build_file() functionPaul Eggleton
In OE's devtool we want to repeatedly run build_file() without showing unnecessary messages and triggering buildhistory for each call. build_file() is just a wrapper around the buildFile command. Change the final "hidewarning" parameter of the buildFile command to "internal" and have this call a new buildFileInternal() function without triggering any of the normal build events, silencing the normal info messages from the runqueue ("Executing RunQueue Tasks", "Tasks Summary" etc.) and avoiding calling parseConfiguration() which we've already done at this point. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-18fetch2: fix indentationPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18cooker: fix whitespacePaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18cache.py: fix whitespacePaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18cookerdata: fix indentation and trailing spacesPaul Eggleton
Fix one incorrect indentation and several lines with trailing spaces. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18knotty: fix indentationPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18bb/server/process: Handle EINTR on idle_commands selectAníbal Limón
If a signal is sent like SIGWINCH the select could be interrupted so ignore the InterruptError like in XMLRPC server [1]. [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/bb/server/xmlrpc.py#n307 Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07knotty: Drop task prefix of PLAIN log messagesRichard Purdie
To quote Paul: Not that long ago we added a prefix to logged messages to allow us to see where the message has been generated (recipe / task). This is undoubtedly useful for errors and warnings, however, I'm not sure it's really appropriate for bb.plain(). As an example, see the output for -c listtasks now: ... NOTE: Executing RunQueue Tasks nodejs-native-4.5.0-r0 do_listtasks: do_addto_recipe_sysroot nodejs-native-4.5.0-r0 do_listtasks: do_build Default task for a recipe - depends on all other normal tasks required to 'build' a recipe nodejs-native-4.5.0-r0 do_listtasks: do_checklicense nodejs-native-4.5.0-r0 do_listtasks: do_checklicenseall nodejs-native-4.5.0-r0 do_listtasks: do_checkpkg ... This patch excludes PLAIN messages from this prefixing making the log output neater. [YOCTO #11457] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07BBHandler: Remove old style bb.data.setVar() syntax usageEnrico Scholz
Fixes except bb.parse.SkipRecipe: > bb.data.setVar("__SKIPPED", True, d) if include == 0: AttributeError: module 'bb.data' has no attribute 'setVar' Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07server/xmlrpc: Add Heartbeat event supportRichard Purdie
When heartbeat event support was added it was only added to process.py. Add it to server/xmlrpc too. There is duplicated code however since we're likely to combine the server abstractions soon its not worth worrying about now. This ensures the backends have the same event support. [YOCTO #10741] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07event: Queue offline events for the UIRichard Purdie
Messages printed when no UI is connected (e.g. memres) are currently lost. Use the existing queue mechanism to queue these until a UI attaches, then replay them. This isn't ideal but better than the current situation of losing them entirely. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07server/process: Fix waitEvent() calls with 0 timeoutRichard Purdie
You might think Queue.Queue.get(True, 0) would return an event immediately if present and otherwise return. It doesn't, it immediately "times out" and returns with nothing from the queue. The behaviour we want is not to wait but return anything present which is what .get(False) does so map to this. This fixes some odd behaviour observed in some of the tinfoil selftests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07data: Micro performance optimisation tweakRichard Purdie
The datastore can assume internal API, this just removes the function indirection overhead involved in this very common codepath (800,000 calls in parsing OE-Core). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-07cooker: Use multiple BuildStarted events for multiconfigRichard Purdie
Currently builds in multiple TMPDIRs with multiconfig can break since the BuildStarted event is used to create directory strutures in several cases (e.g. buildstats.bbclass) and there is only on BuildStarted event generated in a multiconfig build. We have two options, a) to add a new MultiConfigBuildStarted event which is generated once per multiconfig, or b) allow multiple BuildStarted events. Having reviewed the code and current users of BuildStarted, sending one event per multiconfig seems like its the best way forward and the existing code looks able to cope with the duplication of events. I did also check toaster and I think that can handle this issue too (multiconfig builds may have other issues there). I'm therefore proposing we send multiple BuildStarted events for multiconfig and for consistency, send multiple BuildCompleted events too. We need to ensure that BUILDNAME, BUILDSTART and DATE/TIME are set consistently in all the different multiconfig datastores. These events can write to the datastore so copies are not used. buildFile was also cleaned up to ensure it uses the right datastore in various places. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-06bitbake: Add MultiConfigParsed eventRichard Purdie
There are some cases where the metadata needs to be aware a multiconfig build is happening and have access to the multiconfig data stores to merge data into the common build. This adds such an event allowing access to these datastores. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-04bitbake-user-manual: Removed and replaced broken linkKristi Rifenbark
Fixes [YOCTO #11675] THere was a "hambedded" link that was broken. The link was intended to give additional information on adding layers. Replaced with link about layers and replaced the wording. Signed-off-by: Kristi Rifenbark <kristi.rifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-04bitbake-user-manual: Replaced bad linkKristi Rifenbark
Fixes [YOCTO #11675] There was a "hambedded" link that was broken. The link was intended to show the bitbake.conf file. I replaced it with the link to show the actual bitbake.conf file. Signed-off-by: Kristi Rifenbark <kristi.rifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-29npm fetcher: fix unknown variable name.Ismo Puustinen
'mirrortarball' is supposed to be a local variable to the function. Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-28cache: don't insert PN into PACKAGESRoss Burton
The cache code currently inserts PN into the package list if it isn't already present. Whilst this ensures that the package list contains something which is important for native recipes that don't set PACKAGES, it causes confusing behaviour where a normal recipe doesn't have PN in PACKAGES: for example adding dhcp to IMAGE_INSTALL will parse successfully but fail at rootfs time as the dhcp recipe doesn't generate a dhcp package. Solve this by only adding PN to the cache's package list if the package list is empty. This results in the package list for recipes such as DHCP being correct, but native recipes continue to have just PN in the list as before. [ YOCTO #5533 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-27toaster: test 'commit' first in get_vcs_referenceDavid Reyna
The 'commit' value should be tested and used first when resolving the ref for a layer, since that is an explicit override in each layer index 'layeritem' record. If should take precedence over more-global 'branch' and 'release' values, instead of being last. [YOCTO #11515] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-27toaster: large package set breaks sqlite queryDavid Reyna
If you build a project with a large package set, you will get a crash in "views.py" when the dashboard attempts to fetch the package set to calculate the package count and size. This is a sqlite limitation, and it fails with as few as 1220 packages. [YOCTO #11717] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-27toaster: Add distro selection supportDavid Reyna
Add the ability to select a distro in the project page, based on values from the Layer Index. Add a distro selection page with the add layer feature, based on the add machine page. [YOCTO #10632] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-27toaster: git clone progress barDavid Reyna
If a project has a lot of additional layers, the build may appear to hang while those layers are checked out. This patch adds a clone progress bar that is visible before the parsing progress appears. [YOCTO #9916] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-27toaster: address Django-1.10 API deprecationsDavid Reyna
There are four main API deprecations in Django-1.10: (a) String view arguments to url() must be replaced by the explicit class reference (b) New TEMPLATES stucture in settings.py consolidates TEMPLATE_DIRS, TEMPLATE_CONTEXT_PROCESSORS, TEMPLATE_LOADERS, TEMPLATE_STRING_IF_INVALID, and TEMPLATE_DEBUG (c) patterns() wrapper in url() is removed, with urlpatterns now a simple list (d) NoArgsCommand in commands() must be replace by BaseCommand, and handle_noargs() changed to handle() Also, the Django version checker must be updated to accept two digit sub-version numbers (e.g. "1.8" < "1.10") [YOCTO #11684] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23bitbake-selftest: add bb.tests.event to bitbake-selftestJair Gonzalez
Tests for bitbake event module were created on bb.tests.event. This change is to include them on the default test list in bitbake-selftest script. [YOCTO #10368] Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23tests: create unit tests for event moduleJair Gonzalez
This change adds a new unit test module (bb.tests.event) for bitbake event. It includes the following items: - Client and server stubs setup - Testing the module's main functions including: - get_class_handlers - set_class_handlers - clean_class_handlers - enable_threadlock - disable_threadlock - get_handlers - set_handlers - execute_handler - fire_class_handlers - print_ui_queue - fire_ui_handlers - fire - fire_from_worker - register - remove - register_UIHhandler - unregister_UIHhandler - Testing event handling using: - class Event(object) - class OperationStarted(Event) - class OperationCompleted(Event) - class OperationProgress(Event) - class ConfigParsed(Event) [YOCTO #10368] Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23event: remove mapping for deleted event handlersJair Gonzalez
The current remove method for class event handlers does not update the event mapping after an event handler is deleted from the main dictionary. This change enhances the remove method by also updating the event mapping accordingly. This was detected after creating the bb.tests.event module. [YOCTO #10368] Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16fetch: fix handling of files with incorrect checksums from a premirrorJoshua Lock
Ensure that when an item fetched from a premirror has an invalid checksum the fetcher falls back to the usual logic of trying the upstream and any configured mirrors. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16event: drop some unused eventsPaul Eggleton
These were all used by support code for the Hob UI which has been removed - nothing will currently fire or respond to these events. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: noweb should init databaseDavid Reyna
When the 'noweb' option for Toaster is used, perform the database check/create if the Toaster database does not yet exist. This will allow Toaster to not fail if the first use is with 'noweb'. This avoids potentially clashing database updates if there are multiple overlaping 'noweb' sessions (for example with a CI system). If the user wished to update the database, they can either use the explicit "lsupdate" command or (re)start a web hosted Toaster session (which is gated by the webserver's PID). [YOCTO #11378] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: get_last_build_id not called correctlyDavid Reyna
The method "get_last_build_id" missing the "()" in several calls. This has been failing silently with Django 1.8 but intermittently crash with Django 1.9. [YOCTO #11570] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: add getMessage to MockEventDavid Reyna
The MockEvent needs to not only stand in for Toaster and Bitbake quick events, it also needs to stand in for LogRecord, and for that it needs to provide the new getMessage method. [YOCTO #11440] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: fail on layers with sub-layerDavid Reyna
For layers directories with sub-layers (for example meta-intel), Toaster breaks when trying to exact match a dependency event for that sub-layer against the top level layer directory paths. Given that top the level layer directory paths are unique, adding a test to see if the dependency path is a subset of a top level path is also unique. Also, since a warning was issued the processing should not fail on the assert but instead should continue and gather the recipes and tasks. [YOCTO #11149] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: add ID's to build menu linksDavid Reyna
Add IDs to the build page menu lines, for example "Tasks", "Recipes", "Time", "CPU Time", "Disk I/O", and so forth. This will support test automation. [YOCTO #11337] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-16toaster: add ID's to navigation linksDavid Reyna
Add IDs to the navigation bar links "All builds", "All projects", and "Documentation. This will support test automation. [YOCTO #11335] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-15bitbake-user-manual: Updated BBLAYERS_FETCH_DIR variable descriptionScott Rifenbark
Just discovered a minor issue in the bitbake manual - under the variable glossary entry for BBLAYERS_FETCH_DIR we say there's a default value of ${COREBASE} but that's not actually true in bitbake itself - there's no default in bitbake, that default is set in OE-Core. We can keep this in the YP ref manual but in the bitbake manual that sentence should be removed. Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14cooker: ensure graceful exit after exception during BuildCompleted handlerPaul Eggleton
If an event handler for bb.event.BuildCompleted fails, we still need to call finishAsyncCommand() or else BitBake will just exit immediately without showing any error summary, or worse in the case of memory resident mode BitBake will hang and if you Ctrl+C to break out, the command won't be marked as finished which means that no further commands will be able to be executed until the server is manually restarted. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14cooker: fix always loading cache on every UI start with memresPaul Eggleton
The main point of memory resident bitbake is to avoid loading data unnecessarily on every bitbake invocation. Unfortunately the code that updated options from the UI was simply treating the fact that either of the "prefile" or "postfile" options were in the list of options passed in as an indication that the configuration was invalid, which was bad because these are always passed in. We only need to mark the configuration as invalid and thus reload it (and thus reload the cache) if the option value has actually changed. At the same time, the recently handled "tracking" option needs to be treated in a similar manner since the configuration needs to be reparsed if that has changed. Also, add a few extra debug messages to aid debugging this code in future. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14bitbake: runqueue: multiconfig fixJuro Bystricky
Differentiate between fn and taskfn in "execute". This was somehow missed in "fakeroot" handling. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>