summaryrefslogtreecommitdiff
path: root/bitbake
Commit message (Collapse)AuthorAgeFilesLines
* Fix PWD issue with new exec_func_shellChris Larson2011-01-041-2/+0
| | | | | | | | | | | | | | | | The previous attempt was incorrect. The issue isn't that subprocess fails to set PWD, it's that PWD is in the metadata, inherited from the environment, and is re-exported, overwriting the actual accurate one in the shell environment with the old one from the metadata. So, ensure that PWD in the metadata is not exported. We can ditch this when the environment handling is reworked (e.g. poky's commit to do so). (Bitbake rev: 2c8683234acf514706b2b69f5b29405485e664dd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Ensure that the invalid UI error goes to stderrChris Larson2011-01-041-11/+20
| | | | | | | (Bitbake rev: 76aeea2c23a518046d0b26f1a6fc43287a180a9d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* build: set PWD in the subprocess preexec hookChris Larson2011-01-041-3/+4
| | | | | | | (Bitbake rev: efa5485c8f9d488ba058c40734cc55296d3de6eb) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake: Transfer noexec runqueue messages to the UIRichard Purdie2011-01-042-12/+16
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Move the runq task start/failed messages to the UIChris Larson2011-01-042-11/+15
| | | | | | | (Bitbake rev: ab831e867f09b47001cb8da2f8f060e04febf237) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Silence python 2.7 nested context manager warningChris Larson2011-01-041-0/+1
| | | | | | | (Bitbake rev: 1c38f19fb8da2e6c55394162d0142e7146387e54) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Rename command events, adjust compareRevisionsChris Larson2011-01-046-49/+41
| | | | | | | | | | | | - Moved the logic for comparing revisions from cooker into command - Removed 'Cooker' from the event names - Renamed the 'ExitCode' event into CommandExit, and changed CommandFailed to be a subclass of CommandExit (Bitbake rev: c51ed5d7a9971fad6019dac6c35a71b8a54ab16a) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* event: use cPickle for eventsChris Larson2011-01-041-1/+4
| | | | | | | (Bitbake rev: b16c0c1dc3b7e03b02555e9803767a0d695e67f1) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* utils: fix 'lock' variable referenceChris Larson2011-01-041-1/+1
| | | | | | | (Bitbake rev: f57f8f3cc980e3ae1693c2e065227e951ed0b1c0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bb.event: fix MsgBase ref in fire_class_handlersChris Larson2011-01-041-2/+1
| | | | | | | (Bitbake rev: db7f960e5f103a424a4319f1867fb540e643c1ec) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Kill the uncaught exception handlerChris Larson2011-01-041-12/+6
| | | | | | | | | | | | We now wrap the main() in a try/except, ensuring that both the main portion of bin/bitbake and the UI raising an exception will be shown to the user. For the server and workers, we can ensure in the server itself that exceptions are handled correctly. (Bitbake rev: 240d4a7ae80a6636c302ae84266ddfed7a7fcedd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* build: fix -D with shell functionsChris Larson2011-01-041-4/+18
| | | | | | | (Bitbake rev: 1c8be64732fdf4f3a608c090b3dc92065d6058d6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* build: send logging messages to the log file for python functionsChris Larson2011-01-043-16/+19
| | | | | | | (Bitbake rev: ee1cce6ab21ddda60a7a070d03e98ff8485a5e71) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* utils: fix calls to close() in the lock/unlock functionsChris Larson2011-01-041-8/+9
| | | | | | | (Bitbake rev: 4262c26d36d1c1b6801ac422716a227c1f6b9589) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* build: use a contextmanager for locksChris Larson2011-01-042-13/+22
| | | | | | | | | | Also don't bother passing logfile to exec_func_python, at least until we start adding the logfile as a file handler to the bitbake logger. (Bitbake rev: f99ee4680c9f67b7ed13fc06044ba2382f9a782c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* build: use bb.process instead of os.systemChris Larson2011-01-043-182/+185
| | | | | | | | | | | | (Bitbake rev: 53740977521bc81ffa37adfa7bbeb8f2a80ea165) build: write logfiles per task, not per function Based on d14f9bf6 from poky, reworked for master and other cleanup. (Bitbake rev: beadff2eca1eb95f0411115dd72ddb4c3c44c604) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* process: add subprocess-based bitsChris Larson2011-01-041-0/+107
| | | | | | | (Bitbake rev: c63e55564a8840083dbd8634b10fe6f76d1f1354) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Rename the ui 'init' method to 'main'Chris Larson2011-01-046-21/+10
| | | | | | | | | | As these may run the UI in a blocking fashion and then return the exit code, 'init' was an inappropriate name, and 'main' is more appropriate. (Bitbake rev: 4d081a0ed759bd526ab01849d650bd9e8d80ddd1) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: use re match, not search in re_match_stringsChris Larson2011-01-041-1/+1
| | | | | | | | | | | | We want to match the requested pattern at the beginning of the string, otherwise things behave in an unintuitive manner wrt ASSUME_PROVIDED (e.g. ASSUME_PROVIDED += "gtk+" will also assume foo-gtk+ is provided), and the user can always use '.*gtk+' to get the old behavior. (Bitbake rev: 5670134ab2eb573d39df3c3231677cdb1a1dfc72) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* taskdata: use 'any' in re_match_stringsChris Larson2011-01-041-7/+3
| | | | | | | (Bitbake rev: e48e9a2150ee76aaf151f6d5bc9e86e6ae4de514) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: add shutdown/stop methodsChris Larson2011-01-042-2/+8
| | | | | | | (Bitbake rev: fc64eff03fe1f41e59128cb3df0ef2161e24a8cb) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: merge cookerState and cookerActionChris Larson2011-01-042-25/+15
| | | | | | | (Bitbake rev: c7c8945ef7ca9465312e630b7fa5f0a87ac8b6c7) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: use a pool, abort on first parse errorChris Larson2011-01-041-84/+60
| | | | | | | (Bitbake rev: 9caf65e79f95fe0045e727391e974c4c1e7411ff) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* knotty: use enumerate for task waitingChris Larson2011-01-041-3/+1
| | | | | | | (Bitbake rev: 89ce8df075ac8c9a5478c86405e6e6b60346a51c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* knotty: shift non-interactive progress into a classChris Larson2011-01-041-15/+33
| | | | | | | (Bitbake rev: c3d005cbbae3d56da9926666cfb1501c2bf96ea7) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Fix the <100 recipe progress fixChris Larson2011-01-041-1/+1
| | | | | | | (Bitbake rev: 424428a764651183218f9cc93bc05496867aa5de) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Error more pleasantly when trying to use python2.4Chris Larson2011-01-041-10/+11
| | | | | | | (Bitbake rev: 57402ee727c8c1d8f5017534fb0f5e0b20aaaa5b) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Don't show a traceback for a python version errorChris Larson2011-01-041-1/+4
| | | | | | | (Bitbake rev: 44c325306e55336b7b416fd88b39874012a3f603) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: don't choke on <100 recipes to parseChris Larson2011-01-041-1/+1
| | | | | | | (Bitbake rev: 2be5169a01e57bcfcb1f75cbd6bac3bf0f230edd) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: no cached in progressbar and add ETAChris Larson2011-01-043-20/+12
| | | | | | | | | | | | Rather than updating the progress bar based on the recipe being processed (whether cached or parsed), consider only parsed recipes. This reduces the instability in progress rate introduced by the cached entries, and allows the ETA to be resurrected and be a bit more useful. (Bitbake rev: 618480f7739f6ae846f67a57bee5a78efb37839d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: change to more incremental formatChris Larson2011-01-041-22/+33
| | | | | | | (Bitbake rev: 4fe4ffbef3885887c97eebe021edc3f23feab9ea) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: pass back child exceptions to the serverChris Larson2011-01-041-6/+12
| | | | | | | (Bitbake rev: 0f68f8bcd0e0aa944f76f88a4a85c9bcc1e42bee) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* vercmp: don't choke on empty first version componentsChris Larson2011-01-041-1/+1
| | | | | | | (Bitbake rev: e75aa94e9477933c5a40021b2a8e844db54f29da) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Use __file__, not sys.argv[0]Chris Larson2011-01-042-2/+2
| | | | | | | (Bitbake rev: 97e92abe49663eee189c89c1dc91fe69891faf73) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: ensure 'pn' is included in the pkgvarsChris Larson2011-01-041-12/+12
| | | | | | | (Bitbake rev: cefc28a2aa1e5703119dacfd885c8c159a1e47a3) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* knotty: drop the ETA from the progressbar for nowChris Larson2011-01-041-1/+1
| | | | | | | | | | | | | | Currently, the progress bar is an indication of the processing of our recipes, which includes loading the cache file, then for each recipe, either adding the existing cached information to the CacheData or parsing the recipe from disk. These tasks clearly take different amounts of time, so the ETA is unreliable today. We'll resurrect this functionality after we revamp the progress handling, fully incorporating the load of the cache file. (Bitbake rev: 80867372dcbef91ebaf7d77a77ca871741dd3f74) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: ensure that the cache sync completesChris Larson2011-01-041-2/+7
| | | | | | | | | | | Without explicitly joining the thread, it's possible for the process to end (e.g. after a bitbake -p) and kill off the thread without waiting for it to exit cleanly. So, register the thread join with atexit. (Bitbake rev: 97ce57e6f860d3e6f34cc7a603ed1eeac4f423d3) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: get number of threads in constructorChris Larson2011-01-041-3/+3
| | | | | | | (Bitbake rev: e7fd259d1528f48b0812fb7b0a54dd6d5d22f4a9) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: don't add info for skipped recipesChris Larson2011-01-041-2/+3
| | | | | | | (Bitbake rev: ac596d55de4ad86e1cdc84dabfea1350dd54efd0) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: show progress bar before initializing the cacheChris Larson2011-01-041-13/+16
| | | | | | | | | | | | | This ensures that the time spent loading the cache from disk occurs with the progress bar up. Though the progress bar stays at 0% during this period, I think this is an improvement over the multi-second stall which occurred previously before the progress bar came up. Ideally, we'd integrate cache loading from disk into the progress display, but this is a first step. (Bitbake rev: f6d0a5c219f9deb84f702450d30d868ba6271f77) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: save progress chunk value (total/100)Chris Larson2011-01-041-1/+2
| | | | | | | (Bitbake rev: 09333737cbeeb9875d938521ddcd519fc808bcc3) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: stop loading the cache for -bChris Larson2011-01-044-32/+33
| | | | | | | | | | | Previously, the cache was actually being loaded from disk twice whenever using -b or -e -b. This also moves the bb_cache instance into the CookerParser, as it's not needed by the cooker itself at all. (Bitbake rev: dd0ec2f7b18e2a9ab06c499b775670516bd06ac8) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cooker: don't fire unnecessary parse progress eventsBob Foerster2011-01-041-1/+3
| | | | | | | (Bitbake rev: 7cf7d5f14405681496fced3640a50a20ef1acac1) Signed-off-by: Bob Foerster <robert@erafx.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: don't add info to cache if cache is disabledChris Larson2011-01-041-0/+3
| | | | | | | (Bitbake rev: f12bb303f3d86a68d0b3dda1112dd654b9251704) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: sync the cache file to disk in the backgroundChris Larson2011-01-044-43/+60
| | | | | | | | | | | | | | | | This version uses a thread rather than a process, to avoid problems with waitpid handling. This gives slightly less overall build time reduction than the separate process for it did (this reduces a -c compile coreutils-native by about 3 seconds, while the process reduced it by 7 seconds), however this time is quite insignificant relative to a typical build. The biggest issue with non-backgrounded syncing is the perceived delay before work begins, and this resolves that without breaking anything, or so it seems. (Bitbake rev: 5ab6c5c7b007b8c77c751582141afc07c183d672) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Simplify cache syncingChris Larson2011-01-041-22/+13
| | | | | | | | | | | Rather than adding nocache items to the cache, then copying the cache and removing them to sync it, don't add them in the first place. Also use 'with' for the cachefile. (Bitbake rev: 343b6f6255ad020c39e30742175a241f0859a5a6) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Experimental usage of the 'progressbar' moduleChris Larson2011-01-042-8/+396
| | | | | | | (Bitbake rev: 64feb03bc2accecb49033df65e0a939ef5ab5986) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* Implement parallel parsing supportChris Larson2011-01-043-77/+157
| | | | | | | | | | | This utilizes python's multiprocessing module. The default number of threads to be used is the same as the number of available processor cores, however, you can manually set this with the BB_NUMBER_PARSE_THREADS variable. (Bitbake rev: c7b3ec819549e51e438d293969e205883fee725f) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: don't write out the cache unnecessarilyChris Larson2011-01-041-1/+5
| | | | | | | | | | | If the only recipes's we reparsed this run were those flagged as not to be cached, there's no point in re-saving the cache, as those items won't be included anyway. (Bitbake rev: 1e0c4dbcbec886a30b89f8b4bb365c3c927ef609) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* cache: create and use a RecipeInfo classChris Larson2011-01-042-175/+197
| | | | | | | | | | | | | | | | | | This class holds the particular pieces of information about a recipe which are needed for runqueue to do its job. By using it, I think we improve code clarity, reduce method sizes, reduce overuse of primitive types, and prepare for parallel parsing. In addition, this ditches the leaky abstraction whereby bb.cache attempted to hide the difference between cached data and a full recipe parse. This was a remnant from the way things used to be done, and the code using it had to know the difference anyway. If we choose to reimplement caching of the full recipes, we can do it in bb.parse, in a completely transparent way. (Bitbake rev: 992cc252452221f5f23575e50eb67528b2838fdb) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>