summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
AgeCommit message (Collapse)Author
2019-08-22bitbake: cooker: Kill alive process before join itm5Robert Yang
Fixed: $ echo helloworld >> meta/recipes-extended/bash/bash_4.4.18.bb $ while true; do kill-bb; rm -fr bitbake-cookerdaemon.log tmp/cache/default-glibc/qemux86-64/x86_64/bb_cache.dat* ; bitbake -p; done It may hang in 10 mins, there are two problems: * There might be deadlocks when call process.join() if the queue is not NULL, so we need cleanup the queue before join() it, but: * The self.result_queue.get(timeout=0.25) may hang if the queue._wlock is hold by SomeOtherProcess, the queue has the following info when it hangs: '_wlock': <Lock(owner=SomeOtherProcess)> We can kill alvie process before join it to fix the problems. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2019-08-14bitbake: cooker: Improve hash server startup code to avoid exit tracebacksRichard Purdie
At exit the hashserv code was causing tracebacks as join() wasn't being called from the thread that started the process. Ensure that the hashserver is started from the pre_serve hook which is the final thread the cooker runs in. This avoids the traceback at the expense of some horrific poking into data stores which will ultimately need improving through a proper API. (Bitbake rev: 05888700e5f6cba48a26c8a4c447634a28e3baa6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-08bitbake: cooker: Cleanup the queue before call process.join()Robert Yang
Fixed: $ rm -fr tmp-glibc/cache/default-glibc/qemux86/x86_64/bb_cache.dat* ; bitbake -p Press *one* Ctrl-C when the parsing process is at about 50%, then the processes are not exited: Keyboard Interrupt, closing down... Timeout while waiting for a reply from the bitbake server It hangs at process.join(), according to: https://docs.python.org/3.7/library/multiprocessing.html Cleanup the queue before call process.join() can fix the problem. (Bitbake rev: 3eddfadd19b2ce4c061861abf0c340e3825b41ff) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-06bitbake: hashserv: Switch from threads to multiprocessingRichard Purdie
There were hard to debug lockups when trying to use threading to start hashserv as a thread. Switch to multiprocessing which doesn't show the same locking problems. (Bitbake rev: be23d887c8e244f1ef961298fbc9214d0fd0968a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-06bitbake: cooker/hashserv: Allow autostarting of a local hash server using ↵Richard Purdie
BB_HASHSERVE Its useful, particularly in the local developer model of usage, for bitbake to start and stop a hash equivalence server on local port, rather than relying on one being started by the user before the build. The new BB_HASHSERVE variable supports this. The database handling is moved internally into the hashserv code so that different threads/processes can be used for the server without errors. (Bitbake rev: a4fa8f1bd88995ae60e10430316fbed63d478587) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-28bitbake: bitbake: lib: Cleanup /usr/bin/env pythonRobert Yang
(Bitbake rev: cc712f3257904960247a7532cfc4611f3dccd36c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-11bitbake: cooker: Ensure mcdeps are processed even if only one multiconfigRichard Purdie
If you have no BBMULTICONFIG set but set mcdepends, they're currently ignored. We can handle them correctly with this small tweak. (Bitbake rev: 578f0c02f6a13f4315e7c2ce8b5e876dd2025055) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-10bitbake: cooker: Add compability handling for multiconfig: prefix migrationRichard Purdie
This allows "multiconfig:" targets to continue to work by internally mapping them to the new "mc:" naming, allowing older builds to work as before. (Bitbake rev: c4d90890547af642e99cc541af3415df3559563e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-10bitbake: multiconfig: Switch from 'multiconfig' -> 'mc'Richard Purdie
After real world use its clear the "multiconfig:" prefix to multiconfig tasks, whilst clear, is also clumbersome. Switch to use the short version instead. mcdepends will continue to work with "multiconfig:" for now as well. The commandline will only accept mc: going forward. [YOCTO #11168] (Bitbake rev: 821daf093b76504067a8b77dfa4b181af6ec92b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-30bitbake: bitbake: Show base multiconfig environmentJoshua Watt
Adds support to the 'bitbake -e' command so that it can display the base environment for a multiconfig. It was previously possible to get the base environment for the main environment by running "bitbake -e", but there was no support for getting the base environment for a multiconfig without specifying a recipe. A user can now print the base environment for the multiconfig "foo" by running: $ bitbake -e multiconfig:foo (Bitbake rev: 3d657af8a6120193d45d01968605b30075a56198) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-30bitbake: bitbake: cooker: Rename __depends in all multiconfigsJoshua Watt
The renaming of the __depends variable to __base_depends and file watches needs to occurs for all multiconfigs, not just the base config. Failing to do this for all multiconfigs will result in a huge increase in the size of the parsing cache (about 5x for a single mulitconfig) because all multiconfig caches will still depend on the base config files. This will also seen a similar jump in the amount of time required to load the parsing cache from memory, both because the cache is larger and because of explosion of additional existence checks that must be done for the base files. [YOCTO #13359] (Bitbake rev: 34137a00f60280e9e806070c6507a0fc6284b834) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: bitbake: Strip old editor directives from file headersRichard Purdie
There are much better ways to handle this and most editors shouldn't need this in modern times, drop the noise from the files. Its not consitently applied anyway. (Bitbake rev: 5e43070e3087d09aea2f459b033d035c5ef747d0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: bitbake: Drop duplicate license boilerplace textRichard Purdie
With the introduction of SPDX-License-Identifier headers, we don't need a ton of header boilerplate in every file. Simplify the files and rely on the top level for the full licence text. (Bitbake rev: 695d84397b68cc003186e22f395caa378b06bc75) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie
This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-24bitbake: cooker: Fix bbfile_config_priorities when BBFILE_PATTERN is emptyRobert Yang
The layer was not in bbfile_config_priorities when BBFILE_PATTERN is empty, this caused "bitbake-layers show-layers" can't show these layers, this was incorrect since these layer did exist. Add these layer to bbfile_config_priorities can fix the problem. Fixed: Add BBFILE_PATTERN_core = "" in oe-core/meta/conf/layer.conf $ bitbake show-layers | grep oe-core There was nothing, now the layer is shown (Bitbake rev: 0ff5cdb0cca9266ca29127639494bcfd95e36831) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25bitbake: cooker: Tweak multiconfig dependency resolutionRichard Purdie
There were a couple of problems with the multiconfig dependency resolution: - the "if mc" condition triggering this code wasn't correct, it needs to be "if more than one multiconfig" configured - after adding providers we need to call add_unresolved again and rebuild mcdeps within the "while new" loop By fixing these issues we allow various other combinations of multiconfig builds to work which previously didn't. [YOCTO #13090] [YOCTO #13130] (Bitbake rev: 4359b037de578095db2595f119dfb8e3340e1414) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08bitbake: cooker: Split recipes to parse amongst threads ahead of timeRichard Purdie
We have two choices, split the recipes amongst the parsing threads in blocks ahead of time, or have a queue which parsers pull from when idle. The optimum approach depends on how similar the pieces are. For the single recipe reparse case, there is currently a significant wait for the feeder thread to start (around 0.25s in a 2s command). Its possible splitting into blocks in advance may be unluckly for some other workloads but experimentally it seems to work better overall for me at least. (Bitbake rev: ae79868861568d673a70472e85a4bde9e2d84a8f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08bitbake: cooker: Remove Feeder() since its no longer needed with moderm ↵Richard Purdie
multiprocessing There used to be many bugs in multiprocessing and we implemented our own feeder process to avoid them. Now that we have python 3.x, these are fixed and just using the standard Queue mechanism appears to work fine. We can therefore drop the unneeded code and simplify. (Bitbake rev: b2d39fc37fcf3c81a562ec1ef4f8b4c1a493fc57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03bitbake: cooker: fix indirect multiconfig dependenciesAlejandro Enedino Hernandez Samaniego
When an indirect multiconfig dependency exists, such as: A depends on B, B has a multiconfig dependency to C,and our build target is A, the multiconfig dependency to C is not processed on time, hence no providers are added for it, causing an exception in the runqueue because the dependency does exist in it. Call add_unresolved() for all available multiconfigs before processing providers for multiconfig dependencies, detecting mcdepends on time so providers for them can be added correctly. (Bitbake rev: 8a6bc7584ad61b4de98af92a86066602006262f9) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08bitbake: cooker: Add some timing debug messages to the server startupRichard Purdie
We're seeing slow startup in bitbake, add some timeing debug messages so the logs are more useful for debugging when its slow. (Bitbake rev: 8d1fc115b8a176009f1f3a8ce840b422e7e0b45e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-22bitbake: cooker: Fix multiconfig dependenciesAlejandro Enedino Hernandez Samaniego
When multiconfig is enabled the cooker adds providers for all the targets to be built on all the multiconfig variables that were set, regardless if there is a dependency to it or not. This causes an issue when a certain target is incompatible with one or more of the multiconfigs, e.g. the target is not in COMPATIBLE_MACHINE for one of the MACHINEs being built, causing the cooker to error out since no providers can be found for that certain target on that multiconfig. This patch modifies the behavior to only look for PROVIDERS for a target on the multiconfig that was selected to be built, PROVIDERS are then looked for in other multiconfigs only when there is a defined dependency to them. [YOCTO #12985] (Bitbake rev: f2106a3a767542359fdde238abcf5fe35ab3a144) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-10bitbake: cooker/runqueue: Turn universe warnings into verbnotesRichard Purdie
If the user puts universe on the commandline, they don't really want warnings so use the new verbnote level instead. (Bitbake rev: 0c87ade5678e503899e3a6cdda5329f6fc212b63) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-05bitbake: cooker.py: Fix incorrect bb files matched warningMark Hatle
In the case of a sublayer of an existing layer, where the sublayer and main layer share a path, the system may not match the paths properly resulting in: No bb files matched BBFILE_PATTERN_sublayer '^/path/main/sublayer' because it has already matched the main layer. Fix this issue by sorting the collection items based on the pattern, using longest to shortest. Obviously regex wildcards could still be an issue but these are typically not used, so this simply fix should work in the existing cases. (Bitbake rev: 1787cef7221b88f6920ea70fadaffc117d84c7aa) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-01bitbake: bitbake: Add support for multiconfig dependenciesAlejandro Enedino Hernandez Samaniego
This patch adds the capability for tasks from different multiconfigs to depend on one another. These dependencies can be enabled using the following format: task[mcdepends] = "multiconfig:FROM-MC:TO-MC:PN:task-to-depend-on" For the sake of simplicity consider the following example: Assuming we have set up multiconfig builds, one for qemux86 and one for qemuarm, named x86 and arm respectively. Adding the following line to an image recipe (core-image-sato): do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_rootfs" Would state that core-image-sato:do_image from x86 will depend on core-image-minimal:do_rootfs from arm so it can be executed. This patch makes modifications to: - cooker: To glue both multiconfigs in one place and make sure the dependencies can be provided. - taskdata: To parse and add a new kind of dependency (mcdepends) to the taskdata object. - runqueue: To differentiate tasks from different multiconfigs, add the specified dependencies to the corresponding tasks, and create a working runqueue that contains tasks from both multiconfigs. - siggen: To avoid looking for tasks from different multiconfigs on objects where they dont belong. The taskdata objects are still not aware of the concept of multiconfig, so each object doesnt know which multiconfig its building, hence why the mcdepends are added to all taskdata objects equally (we really dont expect many of these), but the actual dependencies are added only to the required tasks by the runqueue. (Bitbake rev: da8cb8633504bdc815bdcefc538340b9bce5065d) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04bitbake: cooker: Fix environment double key expansion issueRichard Purdie
The base configuration needs key expansion and anon python execution, the parsed configurations do not. Fix this consistently, its been broken and causing double key expansion for a while, only relised when we started double anonymous python exeution too. (Bitbake rev: 6138897de5ac6becf3bff56ce7a78f3ec208fcdf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04bitbake: cooker: Run registered anonymous python before displaying environmentRichard Purdie
The output of bitbake -e can differ from what actually is used due to anonymous python making changes to the data store. Execute any anonymous python added in the base configuration to make things more consistent. (Bitbake rev: bcdc2f73e3b4a10b1e479c2891f251d9507a9e30) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-14bitbake: bitbake: cooker: don't stop file notifier when cooker is shutdownRobert Yang
It should be live/exited with server rather than cooker, fixed: $ bitbake --server-only -T -1 Set MACHINE = "qemux86" in conf/local.conf $ bitbake quilt Set MACHINE = "qemuppc" in conf/local.conf $ bitbake quilt [snip] ERROR: When reparsing /workspace1/lyang1/poky/meta/recipes-connectivity/openssl/openssl_1.0.2m.bb.do_package, the basehash value changed from c216f7f4fdd3cf4a0b10b975a636426c to d5a8e9431ab261381752d7a64c7b2fa9. The metadata is not deterministic and this needs to be fixed. [snip] This is because the server doesn't know local.conf is changed since the notifiers are stopped, so it doesn't reparse, and then we would get the errors, let the notifiers live/exited with server can fix the problem. (Bitbake rev: a6a641cb9c5f3abe901b150da915372e295383d7) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-14bitbake: bitbake: cooker: fix for BBFILE_PATTERN matches bbappendRobert Yang
The old code couldn't handle nestled layers correctly, e.g.: parent_layer/sub_layer/foo.bb Note there are two layers, parent_layer and sub_layer. And in parent_layer/conf/layer.conf: BBFILE_PATTERN_parent_layer = ""^${LAYERDIR}/" This setting is incorrect since it also matches parent_layer/sub_layer/foo.bb, so it warns that no files matched sub_layer, this is the expected behavior, but it doesn't warn when there is a parent_layer/sub_layer/bar.bbappend, this was incorrect since the bbappend is also matched by BBFILE_PATTERN_parent_layer, it should warn and let the user fix the problem. Check the bbappend in already "matched set" before return it as matched by "unmatched set" can fix the problem. (Bitbake rev: ec90245d28e52ea718d2ce084eb304cdc4355c9c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-14bitbake: bitbake: cooker: skip when BBFILE_PATTERN is emptyRobert Yang
There is nothing to do when BBFILE_PATTERN is empty. (Bitbake rev: b7da31641c24c53d47ea45a7119d1bd353011b39) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29bitbake: cooker: Sort task graph (dot) file outputRichard Purdie
This means two different graph files can easily be compared, currently you'd have to sort them as the output is randomized. (Bitbake rev: 5f7c6ec785f70beb1a4a1bbc0eb83cfa6cd7740d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21bitbake: cooker: fix typo in bitbake -g messagePaul Eggleton
Flatened -> flattened. (Bitbake rev: 80f72ac6c56ba8f3e2f7b5f0cb95bee6c0101323) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-31bitbake: cooker: fix watching directories with Python 3.6+Paul Eggleton
In Python 3.6, glob.glob() was reimplemented to use os.scandir() (which itself appeared in Python 3.5), thus our monkey patching of os.listdir() here was no longer effective. The end result was not only that bitbake wouldn't notice added recipes or bbappends with BB_SERVER_TIMEOUT set when being run with Python 3.6 (the shipped Python version on Fedora 26 and some other distribution versions), it also broke devtool modify, devtool upgrade and devtool extract since they rely on the ability to create a bbappend on the fly and have bitbake pick it up. To fix it, do the same monkey patching for os.scandir(), which needs to be conditional upon that actually existing since we have to support Python 3.4 that doesn't have it. Long term we should probably look for a better way to handle this that doesn't involve monkey patching Python library code. Fixes [YOCTO #12185]. (Bitbake rev: d02e90db32e7ee341c2ba3be79b0627d8796bdd6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-17bitbake: cooker: ensure monkey-patching in collect_bbfiles() gets undone on ↵Paul Eggleton
error In collect_bbfiles() we're monkey-patching os.listdir in order to find which directories to watch, and then undoing that when we're finished - however if an exception occurred for any reason there was nothing to ensure the latter occurred. This may not have caused any issues, but as this kind of thing really ought to be secured using try...finally just in case, so do that. (Bitbake rev: 013047484a03185c0ce281c53c1db4949cdc4e69) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-17bitbake: cooker: fix watching empty directoriesPaul Eggleton
The code that was supposed to watch directories along BBFILES for creation of new files wasn't working in the case where the directory did not initially contain any matching files - since in updateCache() we are passing the directory path to add_filewatch() and the latter function calls os.path.dirname() on the path on the assumption that it is a file path, and thus the parent of the directory got watched but not the directory itself. (If the directory wasn't empty everything worked fine since add_filewatch() was called elsewhere with the path to one of the files in that directory, and thus the directory got watched). Add a parameter to add_filewatch() to tell it we are passing it directory path(s) rather than file path(s). (Bitbake rev: 47a34dee08fcc25d896a1bdf16fa86267f0b898f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12bitbake: process/cooker: Improve readypipe handlingRichard Purdie
Issues in start are not being correctly detected by the current readypipe code. Change it to use specific "ready" or "fail" messages to correctly determine the correct failure mode and avoid bitbake seeming to hang (it does currently timeout eventually). [YOCTO #12062] (Bitbake rev: 60d4791e3dd05729d2a2adf6f3b203c80d466a73) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05bitbake: cooker: clear extra config settings and remote datastores on client ↵Paul Eggleton
disconnect When the UI disconnects, we can throw away any server-side remote datastores we created in response to calls from the UI, and we *must* drop everything in extraconfigdata or it will taint any future operations. Dropping extraconfigdata upon disconnect fixes taskhash mismatch errors when running devtool.DevtoolTests.test_devtool_update_recipe_local_files within oe-selftest with BB_SERVER_TIMEOUT=100 in OpenEmbedded. (Bitbake rev: 1ca2eec459424892391f060442ef38cf28d6a54a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-05bitbake: cooker.py: Fix layer priority processingMark Hatle
If you have a layer with a blank BBFILE_PATTERN the layer was ignored when processing the list of layers with priorities. This list is not only used for processing recipes, but also by additional programs such as bitbake-layers show-layers. Without this change, a layer that provides configuration or classes only does now show up in show-layers, which is used by the yocto-compat-layer.py script. This causes a failures in the compatibility check. (Bitbake rev: a0eaf8c0f228f984bafff09e4e9739f758dc1a9b) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-02bitbake: cooker: Ensure parseConfiguration clears parsecache_validRichard Purdie
BB_SERVER_TIMEOUT=100 oe-selftest -r bblayers was failing and highlighted that since parseConfiguation clears data structures, it needs to also clear parsecache_valid as it no longer contains correct data. (Bitbake rev: 7234f33a7eb38ad51a8345f6689bc26e29f29f92) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: cooker: Ensure buildFile doesn't have lasting side effectsRichard Purdie
BB_SERVER_TIMEOUT=100 oe-selftest -r devtool.DevtoolTests.test_devtool_build_image fails, the reason is that internally, the limited_deps flag is set in the bitbake server and then never cleared. This causes the sysroots to be setup incorrectly (as per the limited dependency case) and builds break. There is also potential for corruption of recipecaches. Add shutdown/cleanup code to ensure these effects don't 'stick'. This bug is particularly nasty as you can destroy TMPDIR with large sysroots in build work directories which are prone to break. Also ensure mtime cache is cleared (to match buildTargets) and that no lasting changes are made to siggen either which ensures: BB_SERVER_TIMEOUT=100 oe-selftest -r devtool.DevtoolTests.test_devtool_upgrade_git devtool.DevtoolTests.test_devtool_virtual_kernel_modify works. (Bitbake rev: 0a7ee8c8378bba9877c260b1aee782878f1935b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: cooker: ensure we can run buildFileInternal() after cache is populatedPaul Eggleton
If you run some other operations that result in the cache being populated, and then call buildFileInternal(), then you can end up in a situation where the cache already contains information about the recipe. For example in OE this can now happen when you use devtool upgrade. Normally this doesn't cause any problems, unless you have a non-absolute path in BBLAYERS - in buildFileInternal() we are calling matchfile() which will convert the filename to absolute, but later when taskdata goes to find the providers of the recipe it finds the non-absolute path, sets up the task information using this and then the runqueue can't find any tasks matching the absolute path. To fix this, back out the optimisation I did earlier in bitbake rev ba53e067a2d448dd63b4ca252557ce98aa8e6321 to avoid calling parseConfiguration() again, which is unfortunate but does result in the cached information being that causes the problem being cleared out. This fixes "Task do_unpack does not exist for target ..." running devtool upgrade within intel-iot-refkit. (Bitbake rev: f120355eaec4571ba6d60fc5f7ae9e1f31d846d1) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: cooker: Allow changes in PRSERV_HOST to be responded toRichard Purdie
When we reload the configuration, PRSERV_HOST can change. Therefore restart the PR Server depending on the new configuration at reparse. Note that the server has to be started from the right process, it can't be in the UI which shuts down as that shutdown triggers a shutdown of its children and the PR Server shuts down too. This is why we need pre_serve() which ensures its executed in the right context. (Bitbake rev: 971272e84f4efe7ebd0037e164ba54f013a2a34e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: cooker: Change to consistent prefile/postfile handlingRichard Purdie
Currently the original prefile and postfile passed when starting bitbake server are 'sticky'. With the new memory resident model this doesn't make sense as the server the system is started with isn't special. This patch changes the code so the prefile/postfile are used if specified on the commandline and not used otherwise. This makes the behaviour much more predictable and expected and as an added bonus simplifies the code. (Bitbake rev: 638d366234fad78f283d3a13a12b07cb0ccbe914) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: cooker: Handle datastore tracking for showEnvironment server side onlyRichard Purdie
The current passing of "tracking" backwards and forwards, client to server is ugly and complex and error prone. Instead, set this during showEnvironment commands triggering a reset there if/as required. (Bitbake rev: 9dc7f384db0479569ff93a76a623d5395fecaf47) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31bitbake: prserv/cooker: Drop unused paramRichard Purdie
Drop pointless unused function parameter. (Bitbake rev: 8104b33656de0b619943bd7a9884eb650ccafbf4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-13bitbake: cooker: Ignore common bitbake files for the parse cache invalidationRichard Purdie
Writes to the cookerdaemon log and/or the lockfile were meaning the parser cache was always being invalidated and reparsed. This is unnecessary so spot accesses to these two common cases and ignore the files from a reparse perspective. This doesn't remove many sources of reparse but does improve several common cases. (Bitbake rev: 218e4b6418992588312b8ef5949b84ef43263d1a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-13bitbake: cooker: Improve inotify overflow handlingRichard Purdie
Add a proper function for clearing the mtime cache. Clean up the inotify event overflow case to err on the side of caution and clear any potentially now out of sync caches. (Bitbake rev: ec60459fe2ba16966544eebff43b061abb7ed3ba) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-13bitbake: cooker: Ensure we handle inotify before running the next commandRichard Purdie
The inotify watch events are handled "at idle" which could in theory mean a command could run before any preceeding inotify events have been processed. This leads to a theoretical race window where those events may have a signficicant effect on the command. Add a mechanism to allow us to ensure all pending events are processed before running commands. (Bitbake rev: bf76cd7e5881adf264b8ba64e27a5b6ca9df4fde) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-13bitbake: cooker: Track directories searched for bbappend/bb filesRichard Purdie
Some of the directories searched by BBFILES are not currently being added to the inotify watch list. This can mean that added append files are not noticed leading to misleading metadata results when using BB_SERVER_TIMEOUT != 0. We use glob to expand the BBFILES references and without writing our own implentation, figuring out the directories it searches is hard. We use some horrible hacks here to intecept the listdir calls, I'm open to better ways to handle this but this does ensure we have the right watches set. (Bitbake rev: 4d508d35a224e3a25d2d59c8415ab7985964b14f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-13bitbake: cooker/siggen: Reset siggen when reparsingRichard Purdie
If we don't do this, we get basehash mismatch errors occurring from the reparse which would then set bitbake's error exit code. This for example would cause oe-selftest -r bbtests.BitbakeTests.test_bbappend_order to fail with a non-zero BB_SERVER_TIMEOUT. (Bitbake rev: e4c6ca9440f63761560b49bbe12654441f54687e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-03bitbake: cooker: Ensure all tasks are shown in task dependency treeRichard Purdie
"bitbake -g m4-native -c do_unpack" doesn't list any dependencies in task-depends.dot. This is because no header describing the task was added unless a task has dependencies. Tweak the code to fix this. [YOCTO #10893] (Bitbake rev: e2fbe728769f09ef4178e2ef4d69a2f60ffe3ebb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>