summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
AgeCommit message (Collapse)Author
2016-01-17cooker: Ensure bbappend files are processed in a determistic order1.22Richard Purdie
self.appendlist is a dict and as such unordered. This can lead to cases where appends with different names (e.g. x_%.bbappend vs. x_123.bbappend) can be reordered in application which in turn reorders the variables that those bbappend files might touch. Reorderd variables changes the sstate cache signatures causing real world issues. To avoid this, use a list for the append files instead. This patch is conservative and just adds a new data structure alongside the existing one and uses it to resolve the core issue. Later patches (post release) can handle some of the wider but less problematic ones (e.g. issues in bitbake-layers flatten). [YOCTO #7511] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-04cooker: Overwrite IMAGE_BASENAME to default in custom imageMarius Avram
This solves a problem of custom images which inherit a base image with IMAGE_BASENAME overwritten in their recipe by a different value than its default one: ${PN}. The value of IMAGE_BASE causes a crash when hob will try to create symbolic links to the resulting images from the deploy directory, because it will look for names similar to <original_recipe_name>-edited-timestamp-machine.rootfs.* which might be different from the actual resulting image. The solution is to simply overwrite IMAGE_BASENAME in the custom recipe to the default value in the case IMAGE_BASENAME is found in the base recipe. Some recipes which were affected by this problem are those from meta-fsl-demos (e.g.: fsl-image-test). [YOCTO #6017] Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-01bitbake: cooker: mark setFeatures command as read-onlyAlexandru DAMIAN
This patch makes sure that the setFeatures command is marked as read-only and that it can only run if the cooker is in the initial state. Additionally, remove logging from the XMLRPC module in favor of sending the exception to the client for easy processing. [YOCTO #6089] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-28bin/bitbake/cooker: Ensure initial featureset is optimalRichard Purdie
If the featureset didn't match the defaults, we'd pay the price of two base configuration parses which showed up adversely in the performance benchmarks. This also passes the feature set into the cooker creation so in the common case we don't have to reset the server. This speeds up both knotty and hob startup. If the featureset doesn't match, the system will reset as before, this just streamlines the common case. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-28cooker: Only change self.data if it existsRichard Purdie
With the change to more optimal default featureset behaviour, a race was exposed by hob where the code may try and change self.data before it exists. This change avoids that. When the datastore is created, the cooker configuration is used so data tracking is correctly handled regardless. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-26cooker/event: Overhaul sanity test mechanismRichard Purdie
Sanity tests are currently a pain as its hard to control when they run. This results in issues where for example the bitbake -e output is not useful as the sanity tests prevent it from executing. The sanity tests should run later than the base configuration. This patch changes the sanity tests to always be event triggered with the option of returning either events on the status, or raising errors. A new cooker feature is used to change the behaviour depending on the controlling UI. This does need a change to sanity.bbclass in the OE metadata but its worth the pain for the increased flexibility and control this offers UIs and the improvement to the user experience. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25cooker: delVar in removeConfigurationVarMarius Avram
When a variable was removed from a configuration file it was not removed from memory. This also had the effect of not allowing to set a new value for the same variable with saveConfigurationVar. Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-14bitbake: cooker: some IMAGE_FEATURES not recognizedMarius Avram
Fixes an issue in hob which happened when the local.conf file was modified externally by appending "eclipse-debug" to the IMAGE_FEATURES variable. The reason of the problem is that some IMAGE_FEATURES are not available in the image.bbclass file and they are declared in the core-image.bbclass. Now a default hob image will inherit core-image. [YOCTO #5711] Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-09cooker: Handle SIGTERM more gracefullyRichard Purdie
If the cooker receives a SIGTERM it currently hangs using 100% CPU, This patch adds in an intercept for the event and puts the cooker into shutdown mode allowing it to exit cleanly/safely and avoiding the hang. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-09cooker/command: Add setFeatures commandRichard Purdie
Add a command to allow backends to set particular 'features' on the cooker (server). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-27bitbake: hob: check if parser has attribute 'shutdown'Irina Patru
It must be checked first if parser has the attribute 'shutdown' when user hits Stop button and the forceshutdown state is given. [HOB #5579] Signed-off-by: Irina Patru <irina.patru@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-27cooker: Add option of specifying indvidual tasks for targetsRichard Purdie
Currently its near enough impossible to tell bitbake to run target X, task Y and target A, task B. We could hack various parts of the API around but it would mean incompatibilities. An alternative is to accept the syntax "<target>:do_<task>" as a target name. The default task would be used where the task is unspecified. This has the advantage that its neat/clean code and works from all current APIs including the commandline. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-03bitbake/lib/bb/cooker.py: remove a duplicated self.dataRobert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03cooker/command/hob: Cleanup configuration init/reset functions and commandsRichard Purdie
initConfigurationData and loadConfigurationData are similar functions, the only reason for them appears to be to be able to reset the pre/post configuration files. The current code is confusing and unmaintainable. Instead this patch creates a new Sync command which allows these to be explicitly set. The init and load functions can then be merged into one. There is then no need for a parseConfiguration command, we can simply reset the server to have the settings take effect. The reset fuction is not an instant value return and triggers an event so it should be an Async command, not a sync one. The number of calls for the set pre/post command is probably higher than it need be but someone with more familiarity with the hob code base can probably figure out the right places its needed (maybe just init_cooker?). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-02bitbake.lock: Add host:port to bitbake.lock for memres serverJason Wessel
The idea is to build on the --status-only option for bitbake and expose a mechanism where the oe init scripts can easily switch between memres server and the non-memres server. In the case of the standard oe init script the following can shut down the server: if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only if [ $? = 0 ] ; then echo "Shutting down bitbake memory resident server with bitbake -m" BBSERVER=`cat bitbake.lock` bitbake -m fi fi A similar function can be used to automatically detect if the server is already running for the oe memres init script. This new functionality allows for the memres init script to be started in a new shell and connect up to an alaready running server without seeing the error of trying to start the server multiple times. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-29cooker: Fix support for wildcards in bbappend filenamesNathan Rossi
The 'bbappend in f' incorrectly compares the current recipe with the avaliable bbappends recipes. This comparsion causes unrequested bbappend files to be appended, e.g. in the case of 'libgcc_4.8.bb', the bbappends for 'libgcc_4.8.bb' and 'gcc_4.8.bb' are added to the filelist (because 'gcc_4.8.bb' is contained in the 'libgcc_4.8.bb' string) which in turn causes the gcc_4.8.bbappend files to be appended to the libgcc_4.8 recipe. This should be a 'bbappend == f' to match the previous implementation of this function, such that if no wildcard is present the recipe names must match exactly. This issue was introduced by commit 31bc9af9cd56e7b318924869970e850993fafc5f, which it related to [YOCTO #5411]. Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-22cooker: add support for using % as a wildcard in bbappend filenameSaul Wold
There has been a continuing call for supporting wildcard in bbappend filenames. The wildcard is actually allow matching of the name and version up to the point of encountering the %. This approach will allow for matching of the major or major.minor. Exampes: busybox_1.21.1.bb busybox_1.21.%.bbappend will match busybox_1.2%.bbappend will also match if we update to busybox_1.3.0.bb the above won't match, but a busybox_1.%.bb will. [YOCTO #5411] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-20bitbake: cooker, toaster: mark interrupted builds as failedAlexandru DAMIAN
This patch changes bitbake to log an error to the command line when the build is interrupted via Ctrl-C. This is needed to inform the user that not all tasks required for the build have been executed, and the build is not complete. Internally, the Bitbake server will return a CommandFailed event that will be logged by Toaster as build failure. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-15cooker, toaster: variable definition trackingAlexandru DAMIAN
In order to track the file where a configuration variable was defined, this patch bring these changes: * a new feature is defined in CookerFeatures, named BASEDATASTORE_TRACKING. When a UI requests BASEDATASTORE_TRACKING, the base variable definition are tracked when configuration is parsed. * getAllKeysWithFlags now includes variable history in the data dump * toaster_ui.py will record the operation, file path and line number where the variable was changes * toaster Simple UI will display the file path and line number for Configuration page There is a change in the models to accomodate the recording of variable change history. [YOCTO #5227] Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-15cooker: warn if user specifies a target listed in ASSUME_PROVIDEDPaul Eggleton
If the user explicitly asks to build a target that is listed in the value of ASSUME_PROVIDED, show a warning mentioning that it will be ignored. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-12cooker: replace "w" file opening mode with "a" modeCristiana Voicu
Also removed some redundant file manipulation code Based on patch sent by Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-01cooker: do not recreate recipecache in buildfile modeAlexandru DAMIAN
When building a single file, the cooker will recreate the recipecache from scratch. I suspect this is a remnant of past code, since: * the current recipecache works fine * the new recipecache will not have all the fields as requested by HOB_EXTRA_CACHES setting This patch disables recreating the recipecache, leading to shorter times when building single build files (-b option) and better compatibility with Toaster. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-01cooker: add data to the dependency tree dumpAlexandru DAMIAN
Toaster needes to record extra data that needs to be moved at the time of the dependency tree dump. This data includes: * layer priorities for recording in the layer section * the inherit list for each PN which allows to determine the type of the PN (regular package, image, etc). This patch adds this data to the dependency tree dump. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14cooker/command: Add error state for the server and use for pre_serve errorsRichard Purdie
Currently if errors occur when starting the PR service, there is a race that occurs since the UI runs various commands including starting builds before processing the CookerExit(). By adding the error state and refusing to run async commands in this mode, builds are prevented from starting and the UI reaches the exit code with the system shutting down cleanly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-07bitbake: replace comment added in conf filesCristiana Voicu
The patch that implements removeConfigurationVar method was made before merging the patch that replaces "added by bitbake" with "added by hob". This patch corrects this issue. [YOCTO #5284] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04bitbake/hob: removing extra parameters from conf files using hobCristiana Voicu
In Hob settings, there is a tab to add/remove extra settings. This patch implements a way to "remove" variables from conf files, through bitbake. But, to keep the history assigment of the variables synchronized, instead of removing, it replaces the lines with blank lines. [YOCTO #5284] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04HOB: MACHINE should be saved in conf files using ?=Valentin Popa
MACHINE var is saved using early assignment operator. Calling MACHINE=x bitbake core-image-... works properly. Comment "#added by bitbake" is replaced with "#added by hob". [YOCTO #5070] Signed-off-by: Valentin Popa <valentin.popa@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>