summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
AgeCommit message (Collapse)Author
2013-09-18bitbake: cooker, command: add a command to return global dataAlexandru DAMIAN
Adding the 'getAllKeysWithFlags' read-only command that will return a dump of the global data state, together with specified flags for each key. The flag list is passed in as the first parameter to the command. This will be used by UI clients to get the build configuration. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-18bitbake: cooker: get extra information from recipe cacheAlexandru DAMIAN
The loaded cache modules may add extra attributes to the recipecache, that will be populated by the cache classes required by the UI. These attributes will be used by the UI to display relevant information. Adds cachefields cache class field to specify for each cache class which attributes will be set in the recipecache. Adds code to automatically expand depends tree with the fields exported by the extra cache class. Fixes a cache field name in the HOB UI. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-18bitbake: cooker,runqueue: send the task dependency treeAlexandru DAMIAN
Adding a CookerFeature that allows UIs to enable receving a dependency tree once the task data has been computed and the runQueue is ready to start. This will allow the clients to display dependency data in an efficient manner, and not recompute the runqueue specifically to get the dependency data. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-18bitbake: cooker,xmlrpc,servers: implement CookerFeaturesAlexandru DAMIAN
Implementing feature set selection that allows a client to enable specific features in the server at connection time. Only enabling of features is supported, as there is no way to safely remove data loaded into the cooker. Once enabled, a feature will remain enabled for the life of the cooker. Client-server connection now supports specifying the feature set required by the client. This is implemented in the Process server using a managed proxy list, so the server cooker will now load dynamically needed features based on what client connects to it. In the XMLRPC server the feature set is requested by using a parameter for registerUIHandler function. This allows observer-only clients to also specify features for the server. The server code configuration now is completly separated from the client code. All hardcoding of client knowledge is removed from the server. The extra_caches is removed as the client can now specify the caches it needs using the feature. The UI modules now need to specify the desired featureSet. HOB is modified to conform to the featureSet specification. The only feature available is CookerFeatures.HOB_EXTRA_CACHES which forces loading the bb.cache_extra:HobRecipeInfo class. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-18cooker: return a copy checkPackagesRichard Purdie
The syntax used for checkPackages implies a copy is returned but it did not do so. Make it so. This is fixes universe builds where error messaages were being shown but there should have only been warnings. [YOCTO #5222] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17cooker: Allow profiling of the parser in profile modeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17cooker: Avoid duplication for taskdata creationAlexandru DAMIAN
Clean-up to avoid duplication and promote code reuse to factor taskdata creation into a common function. [RP: minor tweaks] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13cooker: updateCache should rause exceptions, not sys.exitRichard Purdie
Exiting from the server is antisocial, instead we should raise an exception. This will correctly fail the current command and reset the server state. We use the handled exception since for these conditions to occur, something was already displayed to the user. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13cooker/command: Add finishcommand to reset cooker stateRichard Purdie
After running a command on the server, it needs to reset to the initial state. This ensures that subsequent clients start from a known state and notice any configuration changes. Ultimately we may want to do more than this buts a good start and better than nothing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13cooker: Rename confusing 'stop' state to 'forceshutdown'Richard Purdie
The shutdown state causes the server to finish what its doing, stop was them meant to completely stop it. It doesn't mean the server is stopped though. Renaming the current stop event for forceshutdown gives more meaning to what it actually does. The stopped namespace then becomes available to indicate a completely stopped server. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13cooker: Clean up init/reset configuration codeRichard Purdie
Currently the cooker event data isn't rebuilt upon reset and the cache configuration cannot be changed after init. These are both bad things and this patch refactors the init/reset code so that it is possible to reconfigure the server. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13cooker: Drop obsolete worker testRichard Purdie
This call only ever happens in cooker context now so we can drop the nasty worker check from here. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-02bitbake/cooker: fix some calls of cookerdata.findConfigFile methodCristiana Voicu
Cookerdata.findconfigFile method has a new parameter. Changed some calls. Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26command.py: Call updateCache for all states != runningRichard Purdie
updateCache handles the logic for shutting down the parsing so we need to call it for all cases when we're not running. This fixes hangs if Ctrl+C is pressed during parsing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06cooker: save packages in IMAGE_INSTALL instead of PACKAGE_INSTALLCristiana Voicu
Hob retrieves the list of recipes and packages using the IMAGE_INSTALL variable, so a custom image should be saved using this variable. Changed how the image is saved in a bb file [YOCTO #4193] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06hob/bitbake: when an image is saved, it should require an image from layersCristiana Voicu
Saving an image that requires another image will cause issues when the second on is removed. So, we have agreed to "require" only the images from layers. The functionality is implemented in bitbake, in order to be more abstract, and it is used by Hob when an image recipe is saved. [YOCTO #4193] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06hob & bitbake: append a value to a variable from hob throught bitbakeCristiana Voicu
It was necessary to append ${TOPDIR}/recipes/images to BBFILES. Implemented the mechanism to append a value to a variable: a command and the method in cooker. [YOCTO #4193] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06hob/bitbake: save the description of a custom imageCristiana Voicu
When an new image is saved, the dialog for this action has a field for the description. Changed how an image is saved, by appending the DESCRIPTION variable at the end of the .bb file. [YOCTO #4193] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-06hob/bitbake: create a template (a .bb file) from hob through bitbakeCristiana Voicu
Modified generateNewImage function from cooker, in order to be used to save a template in Hob. Created a command to ensure that some dirs are created. The templates (recipes) will be saved in {TOPDIR}/recipes/images folder. Called these methods from Hob. [YOCTO #4193] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-27bitbake: adding a new comment should be placed on a new lineCristiana Voicu
In this case, the comment is appended to the end of the file. Some text editors, do not place a '\n' to the end of the file after saving it. [YOCTO #4636] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20bitbake: call the initConfiguration when reparsingCristiana Voicu
As it is implemented now, when parsing the configuration files is needed, it also needs an initialization. Also, implemented a function to create an extra configuration files which can be used as postfile/prefiles when parsing. Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20cooker: Ensure configuration matches variable tracking stateRichard Purdie
When we reset, the current tracking value may change unexpectedly. This patch ensures that the default value is preserved over a datastore reset. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-20bitbake: remove the function for reparse because it does nothingCristiana Voicu
The command for reparse does nothing, so I have managed to remove it, because it can be misleading. When a reparse is needed, it can be used the parse function. Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-12prserv: Adapt autostart to bitbake-workerRichard Purdie
With the change to bitbake-worker we need to ensure the workers know how to contact the PR service, the magic 0 port and singleton is no longer enough. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07cooker: Split data from configurationRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-30bitbake: move extra cache collection out of cookerAlexandru DAMIAN
The collection of the extra caching data should not be performed by the cooker, but supplied to it. This patch will also streamline the code for launching servers without a UI attached. Based on a patch by Bogdan Marinescu <bogdan.a.marinescu@intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24cooker/cookerdata: Fix up event handling for hobRichard Purdie
The init function call was clobbering data hob relies on injecting, fix this so the data injected by hob isn't overwritten. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-24cooker/cookerdata: Improve configuration object handlingRichard Purdie
Originally it seemed like a good idea to keep the parameters around. Having seen this in real life use, its incorrect, we should pull all the data we need into the cooker's configuguration and then use this to build the datastore. Being able to just build the datastore from the parameters seemed like a good idea but having a dummy cooker configuration object is now looking like the better option. This also fixes failures in hob since the parseFiles command can call into cooker directly now and reset the configuration prefiles and postfiles at will, rather than the indirect calls before which were breaking the datastore (e.g. BBPATH wasn't set). The cleanup this allows in tinfoil illustrates how this change makes more sense. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-23cooker/cookerdata/event: Improve class handlers managementRichard Purdie
Similarly to the execution context changes, establish better lifetime management API of the class event handlers. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-23cooker/cookerdata/utils: Improve context managementRichard Purdie
The current execution context management for bitbake is ugly and the use of a global variable is nasty. Fixing that is hard, however we can improve things to start to establish an API for accessing and changing that context. This patch also adds in an explicit reset of the context when we reparse the configuration data which starts to improve the lifecycle of the data in setups like hob. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-23cooker.py: Remove global scope class event handlersRichard Purdie
Its confusing when an event handler in for example a bbclass receives events for a recipe which doesn't use the class. This is due to the class event handlers having confusing scope. Worse, the issue is not deterministic and the events a handler will see depends on the parse order. To avoid these issues, remove the class event handler global scope and only have class handlers recieve events for recipes using the class. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-23methodpool: Retire it, remove global method scopeRichard Purdie
Having a global method scope confuses users and with the introduction of parallel parsing, its not even possible to correctly detect conflicting functions. Rather than try and fix that, its simpler to retire the global method scope and restrict functions to those locations they're defined within. This is more what users actually expect too. If we remove the global function scope, the need for methodpool is reduced to the point we may as well retire it. There is some small loss of caching of parsed functions but timing measurements so the impact to be neglibile in the overall parsing time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-21cooker: Split configuration parsing code into cookerdataRichard Purdie
In order to have a memory resident bitbake and to allow task execution, we need to be able to rebuild the base configuration without a cooker. This moves the code into its own class so it can be built independently. The interface is less than ideal here but I didn't want to add parsing methods a subclassed DataSmart, at least until we've experimented further with this code and are certain that makes sense. At the very least, the methods are ugly and need cleaning up. Spliting the code out seems to be the right thing to do though and should unblock various activities on BitBake so I believe this code is a step in the right direction. Based on a patch from Alexandru Damian <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-21cooker: Move commandline parsing back into the UI/cookerdataRichard Purdie
Building up a set of actions for the server is tricky since we depend upon the commandline but fall back to values from the datastore. We should be able to build a datastore without a commandline and vice versa. Ultimately the UI should send the commands to the server. This patch amounts to code rearranging, moving the heavy lifting to the UI, though a helper in the configuration option. This will need further cleanup/tweaking but this should be the only update needed to the UIs. The code now queries the server for any missing data should it need to. This code allows various knowledge of configuration variables to move to the UI side only, partcularly pkgs_to_build but also all the command specifiers. It should also be possible to move cmd eventually, I'm just unsure if any callers call the commands expecting this to default to something sane right now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-21bitbake: Create cookerdata splitting config from cooker and bin/bitbakeRichard Purdie
Currently the UI and server configuration is one big incestuous mess. To start to untangle this we creater cookerdata, a new module which contains various confiuration modules and the code for building the base datastore. To start with we add a ConfigParameters() class which contains information about both the commandline configuration and the original environment. The CookerConfiguration class is created to contain the cooker.configuration options. This means we can transfer new paramters to the server over something like XMLRPC and then build a new configuration from these on the server. Based on a patch from Alexandru Damian <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-13cooker/bitbake-layers/tinfoil: Fix recipecache typoRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Rename status variable to recipecacheRichard Purdie
"status" is a relic of very early versions of bitbake, rename it to match what it now means. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Rename confusing buildDepgraph task to handlePrefProvidersRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Drop pointless variablesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker.py: Drop confusing updateCache callsRichard Purdie
updateCache() gets called by command.py when needed and needs to be iterated over. The calls in cooker.py are therefore just plain wrong/confusing now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Remove pointless repeated importRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Fix get_bbfiles()Richard Purdie
Its clear looking at the code the path argument has never been used and doesn't work. Tweak the function to be a little more readable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Separate out collections handling code into its own classRichard Purdie
The Cooker class is too large and needs to be split up into different functional units. Splitting out the collections code into its own class seems like a good place to start to try and disentangle things. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-12cooker: Drop unused variables from collect_bbfiles()Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09cooker: Remove deprecated operatorRichard Purdie
The <> operator is deprecated, replace with !=. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03prserv/cooker: Handle PRService errors cleanlyRichard Purdie
Current if the PR Service fails to start, bitbake carries on regardless or hangs with no error message. This adds an exception and then handles it correctly so the UIs correctly handle the error and exit cleanly. [YOCTO #4010] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-28cooker.py : added variables related to cache_extraAndrei Dinu
So that the information added to cache_extra could be accesed by hob, new variables were added in the cooker.py. Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-19cooker: Use extra cache informationAndrei Dinu
-extended cooker.py so that the extra information in cache_extra.py could be used Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-06Revert "cooker: parse using bb.compat.Pool"Richard Purdie
Reverting the pool changes, terminate does not work reliably on bb.compat.Pool :( [YOCTO #3978] This reverts commit 8af519a49a3374bd9004864ef31ca8aa328e9f34.
2013-03-06Revert "cooker: now that we use a Pool, raise the exceptions"Richard Purdie
Reverting the pool changes, terminate does not work reliably on bb.compat.Pool :( This reverts commit 9ca8e513dc142dd7aefadeb6db2ccdb00f38b39f.