summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
Commit message (Collapse)AuthorAgeFilesLines
...
* bitbake: cache/cooker: Pass databuilder into bb.cache.Cache()Richard Purdie2016-08-181-1/+2
| | | | | | | | | | | | | Rather that the current mix of static and class methods, refactor so that the cache has the databuilder object internally. This becomes useful for the following patches for multi config support. It effectively completes some of the object oriented work we've been working towards in the bitbake core for a while. (Bitbake rev: 7da062956bf40c1b9ac1aaee222a13f40bba9b19) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cache: Make virtualfn2realfn/realfn2virtual standalone functionsRichard Purdie2016-08-181-5/+5
| | | | | | | | | Needing to access these static methods through a class doesn't make sense. Move these to become module level standalone functions. (Bitbake rev: 6d06e93c6a2204af6d2cf747a4610bd0eeb9f202) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: add BuildInit eventElliot Smith2016-08-111-0/+4
| | | | | | | | | | | | | | | | | | | In situations where a bitbake run fails before the build properly starts and BuildStarted is fired, a UI has no way to get at the targets passed to the build. This makes it difficult for the UI to report on the targets which failed. Fire a BuildInit event before running buildTargets() or buildFile(). This enables a UI to capture targets passed to buildTargets(), even if the build fails (e.g. the targets themselves are invalid). [YOCTO #8440] (Bitbake rev: ac02fda870965bf7d44ff5688eda54d2d11ab9c7) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Fix incorrect dot file generationRichard Purdie2016-07-201-1/+1
| | | | | | | | | | In the runqueue cleanup/conversion, "dep" was mistakenly used where "tid" should be leading to incorrect task-depends.dot files and causing general confusion. Fix this, its clearly incorrect looking at the code. (Bitbake rev: 689730dbb068c5ea3593e7b92fe5d5e5c0c3760a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: clean up EvertWriterEd Bartosh2016-06-201-20/+13
| | | | | | | | | | | | | Restructured EventWriter code to make it more readable: - got rid of init_file method as it's called only once - renamed exception variable e -> err - renamed event variable e -> evt - simplified main 'if' structure of send method (Bitbake rev: 31977e7bb98f676197c6cee66f6ab4c12d4dcbde) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: replace EventLogWriteHandler with namedtupleEd Bartosh2016-06-201-45/+41
| | | | | | | | | | | class EventLogWriteHandler is a simple wrapper class with only one class member. Replacing it with namedtuple makes code less nested and more readable. (Bitbake rev: 7c5b6812d32d173df36e7f9fc1d877329e79f994) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: don't remove event fileEd Bartosh2016-06-201-6/+0
| | | | | | | | | | There is no need to remove output file as it gets rewritten by open(self.eventfile, 'w') anyway. (Bitbake rev: 1fc9957837b7038dfb983217a3fcd880f143e3a4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: encode event objects to base64Ed Bartosh2016-06-201-1/+4
| | | | | | | | | | | | | | | | | | | | pickle converts python objects into the binary form that can't be decoded to text and therefore can't be converted to JSON format. Attempt to convert event objects raises this error: TypeError: b'\x80\x03cbb.runqueue\nrunQueueTaskSkipped\nq\x00)... is not JSON serializable Encoded pickled event objects to base64 to be able to convert data structure to JSON. [YOCTO #9803] (Bitbake rev: f18055237e6084f90f6221442e3ba021dcc59c50) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: move EventLogWriteHandler to the top module levelEd Bartosh2016-06-201-62/+64
| | | | | | | | | | | | | | | | | | | EventLogWriteHandler object was created and used in BBCooker.initConfigurationData. This causes creation of multiple EventLogWriteHandler objects and results in duplicated entries in the output event file as BBCooker.initConfigurationData is called multiple times. Added eventlogfile parameter to EventLogWriteHandler to avoid using global variable DEFAULT_EVENTFILE. Moved EventLogWriteHandler to the module level. Created EventLogWriteHandler object in BBCooker.__init__ to ensure that only one handler object is created. (Bitbake rev: d3ad8eee850ec2df54aa09fae44cc7e69c12f32a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fix wrong usage of format_excEd Bartosh2016-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | First parameter of traceback.format_exc is a 'limit' - a number of stracktraces to format. Passing exception object to format_exc is incorrect, but it works in Python 2 as this code from traceback module works: while tb is not None and (limit is None or n < limit): Comparing integer counter n with the exception object in Python 2 always results in True. However, in Python 3 it throws exception: TypeError: unorderable types: int() < <Exception type>() As format_exc is used in except block of handling another exception this can cause hard to find and debug bugs. (Bitbake rev: a9509949d7e2adba6e3cd89f97daa19a955855b5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: taskdata/runqueue: Rewrite without use of ID indirectionRichard Purdie2016-06-151-43/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not sure what possesed me when I wrote this code originally but its indirection of everyting to use numeric IDs and position dependent lists is horrific. Given the way python internals work, its completely and utterly pointless from performance perspective. It also makes the code hard to understand and debug since any numeric ID has to be translated into something human readable. The hard part is that the IDs are infectous and spread from taskdata into runqueue and even partly into cooker for the dependency graph processing. The only real way to deal with this is to convert everything to use a more sane data structure. This patch: * Uses "<fn>:<taskname>" as the ID for tasks rather than a number * Changes to dict() based structures rather than position dependent lists * Drops the build name, runtime name and filename ID indexes On the most part there shouldn't be user visible changes. Sadly we did leak datastructures to the setscene verify function which has to be rewritten. To handle this, the variable name used to specifiy the version changes from BB_SETSCENE_VERIFY_FUNCTION to BB_SETSCENE_VERIFY_FUNCTION2 allowing multiple versions of bitbake to work with suitably written metadata. Anyone with custom schedulers may also need to change them. I believe the benefits in code readability and easier debugging far outweigh those issues though. It also means we have a saner codebase to add multiconfig support on top of. During development, I did have some of the original code coexisting with the new data stores to allow comparision of the data and check it was working correcty, particuarly for taskdata. I have also compared task-depends.dot files before and after the change. There should be no functionality changes in this patch, its purely a data structure change and that is visible in the patch. (Bitbake rev: 2c88afb60da54e58f555411a7bd7b006b0c29306) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker.py: fix warn() -> warning()Robert Yang2016-06-131-3/+3
| | | | | | | | | | Fixed: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead (Bitbake rev: a3f464d202dafef4538e66c008cdecb7b8709ed1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Convert to python 3Richard Purdie2016-06-021-19/+19
| | | | | | | | | Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Drop futures usage since we're python 3Richard Purdie2016-06-021-1/+1
| | | | | | (Bitbake rev: bf25f05ce4db11466e62f134f9a6916f886a93d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Fix parse progress for python3Richard Purdie2016-05-211-1/+1
| | | | | | | | | | | Under python the type conversions can mean there are float values used for triggering the parse progress events which then fails. Add an explict int() conversion to ensure the parse events are generated under python3. (Bitbake rev: 138329c58e92744c56aae3ab70ceeef09613250c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Improve taskgraph file handlingRichard Purdie2016-05-191-4/+7
| | | | | | | | Use open() instead of file() and close files when finished with them. (Bitbake rev: 033c5a16ff19781ed793c2d97d285884017a2a4e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb.cooker: show limited traceback for parsing ExpansionErrorChristopher Larson2016-05-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's useful to see tracebacks for ExpansionErrors, but only if we skip the leading bitbake-internal elements, otherwise we see elements of the expansion process. As one example: Before: ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external' After: ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb Traceback (most recent call last): File "PV[:=]", line 1, in <module> File "/scratch/yocto-new/external-as-needed/meta-sourcery/recipes-external/glibc/glibc-external-version.inc", line 3, in get_external_libc_version(d=<bb.data_smart.DataSmart object at 0x7f05d2566950>): sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so') > found_paths = oe.external.find_sysroot_files([sopattern], d) if found_paths: ExpansionError: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external' (Bitbake rev: 7ff5b9eed82b7f4fd138fc6d746a0b79efbea98a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker/toasterui: Drop SEND_DEPENDS_TREE UI featureRichard Purdie2016-05-141-7/+1
| | | | | | | | | Now the event is sent unconditionally we can drop this feature as its no longer needed. (Bitbake rev: 473deeb0fc6065693e1fcfcbb8b79753103db537) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Fix log message syntaxRichard Purdie2016-05-131-1/+1
| | | | | | | | Ensure we pass the string parameter correctly. (Bitbake rev: 7ed82bd1fe7bdd93b0614119c42eb218dc5d83e6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb.{cooker, data}: only emit a var as python if 'func' is setChristopher Larson2016-05-061-1/+1
| | | | | | | | | | | | This avoids a common issue where PACKAGECONFIG is emitted as a function in bitbake -e when the 'python' flag exists. It isn't a python function unless both 'func' and 'python' are set. This aligns with the behavior of emit_func_python. (Bitbake rev: c5e45063cb3ae17bbe3304ea5e712bd76e686c4a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker/knotty: Prefix parse logs with filename being parsedRichard Purdie2016-04-151-0/+8
| | | | | | | | | | | | | We now prefix log messages coming from worker task context with the PF and task info, however parsing messages all have to be manually prefixed which is ugly and error prone. This change modifies the log handler filter so this happens automatically, meaning we don't have to change every message to include that information. This makes error messages longer but more usable. (Bitbake rev: 1af0ccaac81e182c4ca520037dda362d180e5605) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: pass exception to finishAsyncCommandRichard Purdie2016-04-151-2/+2
| | | | | | | | | | | | | | | | An invalid task causes bitbake to exit incorrectly, firing a CommandCompleted event rather than a CommandFailed one. This means that clients listening for CommandFailed events are unable to detect the build failure even though one occurred. Passing an exception string to finishAsyncCommand when a task fails causes the CommandFailed event to be fired correctly. [YOCTO #9087] (Bitbake rev: 98a2c37e077b16e3bc8bb102bd18b293130d15a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: fix CookerParser.shutdown()Markus Lehtonen2016-03-311-1/+0
| | | | | | | | | | | | | | Prevent a hang when shutdown() is called during parsing (e.g. after SIGINT). We must not append 'None' to the jobs queue. Otherwise the worker loop inside Parser.realrun() may break out at the wrong point, causing the results queue thread blocking bitbake indefinitely. [YOCTO #9319] (Bitbake rev: 7ebea3e9a60232222efa8a546a0ff28a53029949) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Ensure bbappend order is deterministicRichard Purdie2016-03-301-1/+2
| | | | | | | | | | | | | | | Currently bbappend files in a layer are applied in the order they're found on disk (as reported by glob) which means things are not deterministic. By sorting the glob results, the order becomes deterministic, the parsing order for .bb files also should be deterministic as a result of this change. [YOCTO #9138] (Bitbake rev: 3f8febc4212fbd3485ac9bdd4ac71b8fb0a05693) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb/cache: drop some unused argumentsMarkus Lehtonen2016-02-181-4/+4
| | | | | | | | | | Drop unused 'd' argument from the cache save methods, simplifying the API. (Bitbake rev: 81bc1f20662c39ee8db1da45b1e8c7eb64abacf3) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Improve cache handlingRichard Purdie2016-02-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | We're seeing issues where the self test, which uses tinfoil doesn't notice the changed contents of include files. The issue is cached_statements in the parser being reused when the files have changed. Whilst looking at this, I realised there were some other issues: * We need to also invalidate the mtime cache when cooker restarts * We should pass full filenames to the file invalidation code * We should process cached_statements as part of inotify invalidation With these fixes, the caching is more reliable for memory resident bitbake too. It does raise some questions about cache validation and lifecycles and indicates bitbake does need more work in the area, preferably with the removal of the globals. This at least highlights and works around some of the current issues. (Bitbake rev: 3f507ff8bc467fba936cf3f31bb8ea8e02f168e8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: gracefully shutdown parsersEd Bartosh2016-02-111-0/+1
| | | | | | | | | | | | CookerParser.shutdown code doesn't do all required work to shutdown parser processes. As a result bitbake hangs if interrupted during parsing. Putting None into the parser_quit queue should fix this issue as it makes parsers to quit main loop. (Bitbake rev: f67307977e8f089ce6d208d3e9de2a6a1768757e) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build/data: Don't expand python functions before execution [API change]Richard Purdie2016-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, if you have some python code like: X = "a" def somefunction(d): d.setVar("X", "b") d.setVar("Y", "${X}") then any sane person would expect that Y = "b" at the end of the function. This is not the case, Y = "a". This is due to the python function being expanded before execution, the executed code would read d.setVar("Y", "a"). This understandably confuses people, it also makes it near impossible to write ${} in a python function without unintended things happening. I think there is general agreement we should fix this and standardise on non-expansion of python functions. We already don't expand anonymous python (mostly). I've checked OE-Core with buildhistory before and after this change and there were a small number of issues this exposed which I've sent patches for. I propose we default to not expanding python code and then deal with any consequences from that if/as/where identified. This will improve new user understanding and usability of the system, it also allows several long standing weird expansion issues to be fixed. (Bitbake rev: 8bf33a8e92c0e188fa392030025756196c96fcbb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Don't expand python functions in variable dumpsRichard Purdie2016-02-101-2/+9
| | | | | | | | | | | | | | We don't want to expand python functions since they aren't expanded at execution time (e.g. anonymous python). They can also have side effects. This function is primarily used by toaster for variable dumps for later display. The lack of expansion of python functions won't matter in this case and actively helps some variable handling (e.g. SRCPV). (Bitbake rev: 3f5520b4844a4bdd615046479ba08ed192bdc8cd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: extended dot stylingSchroeder, Henning2016-02-101-3/+3
| | | | | | | | | | | | | | | Extended the dot styling of dependencies created by bitbake -g in dot syntax to differentiate between the various kinds. depends: solid rdepends: dashed rrecommends: dotted The change observed is that depends get an explicit style which is the same as dot default behavior and the runtime recommends get dotted while before they were dashed. This helps to distinguish them graphically as well as eases post processing by script. (Bitbake rev: 86e78e0ca7aa5452411f35239942ecee3d8824ec) Signed-off-by: Henning Schroeder <henning.schroeder@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: shutdown cooker parser on shutdownEd Bartosh2016-02-061-0/+3
| | | | | | | | | | | | | | | | | | | Currently any not catched exception in cooker causes bitbake to hang because of not terminated children of CookerParser. Long term solution would be to reimplement Cooker as a context manager and terminate parser children in its __exit__ method. Partial fix is to call CookerParser.shutdown in Cooker.shutdown in hope that all Cooker exceptions are caught and shutdown method is called. [YOCTO #8900] (Bitbake rev: 3f67600dc3292bc8208644ce89e8bf7ab95cf2e7) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker, bitbake-worker: Fix spelling of "received"Phil Blundell2016-02-011-2/+2
| | | | | | | | | I before E, except after C... (Bitbake rev: 14c9593265f7469cb8a205a46f845ac7491246df) Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Only start as many parse threads as we needRichard Purdie2016-02-011-2/+3
| | | | | | | | | If we're only going to parse one recipe, no point in starting a large number of threads. (Bitbake rev: b977faf59dc08050a44a16032fe52d1bbb80f2a1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Set process names to be meaninfulRichard Purdie2016-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This means that when you view the process tree, the processes have meaningful names, aiding debugging: $ pstree -p 30021 bash(30021)───KnottyUI(115579)───Cooker(115590)─┬─PRServ(115592)───{PRServ Handler}(115593) ├─Worker(115630)───bash:sleep(115631)───run.do_sleep.11(115633)───sleep(115634) └─{ProcessEQueue}(115591) $ pstree -p 30021 bash(30021)───KnottyUI(117319)───Cooker(117330)─┬─Cooker(117335) ├─PRServ(117332)───{PRServ Handler}(117333) ├─Parser-1:2(117336) └─{ProcessEQueue}(117331) Applies to parse threads, PR Server, cooker, the workers and execution threads, working within the 16 character limit as best we can. Needed to tweak the bitbake-worker magic values to tell the workers apart. (Bitbake rev: 539726a3b2202249a3f148d99e08909cb61902a5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Allow BBMASK to contain multiple regular expressionsPeter Kjellerstedt2016-01-291-2/+15
| | | | | | | | | | | | | | | | | | | | Before, BBMASK was only permitted to contain one regular expression. This made it hard to add to the BBMASK in multiple places as one was supposed to separate the different regular expressions with a "|" rather than with whitespace as is customary in BitBake variables. Now one can specify any number of regular expressions in BBMASK. This makes it possible to, e.g., mask out recipes in another layer from the layer.conf file. This also properly ignores any regular expressions that do not compile (before an invalid regular expression would cause a ParseError in the first bbappend file found stating that it was not a BitBake file...) (Bitbake rev: 2c778ad50aceaffb855baf5f4aa0fed98c880870) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: taskdata: add the ability to access world targets listPaul Eggleton2016-01-221-23/+1
| | | | | | | | | | | | | | | | | | | | | In certain circumstances it can be useful to get access to the world targets list from a recipe in order to add dependencies on some or all of the items in it. If a special function, 'calculate_extra_depends' is defined in the recipe, and the recipe is to be built, then call it at the right point before we calculate which tasks should be run. The function can append items to the "deps" list in order to add dependencies. This is not as tidy a solution as I would have liked, but it does at least do the job. As part of this change, the buildWorldTargets function was moved to bb.providers to make it possible to call from taskdata. Part of the implementation of [YOCTO #8600]. (Bitbake rev: aba0dce57c889495ec5c13919991a060aeff65d2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: add providermap to dep_treeEd Bartosh2016-01-111-0/+7
| | | | | | | | | | | | Added providermap information to the result of buildDependTree API. This will be used by Toaster to map virtual dependencies to recipes. (Bitbake rev: d3e07368549f30265f59846a260efa8230a225ca) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: fix findFilesMatchingInDir documentationRoss Burton2016-01-081-4/+3
| | | | | | | | | | | The documentation for findFilesMatchingInDir() was inconsistant with the implementation: the regex was escaped before searching so effectively it's a pure textual substring, and the machine example was broken. (Bitbake rev: 6bef981488ec94b46dbe3797acfecf9c4b6ecbbc) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: use in instead of countRoss Burton2016-01-081-1/+1
| | | | | | | | | No point counting all instances when we just want to know if there's any or not. (Bitbake rev: 3369072efb653339da8dbd1ca864ff8e1ff899ca) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: add state.get_name methodEd Bartosh2016-01-061-0/+8
| | | | | | | | | | Added method to convert state code into the human readable name. It will be used in logging and error reporting. (Bitbake rev: 9ec6379b27d210214d0b3f2e55962f721b7f5f51) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Drop useless parsing exceptionRichard Purdie2016-01-061-5/+0
| | | | | | | | | | | | | | The SyntaxError exception simply shows the recipe that failed to parse which is pretty useless without the actual exception. We could make it print more info, however we can just use one of the more generic handlers instead and remove this one. For a python indentation error, this leads to a much more readable error message. (Bitbake rev: 9241eb10847634e34c5ff8767ed8c114f66ff6cf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Ensure BB_CONSOLE remains correct over server resetsRichard Purdie2015-10-291-0/+7
| | | | | | | | | | The console log data is written to is created at console initialisation time and does not change over reset events. This ensures the BB_CONSOLELOG value is correct over such resets by preserving it. (Bitbake rev: 335eb2db228f7543a49de71f063ac72b865c947a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: preserve pre and post configsEd Bartosh2015-10-271-0/+5
| | | | | | | | | | | | | | | | | | | Additional config files passed to bitbake server with --read and --postread options are rewritten by client bitbake even if it doesn't use those options. This is a show stopper for toaster as toaster command line builds are based on the assumption that server is aware of toster configs, provided by --postread option. This behaviour is fixed by preserving values of --read and --postread options when bitbake server starts and restoring them if client bitbake doesn't explicitly specify them. (Bitbake rev: 02c64f7487ca8ec5d32c440f5002c4b8f64b76a6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: normalize build targetsEd Bartosh2015-10-161-1/+19
| | | | | | | | | | | | | | | BuildStarted event not fully represents build tasks for the targets. If -c option is used to specify default task it's not included into the event. Made build targets to always look as <target>:do_<task>. Consider default task (do_build or specified by -c command line option) when normalizing. (Bitbake rev: 0b0e214e6f53c97ad3d48f622c7fc0ca149956f6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker/runqueue: Allow bitbake commands starting with do_Alex Franco2015-09-041-3/+9
| | | | | | | | | | | | | | | The output of "bitbake, -c listtasks pkg" lists tasks with their real names (starting with "do_"), but then "bitbake -c do_task" fails, as "do_" always gets unconditionally prepended to task names. This patch handles this error by checking whether a task starts with "do_" prior to prepending it with it when the task runlist is being constructed (and a few other corner cases). [YOCTO #7818] (Bitbake rev: dd3050ceef37ac556546e940aa596ce96ef6c8df) Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/cooker: add interrupted flag to BuildCompleted eventPaul Eggleton2015-08-291-2/+8
| | | | | | | | | | | | | Allow any listeners for this event (such as buildhistory.bbclass in OpenEmbedded) to find out if the build was interrupted rather than completing normally. The value will be 0 if not interrupted, 1 if interrupted waiting for remaining tasks to complete, or 2 if force interrupted (stopping any running tasks immediately). (Bitbake rev: df2b778efd2ecc48f6c5a3ed446f6459f2250035) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: drop appendlistPaul Eggleton2015-08-191-5/+0
| | | | | | | | | | Now we have the bbappends list and all users have been converted over to use it, we don't need this anymore. (Bitbake rev: 279770c42d4c63aa2cebce331b55a92a564b50ac) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: drop appliedappendlistPaul Eggleton2015-08-191-10/+18
| | | | | | | | | | Whilst collecting this list on the fly may be quicker, doing so within a function that's meant to *query* the list of bbappends is poor practice. (Bitbake rev: 5c12aa3b0010d7d1733e54a0ca7d0af465454210) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: ensure prefile/postfile can work in memory resident modePaul Eggleton2015-08-191-1/+3
| | | | | | | | | | | | The prefile/postfile options weren't working in memory resident mode because they weren't being passed through to the server, so ensure that they do get passed through and that the server is reset when the values come through. (Bitbake rev: a3f7dc042fc7b1c308bfd248431930eb8ba50326) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: command: ensure sync commands that read configuration see updatesRichard Purdie2015-08-191-11/+16
| | | | | | | | | | | | Add a means of ensuring that synchronous commands that read the results of the configuration trigger a reparse of the configuration if any underlying files have changed. (Bitbake rev: aaf3cc024315450c1674819edf2a4e5cdf293f35) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>