summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: fetcher: Fixed remote removal not throwing exception.Paulo Neves2018-10-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix it is assumed that the removal of the remote can only fail because there is not remote to remove. This is a false assumption. Example error which would be ignored: git -c core.fsyncobjectfiles=0 remote rm origin failed with exit code 1, output: Note: A branch outside the refs/remotes/ hierarchy was not removed; to delete it, use: git branch -d master error: could not lock config file config error: Could not remove config section 'remote.origin' Due to the masking of this error a stranger error will be presented to the user, because this time we do not mask the exception: git -c core.fsyncobjectfiles=0 remote add --mirror=fetch origin https://github.com/ptsneves/tl-wn722.git failed with exit code 128, output: fatal: remote origin already exists. The most likely reason that the remote cannot be removed nor modified is that the DL_DIR/git2 does not have permissions compatible with the user running bitbake. This commit fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12728 (Bitbake rev: 67189588a68b9bcb39421ef12103507b4c8820c3) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: main: Fix environment handling for UI module importsRichard Purdie2018-10-101-3/+4
| | | | | | | | | | | | | | | The environment was being cleared before the UI imports occurred which caused problems for graphical UIs like taskexp. The full environment was intended to be available to UI clients and it was only meant to be cleared for the server/cooker, so tweak the code order so this is the case. This fixes problems reported for taskexp. [YOCTO #12670] (Bitbake rev: 66ac33b6888edb7077b6e94a4d3d1e1d1d53c0c5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: Fix bitbake flexible path error from Bugzilla #12891Awais Belal2018-10-041-1/+1
| | | | | | | | | | | | | | | | Commit 15340edce23e63b060c75114d508e1f76757239c introduced a way which allowed bitbake to be found from the PATH variable when directory structures different from poky are used. This just drops a leftover bitbake definition which made the earlier implementation meaningless by reassigning the path relative to oe-core/meta. [YOCTO #12942] (Bitbake rev: 99321236c516277c9d423b1b355bbce1245d9923) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: toaster: Fix comparison in recipe templateKarsten Strand2018-09-101-1/+1
| | | | | | | | | | | | | Use == instead of = when comparing task outcome to OUTCOME_FAILED. Prior to this fix the recipe template would cause a TemplateSyntaxError exception. (Bitbake rev: a53ffec4ed3d0f9221bca398e20e8f480fb2b325) (Bitbake rev: bef6ef1a79b2d5a3688ae845824f722c332d7f19) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/layerdetails.js: don't hide local layer infoAwais Belal2018-09-101-1/+2
| | | | | | | | | | | | | | | | | The local layer info (provided through custom fixtures) should not be hidden. It is better to handle it in the same manner as an imported layer, otherwise the layer path and dependency info is not shown. The layer editing fields are handled in the html side of things appropriately so this does not harm that implementation. [YOCTO #12891] (Bitbake rev: 75918405346abde6055658372c1a954a214001cc) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/models.py: allow local paths for custom recipe's baseAwais Belal2018-09-101-0/+7
| | | | | | | | | | | | | | | In a case where the layer source is local only and the recipe is not yet built, we can search for the path with layer's local_source_dir, and if available that should be used rather than just skipping the scenario. [YOCTO #12891] (Bitbake rev: 30f622dbd874b800c5bbdbeac992dd7783092928) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/checksettings: allow CUSTOM_XML_ONLY setting through envAwais Belal2018-09-101-1/+2
| | | | | | | | | | | | | | | This change allows the CUSTOM_XML_ONLY toaster setting to be provided through the environment so the user can do this without mingling with the settings.xml, for scenarios where modifying settings.xml is not achievable. [YOCTO #12891] (Bitbake rev: 87060a84e74125be10db062da3032e9b01f5dc96) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toastergui/newproject.html: fix release divsAwais Belal2018-09-101-2/+2
| | | | | | | | | | | | | | | | | The release drop down divs are not being closed appropriately, which showed adverse reactions on the UI that aligned the "Create project" button with the left edge of the screen without any margins. This fixes these divs which in turn aligns the button appropriately. [YOCTO #12891] (Bitbake rev: bc6a137f4f8193cadfa8a8d0e43875991d47a818) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster/widgets.py: avoid divide by zero issuesAwais Belal2018-09-101-7/+12
| | | | | | | | | | | | | | | | | There can be cases where the variables being used to divide in build percentage expressions can be zero. For example, a setup consisting of only local repos will have repos_to_clone=0 and will generate a divide by zero scenario. Fix this by checking the divisor in such cases. [YOCTO #12891] (Bitbake rev: 30702f29928c3b088f199bf8b1609b2956f8c47a) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: use a more flexible way to find bitbakeAwais Belal2018-09-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The current mechanism for finding the bitbake binary assumes a directory structure which is identical to poky, where oe-core's meta and bitbake directories are at the same level. There can be a case where bitbake is used from elsewhere and in such cases the above mentioned assumption fails to hold, whereas this is totally allowed by the oe-init-build-env script which can take bitbakedir as an argument. The better approach is to allow bitbake to be derived from PATH, while keeping the older mechanism in place so it can be removed after tests are done in various environments. This makes more sense as toaster has also been launched from the same bitbake instance that is the one in PATH. [YOCTO #12891] (Bitbake rev: 15340edce23e63b060c75114d508e1f76757239c) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: allow pokydirname to be evaluated when all layers are localAwais Belal2018-09-101-3/+15
| | | | | | | | | | | | | | | | | | | | Toaster depends on pokydirname for identifying the location of the oe-init-build-env script (and there might be other purposes in the future). The problem with current approach is that it only checks/sets the variable with git based repos, whereas toaster provides mechanisms to allow having layers that are all locally available. The evaluation of the variable fails in such scenarios, so use a more flexible mechanism in this case and try to locate poky in the local layers as well, if not already set. [YOCTO #12891] (Bitbake rev: 971c728075af05e71edfd8e5212728c3dd0787b6) Signed-off-by: Awais Belal <awais.belal@mentor.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: checksum: sanity check path when recursively checksummingRoss Burton2018-08-291-0/+2
| | | | | | | | | | In case something goes tragically wrong, catch a request to checksum / and refuse. (Bitbake rev: 7444419b7fda34e14d653ba8470f5dfabb5da4f3) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils/md5_file: don't iterate line-by-lineRoss Burton2018-08-291-4/+9
| | | | | | | | | | | | | | | Opening a file in binary mode and iterating it seems like the simple solution but will still break on newlines, which for binary files isn't really useful as the size of the chunks could be huge or tiny. Instead, let's be a bit more clever: we'll be MD5ing lots of files, but we don't want to fill up memory: use mmap() to open the file and read the file in 8k blocks. (Bitbake rev: 41e6161c8ce8cc90ebc93d72852673ae60fac923) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Update gnome.org urls after upstream changesRichard Purdie2018-08-291-2/+2
| | | | | | (Bitbake rev: 822dd77333896538393c657dd220d8f66d8a46a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: fix import error for Python 3.6.5Tzu Hsiang Lin2018-07-022-3/+1
| | | | | | | | | | | | When running bitbake command with Python 3.6.5 always result in import error causing by the change of distutils module. This patch replaces the method to search executable in PATH by "/usr/bin/env <command>". (Bitbake rev: eb3bdcc9e7cb273de4114367887d1d7df9f036b7) Signed-off-by: Tzu Hsiang Lin <t9360341@ntut.org.tw> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update version to stable release branch version 1.38Richard Purdie2018-06-061-1/+1
| | | | | | (Bitbake rev: 6a9d86998fdd42b13690f024af33b6bf36b9d028) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: add 'Sumo' to release selectionDavid Reyna2018-05-042-20/+82
| | | | | | | | | | | Add Sumo (YP-2.5) to the release selection for new projects. [YOCTO #12713] (Bitbake rev: 76b17ffcea5c7275c2f9735a058256ba909b1a75) Signed-off-by: David Reyna <david.reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/utils: prevent movefile from changing dest dir permissionsMattias Hansson2018-04-231-2/+2
| | | | | | | | | | | | | | | Prevent movefile from falsely setting the source file's owner and permissions on the destination directory instead of the destination file when moving between devices. This bug caused the last file moved into a directory to dictate the directory's owner and permissions. (Bitbake rev: 82ea737a0b42a8b53e11c9cde141e9e9c0bd8c40) Signed-off-by: Mattias Hansson <mattias.hansson@axis.com> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cookerdata: Issue warning if layer doesn't set LAYERSERIES_COMPAT_xRichard Purdie2018-04-061-0/+2
| | | | | | | | | | | We'd like layers to set this variable so that we know which layers are compatible with which others, even if the branch is a generic un-updated "master" branch. Start printing a warning to highlight this issue. (Bitbake rev: cca81e33b58c390dcf5cc3a31555a43b79177166) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bb/shell.py: dropPaul Eggleton2018-03-281-820/+0
| | | | | | | | | | | | | | | | This was removed in the bitbake repository back in 2010 (bitbake revision 24857e2ceb405916b0b0b3e75c6c2375a909b9ba) - it's not clear to me what happened, but for some reason the file remained in the poky repository. However it does not appear that it has been used since then and the reasons for removing even more valid now than they were then - the code has moved on even further, we have memory resident bitbake server, and if we were to re-implement this we would do it in a different way. Drop the file and bring us back in sync with the bitbake repo. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: toaster: do not fail on optional 'custom.xml' fileDavid Reyna2018-03-281-1/+4
| | | | | | | | | | | | Explicitly capture and ignore errors when trying to load the optional 'custom.xml' fixture file. [YOCTO #12554] (Bitbake rev: 132458939d3987ebc58685397714af3d6d5cd8fd) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: log exception if ls-remote failsRoss Burton2018-03-281-1/+2
| | | | | | | (Bitbake rev: 8212446de11c0e370c55f88cde86334b760cd939) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: state which upstream failedRoss Burton2018-03-281-2/+2
| | | | | | | (Bitbake rev: 21098de09ee2f7a9f0b3f895bf2ffbdeb8c9ded5) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: utils.py: Add option for explode_dep_versions2 to return unsortedAmanda Brindle2018-03-151-2/+3
| | | | | | | | | | | | Before, explode_dep_versions2 would sort the OrderedDict before returning. This function will still sort the OrderedDict by default, but will now have the option to return the OrderedDict unsorted. This option will allow us to check if the order of the package list has changed. (Bitbake rev: 39d6a30a28f66c599e18beddbd847f40dcff623c) Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Fix environment double key expansion issueRichard Purdie2018-03-041-3/+2
| | | | | | | | | | | 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>
* bitbake: cooker: Run registered anonymous python before displaying environmentRichard Purdie2018-03-041-1/+3
| | | | | | | | | | | 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>
* bitbake: parse/ast: Abstract anonymous function execution into a functionRichard Purdie2018-03-041-4/+7
| | | | | | | | | This allows us to call this code from other contexts without duplicating it. (Bitbake rev: c6be487f9bd5d95915f2495d555b9f539adb1d44) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Ensure only recursive task dependencies are prunedRichard Purdie2018-03-011-1/+1
| | | | | | | | | | | | | If a standalone tasks adds a dependency on X:do_build, the code in runqueue would currently remove it if that do_build was part of an image recipe which uses recrdeptask on do_build. Such individual tasks shouldn't do this, therefore tweak the recursive reference code to only process recurseive tasks, not all tasks. (Bitbake rev: 4cfca360891e1ed876a9c19487b4f6210686af26) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: toaster: don't use git fetch --allRobert Yang2018-02-141-1/+1
| | | | | | | | | | | The '--all'' fetches all remotes, including the ones in $HOME/.gitconfig, which causes the fetching very slow, so don't use "--all", git fetch should be enough. (Bitbake rev: 038a5f4b767df7944e73b2e859ac3af2d3a08bf1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Handle missing donestamp file when content is validNathan Rossi2018-02-142-11/+114
| | | | | | | | | | | | | | | | | | | | | | | | In order to allow users to manually populate the download directory with valid content change the assumption that missing the donestamp file means unfetched content. This allows users to populate the download dir without needing to create dummy .done files such that a user does not need a PREMIRROR when using BB_NO_NETWORK to provide valid content files in the download directory. To ensure the correct result this change also fails first if the localpath does not exist. This prevents further parts of the function attempting to calculating the checksum on non-existent files. This also fixes some edge conditions around where if the donestamp exists but the localpath does not it returns, and did not remove the donestamp. Also added test cases to cover this use case and additional use cases where for example the fetcher does not support checksums. (Bitbake rev: a335dbbb65d5b56e71d98cf3e4fa9bfbec1dcde6) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm.py: Fix inverted condition to prevent infinite loopBöszörményi Zoltán2018-02-141-3/+5
| | | | | | | | | | | | | | | At least the cli-color node module has dependencies that have cyclic dependency among themselves. npm.py is prepared to deal with such a case but the condition is handled only for downloading or not a dependency again, but then it goes checking the its dependency which causes an infinite loop in _getdependencies(). Make this function simply return when a dependency is already downloaded and only download and check its dependencies when not. (Bitbake rev: 545540420112992e53f4a83104af10452df168d0) Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: parse: fixes for resolve_file()Robert Yang2018-02-143-7/+2
| | | | | | | | | | The resolve_file() calls mark_dependency(), so the one which calls resolve_file() doesn't need call mark_dependency() again. (Bitbake rev: 4682571107323a39b42cd9ec8ee67419e7f15acc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: cache: improve debug messageRobert Yang2018-02-141-1/+4
| | | | | | | | | | | | | * Print message when cachefile is found/not can help debug. * Update "Using cache in" to "Cache dir:" since it was the same as the debug message of "codeparser & file checksum caches", which caused confusion. And whether the cache file will be used or not is still unknown at that time, so just print the cache dir. (Bitbake rev: c8d3a2016f432e8ed9e99d9c28850149ab6fd6d8) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: cooker: don't stop file notifier when cooker is shutdownRobert Yang2018-02-142-2/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: cooker: fix for BBFILE_PATTERN matches bbappendRobert Yang2018-02-141-3/+7
| | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: cooker: skip when BBFILE_PATTERN is emptyRobert Yang2018-02-141-0/+1
| | | | | | | | | 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>
* bitbake: fetch/git: Use 'git-make-shallow' from bin directoryNathan Rossi2018-02-142-5/+5
| | | | | | | | | | | | | | Move the code that existed in tests/fetch.py for determining the path to 'git-make-shallow' into the git module and reference it. This ensures that 'git-make-shallow' is always available and the desired version regardless of the path variable or whether git exposes the command. (Bitbake rev: 6b508ab8fd5aa796c1c00c970e81e5e93f84d35d) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: main/runqueue: Rework runall task and add runonly optionRichard Purdie2018-02-143-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | The runall commandline option was confusing people. There are in fact two different behaviours people may want. a) For a given target (or set of targets) look through the task graph and run task X only if its present and would have been built. b) For a given target (or set of targets) look through the task graph and run task X if any recipe in the taskgraph has such a target even if it wasn't in the original task graph. I've decided to interpret the existing "runall" option as b), even if right now if behaves like a). For a), which is a valid use case, this patch adds a "runonly" option. With both behaviours present, I'm hoping we can then kill off the "fetchall", "checkuriall" and other tasks from OE metadata and replace them with this option. This would significantly speed up task graph processing. (Deleting the checkuriall and fetchall tasks takes "bitbake core-image-sato -g" from 22s to 8s). (Bitbake rev: 546a662c877b2d3af35e3996950582ed2df41fe4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Rewrite and optimize recrdepends handlingRichard Purdie2018-02-061-51/+83
| | | | | | | | | | | | | | | | | | This is a performance sensitive piece of code and the shear number of recursive loops is causing a significant and unscalable performance pain point. This change moves to a two step approach, firstly generating a list of recursive dependencies for any task, then applying this to the recursive tasks, iterating over things until no further dependencies are added. It was noticed an optimisation is possible and the list of recursive tasks need not contain the taskname, only the base task id. This allows a significant performance improvement and limits the size of the resursive task lists, improving speed. (Bitbake rev: eba738ac5672556eaab4f3374c8025c322761c4a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Optimize recrdepends handlingRichard Purdie2018-02-061-10/+13
| | | | | | | | | | | | | | | | We can optimise the loops slightly so we only process given substrings once rather than many times. This means expanding out add_resolved_dependencies. Also add a function which allows replacement of the task element of a task id, reducing the amount of string handling we're doing in a performance critical loop. Its also clear that later code adds to the tasks depends so we don't need to add .depends() to extradeps at the start. (Bitbake rev: 4ad281224e92b5f94e3a9c17e8898ec8f1086cdc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Remove unused variablesRichard Purdie2018-02-061-2/+0
| | | | | | (Bitbake rev: 7e56c285f5ebae9b4b367514e60e3a6ba8cd5693) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Fix recidepends handlingRichard Purdie2018-02-061-41/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we only run through the recidepends/recrdepends code once. This means that we can miss some expansions of dependency trees where one rec{r,i}depends tasks depends on another rec{r,i}depends task. In reality we need to iterate over the data until we stop adding dependencies. In doing this we can't show quite so granular progress information since we don't know how many times we'll need to do this. This does slow down the runqueue prepare phase however some optimisations are possible and can be handled in subsequent patches. This fix means some missing dependencies, such as: <image>:do_fetchall -> <image>:do_rootfs -> <pkgs>:do_package_write_X -> <ca-certs>:do_package_write_X -> debianutils-native (via PAKAGE_WRITE_DEPS) are now found/added. [YOCTO #12510] (Bitbake rev: aec2f07d56a19b97b6515897532b113cdead8338) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Add pack-refs command to mirror handling codeRichard Purdie2018-01-291-0/+1
| | | | | | | | | | | | | We've noticed issues on our infrastucture iterating over the many tag/branch/head reference files that some git repositories may contain. By issuing the pack-refs command, we move these all to a single file which speeds up operations with the mirror repos in the downloads directory in general. (Bitbake rev: f8126aaf774186a6eaf0bd4067b89c074594886c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cooker: Sort task graph (dot) file outputRichard Purdie2018-01-291-6/+6
| | | | | | | | | 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>
* bitbake: fetch2/__init__: Disable pseudo in runfetchcmd()Peter Kjellerstedt2018-01-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a fetcher, e.g., git, is run when pseudo is active it will think it is running as root. If it in turn uses ssh (as git does), ssh too will think it is running as root. This will cause it to try to read root's ssh configuration from /root/.ssh which will fail. If ssh then needs to ask for credentials it will hang indefinitely as there is nowhere for it to ask the user for them (and even if there was it would not access the correct private keys). The solution to the above is to temporarily disable pseudo while executing any fetcher commands. There should be no reason for them to be executed under pseudo anyway so this should not be a problem. RP Ammendum: We finally did get more information about how to reproduce this problem, something needs to trigger bb.fetch2.get_srcrev() in a pseudo context, for example when AUTOREV is in use or the recipe doesn't have a defined SRCREV. That SRC_URI needs to be using protocol=ssh. This would trigger an ls-remote of the remote repo and if that happens under pseudo, the wrong ssh credentials may be attempted which can hang. [YOCTO #12464] (Bitbake rev: ceaca281cafa662aa2385b95641bce309dce843d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: events: Drop unused cfg propertyRichard Purdie2018-01-081-9/+0
| | | | | | | | | The cfg property on events doesn't add much, all code appears to access "data" at this point. Remove it to clean up the interface. (Bitbake rev: bd4b9e4460b60f142c3bf346fb04e360e512eaee) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/fetch: Allow bit/bitbake-selftest to function correctlyRichard Purdie2018-01-071-1/+1
| | | | | | | | | Without this the paths to git-make-shallow are incorrect and cause test failures if bitbake isn't executed from cwd or PATH. (Bitbake rev: 643eacb162b8710330ef292bfda21cfeab97f95c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/event: tests: Add event classes test classJair Gonzalez2018-01-071-0/+499
| | | | | | | | | | | | | This change adds EventClassesTest class to bb/tests/event.py, including 47 new test cases for the public interfaces of the bitbake event and related helper classes. [YOCTO #10773] (Bitbake rev: ee5fe4431713b8a29bdb424a29460965374b3234) Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/event: Remove empty assignments from event testsJair Gonzalez2018-01-071-4/+4
| | | | | | | | | Remove assignments from non-returning calls. (Bitbake rev: a8cac827dd15227a3940ea25c673d91b5e2c2a75) Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: tests/event: Add test for bb.event.worker_fireJair Gonzalez2018-01-071-0/+8
| | | | | | | | | Test the triggering of bb.event.worker_fire callback. (Bitbake rev: daa59a2057c811b20d75235526ac6c2079ac6e10) Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>