summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-09-17bb.fatal: Raise a BBHandledException instead of exitingRichard Purdie
With new bitbake UIs having the cooker exit at 'random' points in the codebase is problematic. This patch raises an exception which matches the siutation instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Optimise flag exclusion list handlingRichard Purdie
Move the variable lookup to the outer loop for performance, replacing a now unneeded parameter (after the previous changes). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Optimise flag lookup in build_dependenciesRichard Purdie
When looking up flag variable dependencies, large chunks of the function aren't needed. Optimise the function flow accordingly for speed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Optimise build_dependencies a littleRichard Purdie
Instead of multiple calls to getVarFlag, make one call to getVarFlags, only expanding the flags that need to be expanded. This improves performance. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: Cache the fact a variable accesses another even if its unsetRichard Purdie
If a variable references another but it isn't set at present, the reference wasn't stored. It really should be marked as a reference and the higher level dependency code can handle as appropriate. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: Allow flags to use the expand cacheRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: Allow expansion of flags in getVarFlagsRichard Purdie
Allow a list of flags to expand to be passed into getVarFlags. This is useful within bitbake itself to optimise performance of the dependency generation code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: Add explict None checksAlexandru DAMIAN
Simple if xxx checks end up calling len(xxx). We're interested in the specific case of None which means we can break out the iterator much earlier after the first item. This adds in the specific tests for None in what is a hot path in the data store code which gives small performance gains. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Cache an list of export variablesRichard Purdie
Compute a cache of the list of potential export variables so that we don't have to compute the list from scratch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Use direct iteration, not keys()Richard Purdie
Profiling shows the creation of keys() has overhead and we're better using an iterator rather than the memory associated with the huge list of keys when iterating the whoe datastore. We minimise the number of times we do this to twice only per recipe. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: use the expand_cache in VariableParseRichard Purdie
When in VariableParse, use the expand_cache if possible rather than looking up data. Ultimately it would come from the same place but this short cuts a heavily used code block for speed improvements. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data_smart: Improve variable expansion regexpRichard Purdie
Debugging showed the variable expansion regexp was catching python expressions (starting with @). Since these are caught by their own dedicated regexp, stop matching these for the plain variable expansion for small performance improvements. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17siggen: Use lookup cache exclusivelyRichard Purdie
All the values we need are already guaranteed to be in the lookupcache so rather than fetch variables again, just use the cache. This gives a small performance improvement and simplifies the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-17data: Be explicit in data_db checkRichard Purdie
The if statement current causes the size of parent to be calcuated which is like a len() operation on a datastore. Since we're only interested whether the value is none, checking explictly for this gives a small performance gain. 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-16runqueue: add runQueueTaskSkipped eventAlexandru DAMIAN
Adding a runQueueTaskSkipped to notify that the tasks that are not run either because they are set-scened or they don't need an update (timestamp was ok). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-16build: Add logfile to add TaskBase eventsRichard Purdie
We add the path to the logfile for all Task events except TaskInvalid so that we can trace back the logfile locations at some future point. TaskInvalid doesn't ever have a logfile. 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-13knotty: Cleanup error/interruption handlingRichard Purdie
Only display a CommandFailed ERROR: message if there is an error to display. Only display an errors summary if we actually displayed errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-13command: Treat empty messages as failures, not CommandCompletedRichard Purdie
Empty messages should trigger CommandFailed, not CommandCompleted as otherwise the exit code will be incorrect. 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-13bitbake: xmlrpc: delete unused code BitBakeUIEventServerAlexandru DAMIAN
BitBakeUIEventServer is an unused class that pushes UI events over a separate thread. The current version of XMLRPC server works just fine with the classic UI event handlers, so this class is not needed. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-12data_smart: Account for changes in append/prepend/remove in the config hashRichard Purdie
bitbake wasn't reparsing when _remove items were added to its configuration and equally, appends/prepends were also being badly tracked. This change enrures these variables are accounted for in the configuration hash. [YOCTO #5172] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-11utils: Fix BB_PRESERVE_ENVRichard Purdie
BB_PRESERVE_ENV wasn't working since data.inheritFromOS wasn't getting a correct list of keys to import into the data store. This fixes things so it does add all environment variables into the data store when BB_PRESERVE_ENV is used. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-10bitbake: runqueue: add sceneQueueTaskCompleted eventAlexandru DAMIAN
Adding an event to be fired when a scene task is completed. It is analogous to the run task completed event, and has been missing for some reason. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-09runqueue.py: check whether multiple versions of the same PN are due to be builtRobert Yang
There would be an race issue if we: $ bitbake make-3.81 make-3.82 This because they are being built at the same time which would cause unexpected problems, for example: [snip] ERROR: Package already staged (/path/to/tmp/sstate-control/manifest-qemux86-make.populate-sysroot)?! ERROR: Function failed: sstate_task_postfunc [snip] Or there would be python's strack trace such as: [snip] *** 0004: mfile = open(manifest) 0005: entries = mfile.readlines() 0006: mfile.close() 0007: 0008: for entry in entries: Exception: IOError: [Errno 2] No such file or directory: xxx [snip] [YOCTO #5094] We can quit earlier to avoid this kind of issue when two versions of the same PN are going to be built since this isn't supported. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-09providers.py: enhance the runtime debug degbug messgaeRobert Yang
The runtime provider debug message is the same as the build time debug message, make them different would be better. [YOCTO #5067] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-08prserv: Ensure data is committedRichard Purdie
In exclusive mode, we need to complete the transaction for writes to make it to the database. Therefore add sync calls to ensure this happens. Autocommit mode is significantly (100 times) slower so caching the data is of significant benefit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06contrib/vim: merge changes from vim-bitbake repoChristopher Larson
commit 00ca441614695b4261d8d4f31b7ef0e3e3784282 Merge: 8cc367d bb88c0f Author: Christopher Larson <kergoth@gmail.com> Date: Thu Aug 22 16:42:42 2013 -0700 Merge pull request #6 from staticshock/multi-line-strings Remove "keepend" and "excludenl" directives commit bb88c0fd4ad2b7b9c8c4c73def2b3cb20c473ac3 Author: Anton Backer <olegov@gmail.com> Date: Sat Jul 13 01:24:15 2013 -0400 Remove "keepend" and "excludenl" directives It looks like these were never actually used correctly, and were doing more harm than good. "keepend" on bbString, for instance, prevented proper nesting of ${@python} in strings. Similarly, a balanced pair of { } braces inside a shell function would force the function to terminate early if the closing brace was on its own line. So far I've seen absolutely no negative consequences from removing these, but a bunch of positive consequences. Fixes #1 commit 8cc367d01f4c699be5fcc072de59e6f2f14a138b Merge: c58628c eec6b7f Author: Christopher Larson <kergoth@gmail.com> Date: Thu Aug 22 09:46:46 2013 -0700 Merge pull request #4 from staticshock/function-names Parse function names with nested vars commit c58628ca517cd25985361fc0d27863521cc28a5d Merge: dfb0f7c a890982 Author: Christopher Larson <kergoth@gmail.com> Date: Thu Aug 22 09:43:40 2013 -0700 Merge pull request #5 from yoyko/master syntax: python expansion (${@...}) inside shell functions commit a890982b7c33a6e363b12d6cb69e22b4bbc0f317 Author: Jozef Šiška <yoyo@ksp.sk> Date: Thu Aug 22 13:20:45 2013 +0200 syntax: python expansion (${@...}) inside shell functions Signed-off-by: Jozef Šiška <jsiska@nuvotechnologies.com> commit eec6b7f6f0472787929f424968f9a0d78ac4af08 Author: Anton Backer <olegov@gmail.com> Date: Fri Jul 12 22:16:01 2013 -0400 Parse function names with nested vars For instance, pkg_postinst_${PN} Fixes #3 commit dfb0f7c0d51556448cba79b474b8c19b9cded9af Author: Christopher Larson <chris_larson@mentor.com> Date: Fri Jun 1 18:57:13 2012 -0400 syntax: add ?= flag def Signed-off-by: Christopher Larson <chris_larson@mentor.com> commit 589a62a00709ca822a42327e7086008aba2d9933 Author: Christopher Larson <kergoth@gmail.com> Date: Fri Dec 9 22:25:47 2011 -0700 ftplugin: set commentstring Signed-off-by: Christopher Larson <kergoth@gmail.com> commit 7ffc80b3fb4ddf68cc5a69bdc63ab03d70c44f87 Author: Chris Larson <chris_larson@mentor.com> Date: Thu Jun 2 15:27:48 2011 -0700 Handle +=/=+ for flags Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06knotty: Reduce refresh of footerRichard Purdie
When displaying larger number of events the client can get caught up in displaying the footer, then immediately overwriting it. To avoid this, wait for pauses in the event stream before displaying the footer to give a slightly more friendly feel to the UI. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06bitbake: Ensure ${DATE} and ${TIME} are consistentPeter Kjellerstedt
Due to the worker split the ${DATE} and ${TIME} variables could end up with different values for different workers. E.g., a task like do_rootfs that is run within a fakeroot environment had a slightly different view of the time than another task that was not fakerooted which made it impossible to correctly refer to the image generated by do_rootfs from the other task. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06hob: remove custom image from the images list when not neededCristiana Voicu
Selected custom image recipes should be cleared from the combo the moment you change your selection. The idea is to always perform the selection of those images in the same way (i.e through the "Select from my image recipes" option). [YOCTO #5001] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06hob: limit the description size when a custom image is savedCristiana Voicu
[YOCTO #5003] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06newbb.vim: Use 'git config' instead of git-configKhem Raj
Newer versions of git do not have the '-' concatenated command Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-06data_smart: Move getVar expand cache handing to fix _remove operationsRichard Purdie
DISTRO_FEATURES_remove = "opengl" wasn't working as expected. The reason turned out the be the indirect reference to opengl and the fact _remove was operating on unexpanded data. This patch rearranges some code to ensure we operate on expanded data by moving the expand cache handing into getVarFlags instead of getVar. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-04hob: remove PACKAGE_INSTALL variable setting from hobCristiana Voicu
Before saving the packages for a custom images in a .bb file, the packages were saved in bitbake memory. Now all the variables are saved in conf file, so saving PACKAGE_INSTALL is not needed anymore. Moved were LINGUAS_INSTALL is set, because both conditions are for testing if a custom image is saved. [YOCTO #5101] Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-04bitbake-worker: ensure BUILDNAME is available during executionPaul Eggleton
BUILDNAME is set from cooker by default, so since the worker split it will not be set when executing functions. In OpenEmbedded this results in /etc/version (which is populated from BUILDNAME) not having any content. Pass this variable value through to the worker explicitly to fix the issue. Fixes [YOCTO #4818]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 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-09-02runqueue: Fix scenequeue to pass file descriptors, not a floatRichard Purdie
This was missed off in a previous patch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01server/xmlrpc: stop server on client exitAlexandru DAMIAN
If the server only expects a single client to connect (i.e. no bind parameter set, so there is no way for the clients to get the server port), stop the server after the first client exits. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01prserv/serv: Settle on two threads for optimal performanceRichard Purdie
Using the threading mixin class resulted in large amounts of memory being used by the PR server for no good reason. Using a receiver thread and a thread to do the actual database operations on a single connection gives the same performance with a much saner memory overhead so switch to this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01build: Fix profile file namesRichard Purdie
Using the basename of the .bb file is not unique, for example xxx-native and xxx can overwrite each other. If this happens whilst running, you can get odd backtraces as one file is parsed as another tries to write out new data. Avoid issues by using PN for the output filename instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01serv/db: Don't use BEGIN/COMMITRichard Purdie
Since we don't support using multiple servers on the same database file, don't use the BEGIN/COMMIT syntax and allow writes to the database to work ~100 times faster with no transaction locking. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01serv/db: Take an excluside lock on the databaseRichard Purdie
We only support one server using the database at a time so take an exclusive lock and avoid later lock overhead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01serv/db: Fix looping upon database locked issuesRichard Purdie
If the database is locked we will get an immediate error indicating so, there is no retry timeout. The looping code is therefore useless, the loop count is near instantly exceeded. Using a time based retry means we can wait a sensible time, then gracefully exit. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-01server/process, server/xmlrpc, runqueue: Use select.select() on fds, not ↵Richard Purdie
time.sleep() The existing backend server implementations were inefficient since they were sleeping for the full length of the timeouts rather than being woken when there was data ready for them. It was assumed they would wake and perhaps did when we forked processes directory but that is no longer the case. This updates both the process and xmlrpc backends to wait using select(). This does mean we need to pass the file descriptors to wait on from the internals who know which these file descriptors are but this is a logical improvement. Tests of a pathaolgical load on the process server of ~420 rapid tasks executed on a server with BB_NUMBER_THREAD=48 went from a wall clock measurement of the overall command execution time of 75s to a much more reasonable 24s. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>