summaryrefslogtreecommitdiffstats
path: root/bitbake
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: cooker: list all nonexistent bblayer directoriesOleksandr Kravchuk2019-06-181-3/+13
| | | | | | | | | | | | | Check existence of all the bblayer direcotories at once and print them all, so if there are multiple nonexistent directories, user does not have to correct bblayers.conf and restart bitbake multiple times. [YOCTO #11647] (Bitbake rev: 19291f7c4d17086ebb6a7b80c3cb06333d7fd55b) Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Ensure mcdeps are processed even if only one multiconfigRichard Purdie2019-06-111-1/+5
| | | | | | | | | 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>
* bitbake: build: implement custom progress handlers injected via OE_EXTRA_IMPORTSChris Laplante2019-06-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | A separate patch to base.bbclass (in poky) will add the OE_EXTRA_IMPORTS variable. The contents are appended into OE_IMPORTS. This provides a mechanism by which layers (in their layer.conf) can make custom progress handlers available. As a backup, individual recipes can inject progress handlers into __builtins__. Custom handlers are expected to have this __init__ signature: def __init__(self, d, outfile=None, otherargs=None): Recipes can then use the handlers like this: do_task[progress] = "custom:mylayer.util.ProgressHandler[:args]" The last part (everything after and including the second colon) is optional. If provided, it is passed to HandlerClass's __init__ as otherargs="args". Otherwise, otherargs=None. (Bitbake rev: 20289d62c84c393990dd3deb0cca1b17c09092e6) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build/progress: use context managers for progress handlersChris Laplante2019-06-112-5/+42
| | | | | | | | | | | It seems context management support was half-implemented, but never finished. For example, LogTee has __enter__ and __exit__ but they haven't been exercised until now. (Bitbake rev: bf522ad3e0c52cdb69b406226840d870ff4f2766) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build: extract progress handler creation logic into its own methodChris Laplante2019-06-111-11/+16
| | | | | | | (Bitbake rev: a841efa50d3aaf7c57446806327b2b687371cb29) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: allow progress rate for indeterminate barsChris Laplante2019-06-111-1/+1
| | | | | | | (Bitbake rev: 85f0b443b7ab1848abc6eb658be489fc1718004c) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Add compability handling for multiconfig: prefix migrationRichard Purdie2019-06-101-0/+3
| | | | | | | | | | 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>
* bitbake: multiconfig: Switch from 'multiconfig' -> 'mc'Richard Purdie2019-06-105-24/+24
| | | | | | | | | | | | | | 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>
* bitbake: toaster: Fix Thud Bitbake release metadataDavid Reyna2019-06-102-2/+2
| | | | | | | | | | | Fix the Bitbake version ID for Thud (1.40). [YOCTO #13356] (Bitbake rev: 7d0ab11a0d1a2510515d7ebab66b922fbfc411c3) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: runfetchcmd(): unset _PYTHON_SYSCONFIGDATA_NAMEMatthias Schiffer2019-05-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since warrior, python3native.bbclass sets _PYTHON_SYSCONFIGDATA_NAME; unfortunately, this also affects Python scripts run as fetch commands like git-make-shallow, breaking it with a message like Failed to import the site module Traceback (most recent call last): File "/usr/lib/python3.6/site.py", line 570, in <module> main() File "/usr/lib/python3.6/site.py", line 556, in main known_paths = addusersitepackages(known_paths) File "/usr/lib/python3.6/site.py", line 288, in addusersitepackages user_site = getusersitepackages() File "/usr/lib/python3.6/site.py", line 264, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/usr/lib/python3.6/site.py", line 254, in getuserbase USER_BASE = get_config_var('userbase') File "/usr/lib/python3.6/sysconfig.py", line 607, in get_config_var return get_config_vars().get(name) File "/usr/lib/python3.6/sysconfig.py", line 550, in get_config_vars _init_posix(_CONFIG_VARS) File "/usr/lib/python3.6/sysconfig.py", line 421, in _init_posix _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) ModuleNotFoundError: No module named '_sysconfigdata' on an Ubuntu 18.04 system (and likely others) when building with BB_GIT_SHALLOW and BB_GENERATE_SHALLOW_TARBALLS. Unset _PYTHON_SYSCONFIGDATA_NAME in runfetchcmd() to work around this. (Bitbake rev: d94ccd506d04aff182ab48f501f6f366d5dd14f5) Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: main: Fix error message typoRichard Purdie2019-05-301-1/+1
| | | | | | (Bitbake rev: a1330b8a15a3f12516e3e293ffb5d840f362375d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Show base multiconfig environmentJoshua Watt2019-05-301-10/+21
| | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: cooker: Rename __depends in all multiconfigsJoshua Watt2019-05-301-2/+3
| | | | | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: fetch2/npm: fix npw view parsingJean-Marie LEMETAYER2019-05-211-14/+5
| | | | | | | | | | | | | | | | | Fixes [YOCTO #13344] When parsing manually the 'npm view --json' ouput, an extra closing brackets in a JSON string can leads the fetcher to fail with a JSONDecodeError exception. This commit use the JSON parser to extract: - The last object in the returned array if there are multiple results. - The returned object if there is only one result. (Bitbake rev: 3d319c79981811d3cfd4732885057db4fd5afcc2) Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: svn.py: Stop SVN from directly pulling from an external layer w/o ↵Mark Hatle2019-05-212-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | fetcher Add a new option to the svn fetcher url "externals=allowed". This will allow a user to enable svn co w/ externals. However, this does avoid the fetcher, network access and mirror systems. By default we no longer allow externals in the checkout. This ensures a deterministic download. The system does attempt to identify SVN repos that have externals enabled, and will warn the user. It is up to the user to determine if these are necessary for the recipe. They may disable the warning by adding "externals=nowarn" to the url. In the future we would like to parse this list and see if the items are already in the SRC_URI for that recipe, but with SVN being in limited use these days that extra work is likely not worth the trouble. Add test cases that generated a local SVN tree, with an external source set to github bitbake in svn format. One test case checks that externals are ignored, and one checks that they in downloaded. (Bitbake rev: bf53f07c3647e57d8452a7743a2b04bcb72c80d6) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: gitsm: Fix a bug where the wrong path was used for the submodule initMark Hatle2019-05-162-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we are trying to avoid network activity and use our own fetcher, the system emulates the behavior of 'git submodule init'. git submodule init uses the .gitmodules file, where typically the module name and path are the same. However, in this case the module name and path (in the tree) were different. i.e.: [submodule "edgelet/hsm-sys/azure-iot-hsm-c/deps/azure-c-shared-utility"] path = edgelet/hsm-sys/azure-iot-hsm-c/deps/c-shared url = https://github.com/Azure/azure-c-shared-utility.git Previously the code assumed the 'path' was both the checkout location under .git/modules, as well as the path to extract the components. This proved to be incorrect as the .git/modules path needs to match the submodule 'name'. This causes the components that were fetched to be initialized in the wrong location, which later caused the 'git submodule update' process to skip not properly initialized modules. A test case was added for this specific case to ensure a regression does not appear in the future. (Bitbake rev: fd27ab60d33553dba13de39394edaaac04e446b3) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake-user-manual: Added npm to other fetcher list.Scott Rifenbark2019-05-151-5/+8
| | | | | | | | | Fixes [YOCTO #10098] (Bitbake rev: 5fb0fb71ae5bda647c45f07aac63084575ed6b39) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: HEADER: Drop itRichard Purdie2019-05-041-5/+0
| | | | | | | | We don't really need a header boilerplate now the header is simplified, drop it. (Bitbake rev: 9b4a9e5459db5f443fcffbdc499e12f09970e709) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Strip old editor directives from file headersRichard Purdie2019-05-04101-220/+0
| | | | | | | | | | 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>
* bitbake: bitbake: Drop duplicate license boilerplace textRichard Purdie2019-05-04136-1679/+7
| | | | | | | | | | 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>
* bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie2019-05-04177-60/+454
| | | | | | | | | | | | | | | | | 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>
* bitbake: build: Disable warning about dependent tasks for nowRichard Purdie2019-05-012-3/+3
| | | | | | | | | This breaks with rm_work so disable the warning until we find a better solution (and change the test accordingly too). (Bitbake rev: 93e94c06baf013e3d072465a55bddd1fe61c0772) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build: Ensure warning for invalid task dependencies is usefulRichard Purdie2019-05-012-2/+2
| | | | | | | | | | | | WARNING: elfutils: dependent task do_rm_work does not exist is much less useful than WARNING: elfutils: dependent task do_rm_work for do_deploy does not exist (Bitbake rev: e034c6f75e3d7730ff16a8d1bd0cba03beda0af8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: Implement console 'keepalive' outputRichard Purdie2019-05-011-0/+13
| | | | | | | | | | | CI systems like jenkins and buildbot will timeout applications which haven't had console output in some period of time. Add 'keepalive' output to knotty which gives output every 5000s if not other output was made and tasks are still running. This reduces some problems encountered with our CI testing. (Bitbake rev: aa4f31e5741dd98acec73f16f6028e52f4c22d6f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: knotty: Pretty print task elapsed timeJacob Kroon2019-04-301-1/+13
| | | | | | | | | | A task's runtime is currently printed in seconds. Change it to include minutes and hours for easier reading. (Bitbake rev: c593ae5ec9fecd4bde823948024e4d56314a60ce) Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build: Add verbnote to shell log commandsStefan Kral2019-04-301-0/+2
| | | | | | | | Add the missing bbverbnote fifo cmd for logging from shell. (Bitbake rev: cf11fdb30c405e1a4521a7299f84816c0e13a881) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/parse.py: Add testcase for addtask and deltaskRobert Yang2019-04-301-0/+18
| | | | | | | (Bitbake rev: 4ac388646624e08bef848b560fa52deacf2ff4fb) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build.py: check dependendent task for addtaskRobert Yang2019-04-301-0/+3
| | | | | | | | | | | | | | | | | The following command is incorrect, but was ignored silently, that may suprise users: addtask task after task_not_existed This patch can check and warn for it. It would be better to also check "before" tasks, but there is no easier way to do it. [YOCTO #13282] (Bitbake rev: b1ad36169c2ad189d84c53c707b66c12d5ff812f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: BBHandler: Fix addtask and deltaskRobert Yang2019-04-301-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The following commands are not supported, but they were ignored silently, that may suprise users: * addtask task1 task2 task2 is ignored * addtask task1 before task2 before task3 Should be: addtask task1 before task2 task3 * addtask task1 after task2 after task3 Should be: addtask task1 after task2 task3 * deltask task1 task2 task2 is ignore This patch can check and warn for them. [YOCTO #13282] (Bitbake rev: 675689aa7cc7287efecf8ef775ca2059369167f1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch2/git: git-lfs checkNaveen Saini2019-04-291-0/+25
| | | | | | | | | | | | Build will fail if repository has lfs contents in absense of git-lfs tool on host. Build will pass if repository may or may not contains lfs content if host has git-lfs installed. [YOCTO #13198] (Bitbake rev: 3f2c2eb2f59707828bdcdd6414db837da8dc3b0e) Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb: siggen: Print more info when basehash are mis-matchedRobert Yang2019-04-231-0/+6
| | | | | | | | | This is useful for debugging. (Bitbake rev: 07b6054b32b37375e2de4b1276bf6fe3f9ad0b04) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb: siggen: Make dump_sigfile and compare_sigfiles print uuid4Robert Yang2019-04-231-1/+9
| | | | | | | | | | | | | | | | | | | | | This can make people easier to understand bitbake-diffsigs/dumpsig's output, otherwise, it's hard to know it is a random uuid unless look into the code. E.g.: $ bitbake bc-native -ccleansstate -Snone $ bitbake bc-native -ccleansstate -Snone $ bitbake-diffsigs tmp/stamps/x86_64-linux/bc-native/1.07.1-r0.do_cleansstate.sigdata.* * Before: Taint (by forced/invalidated task) changed from nostamp:fe79d162-c4a8-4174-8007-f6d4aa09abdc to nostamp:28192187-5021-40c1-9e21-45483b62c910 * Now: Taint (by forced/invalidated task) changed from nostamp(uuid4):fe79d162-c4a8-4174-8007-f6d4aa09abdc to nostamp(uuid4):28192187-5021-40c1-9e21-45483b62c910 (Bitbake rev: 724b4a5cec8c611d53350f3e5a3988ec3222684b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake-diffsigs: Use 4 spaces as indent for recursecbRobert Yang2019-04-232-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | It used 2 spaces as indent which wasn't clear enough, and might cause confusions, people might think it was in wrong format. Fixed: $ bitbake bc-native -ccleansstate -Snone $ bitbake bc-native -ccleansstate -Snone $ bitbake-diffsigs tmp/stamps/x86_64-linux/bc-native/1.07.1-r0.do_cleansstate.sigdata.* * Before: Hash for dependent task bc/bc_1.07.1.bb.do_clean:virtual:native changed from [foo] Taint (by forced/invalidated task) changed from [foo] Taint (by forced/invalidated task) changed from [foo] * Now Hash for dependent task bc/bc_1.07.1.bb.do_clean:virtual:native changed from [foo] Taint (by forced/invalidated task) changed from [foo] Taint (by forced/invalidated task) changed from [foo] (Bitbake rev: 5127a8d8e6d53f5f43a6ada7fd09b6b0c24ae989) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: update to WarriorDavid Reyna2019-04-232-15/+15
| | | | | | | | | | | Update the fixture files to add Warrior and remove Sumo. [YOCTO #13287] (Bitbake rev: 7dbcab1a0dd9d9e13f968e0b4d78deb2adcc4c23) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake-user-manual: Added section on modifying variablesScott Rifenbark2019-04-231-0/+72
| | | | | | | | | | | | | Fixes [YOCTO #12548] I created a new section titled "Modifying Variable Values" that provides instruction on how to use the "bitbake -e" command to be sure your configuration and variable values are as expected. (Bitbake rev: 5a697957d7687fe2c730896e178f7e1e054fe724) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: poky.ent: Removed "ECLIPSE" entity variables.Scott Rifenbark2019-04-121-8/+0
| | | | | | | | | | | | | These have never been used in the BB manual and were an artifact from copy-and-pasting the poky.ent file from the main yocto-docs repo to this bb repo when the BB manual was origially created. They are useless. I have removed them. (Bitbake rev: 3aaf8d6569beeee35ef9dc5021c4b1c2b6db7266) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Post release version bumnp to 1.43Richard Purdie2019-04-122-2/+2
| | | | | | (Bitbake rev: aae15f3c16fb463962eee100a8b0bcd5fc01ad96) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update version to 1.42.0Richard Purdie2019-04-122-2/+2
| | | | | | (Bitbake rev: 00b133af009f9e7c1a4c751b6ef4902f47a81fe2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils: Let mkdirhier fail if existing path is not a folderAndre Rosa2019-04-121-1/+1
| | | | | | | | | | Let mkdirhier fail if existing path is not a folder instead of assuming a directory hierarchy already exists. (Bitbake rev: a8d9b82ccf93dcb74258693f62d88be380b1c0b7) Signed-off-by: Andre Rosa <andre.rosa@lge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils: Make prune_suffix prune a suffixAndre Rosa2019-04-091-2/+2
| | | | | | | | | | Make prune_suffix prune a suffix instead of replacing a substring that could happen more than once and not only when it ends with it. (Bitbake rev: 57e765e38c6382a9b36d5ee2a6f3fa96ac905b82) Signed-off-by: Andre Rosa <andre.rosa@lge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: gitsm: Add need_update method to determine when we are going to a ↵Mark Hatle2019-04-012-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new SRCREV If the system had previously fetched a source repository for use by gitsm, and then the SRCREV was updated and the new commit already existed, the system would not re-evaluate the submodules and update them accordingly. The cause of this issue was that need_update was being used, unmodified, from the base git fetcher. It did not have any knowledge, nor did it care if we were moving commits and needed to re-evaluate what was happening due to this switch. To fix the issue, during the download process we add all processed (by gitsm) srcrevs to the git config file, as bitbake.srcrev. This allows us to use a new need_update function that not only checks if the git commit is present, but if we have previously processed this commit to ensure all of the submodule components are also present. This approach is used, instead of iterating over the submodules in need_update to avoid a potential race condition that has affected us in the past. The need_update is called only with the parent locking. Any time we need to dive into the submodules, we need to lock, and unlock them, at each stage. This opens the possibility of errors in either the code, or unintended race conditions with rm_work. This issue was discovered by William A. Kennington III <wak@google.com>. The included test case was also written by him, and included unmodified. (Bitbake rev: 30fe86d22c239afa75168cc5eb262b880886ef8a) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Use bb.utils.to_boolean() for BB_NO_NETWORKRobert Yang2019-03-261-2/+2
| | | | | | | | | Make it consistent with BB_FETCH_PREMIRRORONLY. (Bitbake rev: 4c6013f47ef36b03f590c909d7c9a2f50b698620) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Unify BB_FETCH_PREMIRRORONLYRobert Yang2019-03-263-3/+3
| | | | | | | | | | | | | | The fetch2/__init__.py checks whether "BB_FETCH_PREMIRRORONLY" == "1", but fetch2/git.py and hg.py checks whether it is None, this makes it discontinuous, and BB_FETCH_PREMIRRORONLY = "0" doens't work as expected in the later case, so unify it to the previous one. (As BB_NO_NETWORK does). And also use bb.utils.to_boolean() to make them consistent. (Bitbake rev: 85a0d22835588e9ad8ec29d88a8115227e88420c) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Print SCMs list when SRCREV_FORMAT is not setRobert Yang2019-03-241-1/+2
| | | | | | | | | | This makes it easier to debug, especially when multipe SCMs like gitsm, otherwise we don't know why there are multiple SCMs. (Bitbake rev: 313fe5e86b254eadfdead706be4bd7b274d5e3c0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Fix clean to remove clonedirRobert Yang2019-03-241-3/+11
| | | | | | | | | | | | | | | | | | | | | | The localpath is a symlink to clonedir when it is cloned from a mirror, for example: $ bitbake systemtap-native -cfetch $ ls downloads/git2 sourceware.org.git.systemtap.git -> /path/to/downloads/git2/mirror.path.git.sourceware.org.git.systemtap.git mirror.path.git.sourceware.org.git.systemtap.git There are both sourceware.org.git.systemtap.git and mirror.path.git.sourceware.org.git.systemtap.git in DL_DIR/git2, the symlink sourceware.org.git.systemtap.git is created by try_mirror_url(), but do_cleanall" only removed the symlink, didn't remove the real dir mirror.path.git.sourceware.org.git.systemtap.git, this may cause confusions, for example, I assumed that do_cleanall removed everything, but it didn't, and it would the re-used next time when do_fetch. This patch fixes the problem. (Bitbake rev: 452e2200ad2c29dec3753f5f7a8cbc9183ec7dd8) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Fix bbfile_config_priorities when BBFILE_PATTERN is emptyRobert Yang2019-03-241-1/+1
| | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch2: runfetchcmd(): Print workdir in debug messageRobert Yang2019-03-241-1/+4
| | | | | | | | | | | | | | | The workdir is an important message when run git command, for exmample, before the patch: Running git -c core.fsyncobjectfiles=0 branch --contains [snip] We don't know where it is running, now it is: Running 'git -c core.fsyncobjectfiles=0 branch --contains [snip]' in /path/to/git.opensvc.com.multipath-tools..git Which is easier to debug. (Bitbake rev: f25c05b73218d0e8edf2dd63b36bc09e547c5455) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Fix undefined variable issuesRichard Purdie2019-03-191-5/+5
| | | | | | | | | Various refactors have left hanging variables, often in debug messages, hence why they haven't been spotted. Fix them (pylint spotted the issues). (Bitbake rev: e1f252408982a62485bbf874a01fd30a02aeed32) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget: Remove pointless lambda functionRichard Purdie2019-03-191-1/+1
| | | | | | (Bitbake rev: 329986c3f2d98c4cd1a43b725194003575e718d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget: Clean up whitespace/commentsRichard Purdie2019-03-191-19/+13
| | | | | | | | Clean up the whitespace and comments style, keep pylint happy. (Bitbake rev: ee59fdaae68543ade03cacfdbbf14fdc7e469412) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>