aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
AgeCommit message (Collapse)Author
2012-01-11bitbake: Automatically start local PR service.Lianhao Lu
[YOCTO #1126] A local PR service will be started and stopped automatically along with the bitbake invocation/ternimation. This local PR service will be started only and if only when the PRSERV_HOST is set to 'localhost' and PRSERV_PORT is set to '0'. When started, the sqlite3 database is stored at "${PERSISTEN_DIR}/prserv.sqlite3" or "${CACHE}/prserv.sqlite3". (Bitbake rev: 9d8f45407c67ed0d3c4f820cf646de3c385067c7) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06cooker: remove command import in cooker.pyDongxiao Xu
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>
2012-01-06cooker: remove command import in cooker.pyDongxiao Xu
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: 92fec2788e33d301cc63848901bc6adc764a2ecf) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06command.py: add initCooker APIDongxiao Xu
initCooker is to set the cooker to the initial state with nothing parsed. (Bitbake rev: 8ee9c6cc47938604268242d90bd3007218f9a36e) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06cooker: user bb.configuration.data to inject eventsDongxiao Xu
For buildTargets function, we use bb.configuration.data as parameter to inject events, since in hob environment, some variables are modified dynamically and bb.configuration.event_data may out of date. (Bitbake rev: 487a124942fd5cd9de71413b79a4049a6d26f1e8) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-05Remove the duplicated assignments of self.configuration.cmdRobert Yang
The assignments of self.configuration.cmd in BBCooker seems duplicated, have the followings in both BBCooker::__init__ and BBCooker::loadConfigurationData: if not self.configuration.cmd: self.configuration.cmd = self.configuration.data.getVar("BB_DEFAULT_TASK", True) or "build" The __init__ invokes the loadConfigurationData, and it would make sure that self.configuration.cmd has been assigned a proper value, so we can remove the one in __init__. [YOCTO #1791] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-01cooker.py: Allow the -e option to work with virtual classes and -bRichard Purdie
Using bitbake -e -b virtual:xxxx:/path/to/the.bb would result in zero matches since the virtual:xxxx piece wasn't being processed. This adds in the necessary functionality to handle it correctly. [YOCTO #1793] (Bitbake rev: bd5a727c8447bcb747c1d2463b7de2ab6d21a7de) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27bitbake: Update users of getVar/setVar to use the data store functions directlyRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10cooker.py: Ensure only one copy of bitbake executes at onceRichard Purdie
The bitbake codebase makes assumptions that only one copy is active against a given build directory at a given time. This patch adds a lockfile in TOPDIR to ensure that is the case. Note that no unlock is needed, that is automatically dropped when execution terminates. (Bitbake rev: 6004cbf36c980c2574c1c9153df81a7c55317e17) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-19cooker.py: Fix key expansion issues in showVersionsRichard Purdie
bitbake -s was not displaying correct version information when the PREFERRED_VERSION string contains other variables. The actual built versions would differ since the providers.py functions were called with expanded keys at this point. This patch expands keys for showVersions bringing everything into sync correctly. [YOCTO #1493] (Bitbake rev: 3a0f2dda3c6de993f08ed50e9d513add9407339c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15Ensure only the filtered environment variables are inherited from the OSJoshua Lock
The recent change which modified inheritFromOS to use the intial environment, rather than the current environment, introduced a bug such that variables which had been cleaned from the environment where still set in the data store. This patch changes things such that a list of approved environment variables is saved after the environment is cleaned and only the variables in this list are inherited in inheritFromOS. CC: James Limbouris <james.limbouris@gmail.com> CC: Chris Larson <clarson@kergoth.com> (Bitbake rev: cb6c07054e8baf94614713ec257c643b22266d75) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-12bb/command|cooker: refactor the reparseFiles logicJoshua Lock
Turn the reparseFiles logic into a command to reset the cooker's state machine and a noop which triggers a cache rebuild. The resetCooker command resets the cookers state machine such that a cache update will be triggered by any async command which requires the cache. The reparseFiles command remains as a noop async command that has the needcache property set to True so that when called it ensures the cache is built. Patch from Richard with the addition of removing the force parameter from the updateCache method. CC: Richard Purdie <richard.purdie@linuxfoundation.org> (Bitbake rev: a98f698fe9f38310024013e58475e6d1447ee154) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-11bitbake: Fix -e when used with -b optionRichard Purdie
When using the -e and -b options together an expection was occuring. This was due to incorrect initialisation and this patch adds in the correct initialisation calls. (Bitbake rev: e7ade6dcd646b478df79f968934a0edcb63254f7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-10bb/cooker: only emit ConfigFilePathFound for files which were parsedJoshua Lock
When the requested configuration file is found on disk check the against the configuration files in __depends/__base_depends to ensure the file was parsed before emitting the ConfigFilePathFound event. If the requested file wasn't parsed just return (and don't emit). Fixes [YOCTO #1246] (Bitbake rev: 705d14d1e1108e0544c7eab827f1242f0839add9) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-05bb/cooker: mark parsed conf files as potential cache invalidatorsJoshua Lock
The include parameter to _parse() tells the parser whether to include the file in __base_depends, the contents of which have their mtime tested to invalidate the cache when they have changed. As I understand it we would want all of the configuration files that are currently handled with the _parse() method to invalidate the cache to set the default value of the include parameter to True. (Bitbake rev: 5cacdc4f1641eda1b5707c96f7c40924a9db6174) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27bitbake: show more information for NoProvider errorsPaul Eggleton
"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>
2011-07-27cooker: populate rdepends-pkg in generatePkgDepTreeDataJoshua Lock
The rdepends-pkg field of the generated depend_tree model was not populated in the original implementation of this method, this series adds in the loop to populate the rdepends-pkg column of the model. (Bitbake rev: 4f9a6f6f43cf2ef38115285897fbbde01964e892) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26cooker: only append files onceJoshua Lock
A list can contain the same value twice, therefore only append to the appendlist for a recipe if the append file is not already in the list. (Bitbake rev: d11f9dd33cdcc97a4a937e8bf7e97558d813cadd) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26command|cooker: Add reparseFiles commandJoshua Lock
Add command reparseFiles to reparse bb files in a running cooker instance. Fixes [YOCTO #1249] (Bitbake rev: de035ad99feb7644f99ad54804bf9f98cc776877) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-26data|cooker: use saved environment variables when calling inheritFromOSJoshua Lock
Now that we have a pristine copy of the variables available at launch time we can use them when looking to inherit the OS's environment. (Bitbake rev: 21c21fcc5871e81d8d497b6baed605cdd74c4571) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25bitbake|cooker: save a copy of the environment when BitBake is startedJoshua Lock
Create a data store in the cooker containing the values of the environment from when BitBake is launched such that child processes can replicate (and/or use values from) the host environment, rather than the cleaned up environment that the main BitBake process uses. (Bitbake rev: 54c7206165c0e7cfe5f7b243c80461baf5e7dfb1) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-25bitbake/cooker: show a warning when -b is specifiedPaul Eggleton
Too many people are using -b because they think it is the normal way of specifying a target to be built, and then get confused when the build fails due to a missing dependency; so show a warning about dependencies not being handled when this option is used. (Bitbake rev: c470f3f36aef24c46d9722593422286340be296b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-21Remove unused target tree data for HobLiping Ke
Since Hob only needes package dependency information, we can create a new version of package information retrieving methods, remove task dependency information, so that we can greatly reduce data loading time for Hob (Bitbake rev: df55199209ef042e5b1ca04c4df75c7d639b51eb) Signed-off-by: Liping Ke <liping.ke@intel.com> Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-14cooker: only return *Found events if something was actually foundJoshua Lock
The cooker methods which fire FooBarFound style events should only fire the event when an item was actually found, rather than each time the method is called. Fixes [YOCTO #1219] (Bitbake rev: 5c8eeefc79455f058dda8f04cf4c12dc5418e00f) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-08bitbake cooker/ui: handle cmd line parsing result by individual UI.Lianhao Lu
Changed the return result of "getCmdLineAction" to a dictionary {'action', 'msg'} to allow the individual UI decide how to handle the cmd line parsing result. (Bitbake rev: 521909d1350a415d19516aa1710041e30950c7cc) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-07cache.py: Ensure additional .bbappend files are accounted forRichard Purdie
Currently if a user adds a new .bbappend file to the system, the cache still thinks the cached data is valid. This code fixes that to ensure additions and changed in append application order are accounted for. [YOCTO #1091] (Bitbake rev: 54fe91fe96aaae47c40077c5f441c79da71da777) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05bitbake/cooker, bitbake-layers: show the .bbappend files that matches no ↵Dexuan Cui
existing .bb recipe This patch moves the logic of show_appends_with_no_recipes from bitbake-layers into bitbake. By default, a fatal message is printed; we can also define a variable BB_DANGLINGAPPENDS_WARNONLY to make the message only a warning(the variables could be defined in conf/local.conf with a value "yes", "true" or "1"). (Bitbake rev: f5ba7c795df7cbd58124e35970ddc5bd84cbfb8e) Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05bitbake/cooker: implement layer dependencies, make priority optionalPaul Eggleton
Implement (optionally versioned) dependencies between layers, and if layer priorities are not specified using BBFILE_PRIORITY_layername (now optional) then work out the layer priority based on dependencies. Define LAYERDEPENDS_layername in layer.conf to specify the dependencies of a layer (list of layer names, split with spaces in the usual way); LAYERVERSION_layername can be defined for each layer allowing specific version dependencies to be specified via depname:version in the list of dependencies. An error will be produced if any dependency is missing or the version numbers do not match exactly (if specified). Note: default priority if unspecified for a layer with no dependencies is lowest defined priority + 1 (or 1 if no priorities are defined). Addresses [YOCTO #790]. (Bitbake rev: 115b89fa279b64e79da0f72caf7b30965a83fab1) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-05bitbake: track 'overlayed' recipesPaul Eggleton
Recipes that have been 'overlayed' (where there is a recipe in another layer where that layer has a higher priority) are now listed within cooker.overlayedlist for use in bitbake-layers. This is a dict with keys of the topmost (highest priority) recipe file. (Bitbake rev: 370fc603d79f9c34cc23b4b520b685256c23df5d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01bitbake: add -R option for loading configuration files after bitbake.confJoshua Lock
Useful if you want to load a configuration file that sets values which may also be set in bitbake.conf or one of the files it includes. (Bitbake rev: a8246ae5400c23df0d3ee29c36f4d9f257d1e6d1) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01cooker: switch to new universe target rather than worldJoshua Lock
When the caller doesn't specify a pkgs list we want to generate the tree of all available packages. To do so use the new universe target list. (Bitbake rev: 26b0c538ad4f677e0d45a66484c2dca073459282) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01cooker: remove code duplication in non trivial functionsJoshua Lock
The generateTargetsTreeData() and generateDepTreeData() functions perform are essentially the same function only creating slightly different data structures. Instead of duplicating non-trivial code drop generateTargetsTreeData and instead have an optional boolean argument which defaults to False for generateDepTreeData() which has it include the extra fields required for the targets tree. (Bitbake rev: 3e38ea4e5748473740821b6e10c8477c08ab45e2) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01cooker|command|event: add new command findFilesMatchingInDirJoshua Lock
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>
2011-07-01command|cooker|event: add findConfigFilePath commandJoshua Lock
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>
2011-07-01cooker: add generic method to locate configuration filesJoshua Lock
Convert _findLayerConf(self) to _findConfigFile(self, configfile) so that the core functionality of the method can be used elsewhere. (Bitbake rev: c515b76c3a27d57d5ae8dddf15cc836811b24ee1) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-01command|cooker: allow generating targets tree for specified pkgsJoshua Lock
Modify the generateTargetsTree command to allow a list of packages to be supplied by the caller, in this case we will only generate a target tree for user requested targets rather than building a tree for the world list. (Bitbake rev: d4e4f2ecae96e074b2ab3bb9882037af2e385fdd) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-15make exception handling syntax consistentScott Garman
Update exception handling syntax to use the modern style: except ExcType as localvar (Bitbake rev: dbf5f42b06bef81749b13aa99945cc1292a6676d) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-13bitbake/cooker: Fix -b option by ensuring the empty cache structure is presentRichard Purdie
(Bitbake rev: 1430a36e81737bd92245042710eb9d6ad8b6f1a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09track skipped packagesPaul Eggleton
Add skiplist to cooker that allows access to the list of packages skipped via SkipPackage (this includes COMPATIBLE_MACHINE, INCOMPATIBLE_LICENSE, etc.) This can be used to enhance error reporting. (From Poky rev: 6c12b7b1099c77b87d4431d55e949cf7c5f52ded) (Bitbake rev: 7d2363f35350be27a33f568c23eb07fcd3d27e53) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-09Drop psyco supportRichard Purdie
At best it gave 1-2% improvement now, its 32 bit x86 only and isn't supported after python 2.6. PyPy is probably a better option now. (Bitbake rev: 3c3bd0c2fa80d747f25401c17b785c7c2f3787ca) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08bitbake/cooker.py: Misc sync with upstreamRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: use BBHandler.inherit for INHERITChris Larson
Ideally we'd avoid direct BBHandler usage, but honestly, to say the whole bb.parse abstraction is incredibly leaky is an understatement. If we try to make handle() not reparse classes, things get ugly fairly quickly, as inherit() calls handle() itself after adding the class to the inherit cache. This change fixes it so we no longer risk reparsing a class if: - it's listed in INHERIT multiple times - it's listed in INHERIT and is 'inherit'ed from a class in INHERIT (Bitbake rev: 057c3cddeb72584c6c3908bd702288cece9b66ea) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: simplify self.configuration.data vs data usageChris Larson
(Bitbake rev: 87112adee4e8add0a97ff8be8311d9afe202412d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: don't choke if we have nothing to parseChris Larson
If all our recipes were cached, there's no reason to fire off any parsing progress events at all. (Bitbake rev: e9e174e5781fc3de4dfd60d01228048a06a62b16) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: handle ExpansionError the same way we do ParseErrorChris Larson
(Bitbake rev: 12aef37618bc77fb5ef085d24ad85471fb85c111) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08Shift 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. (Bitbake rev: ee48d628ee038bd72e1cd94aa75f5ccbacbcee4c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: don't show a traceback for ParseErrorChris Larson
(Bitbake rev: cae6bf031dc83ba0439d07584fdbbd4a962408a3) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: don't show a useless traceback for SyntaxErrorChris Larson
Note: we rely on the fact that better_compile has already output information about the exception, so don't do it ourselves. (Bitbake rev: caf21e9fbf3c526c1d7c555d8c76dca8710f9def) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: use logger.exception for config file parse errorsChris Larson
(Bitbake rev: 775590c154bc189df3f5704bddf9b684b734fde0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08cooker: pass traceback back from parsing threadChris Larson
Uses bb.exceptions to get a traceback back from the parsing thread to the main thread, where it is then formatted. Also enables 3 lines of context for the formatted traceback, and limits the number of entries displayed to 5. (Bitbake rev: 8c33f50eb68411c071c001331e0134aeb776953b) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>