summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-03-24build: Tweak exception handling for setscene tasksyocto-3.4.32021-10.3-honister1.52.3Richard Purdie
If an unexpected exception occurs in a setscene task, it is currently hidden from the user and not recorded in any logs. This isn't helpful to debug such failures. Change the code so that even in the "silent" or "quiet" task case (setscene tasks), a warning is shown with the traceback unless it was an "handled" exception. This means the failing function can show it's own warning/error instead if it wants to and then raise a handled event. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 41dcdc61eb40def8c14a42e8d7bb9ce5a34afa57) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-14fetch2: ssh: username and password are optionalDaniel Wagenknecht
Support URLs like ssh://HOST/PATH. They were previously not recognized due to a missing @ sign. Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a2aa18bd27dac8902e52b466cb7118f71367d3dc) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-14utils: Ensure shell function failure in python logging is correctRichard Purdie
If a python function exec_func() calls a shell task, the logging wasn't working correctly in all cases since the exception was turned into a BBHandledException() and the logfile piece was lost which is handled at the top task level. The easiest way to avoid this is to allow the ExecutionError exceptions to be raised to a higher level, we don't need the traceback for them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7cae11f558f9ff5fd05ef23b789aaef92fb5a327) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-14cooker: Improve parsing failure from handled exception usabilityRichard Purdie
When a recipe raises a BBHandledException, it means the error was already shown to the user. Adding an additional one here isn't helpful. What is helpful is to mention that parsing was halted. Tweak the code to do this with improves the messages the user sees and helps understand what happened. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fdf6ebc8b603fcfd3ed7c64baf486a4adabd25be) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-14data_smart: Fix overrides file/line message additionsRichard Purdie
The overrides warning message is meant to show filename and line numbers but the variable names are incorrect and this wasn't working. Fix it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 551c1cb20fc9b9d0dab5d830182c2bf626e72845) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-14contrib: Fix hash server Dockerfile dependenciesDaniel Gomez
When building the Hash Equivalence server Dockerfile, some dependencies are missing in order to run the hash server properly: Traceback errors: Traceback (most recent call last): File "/opt/bbhashserv/bin/bitbake-hashserv", line 61, in <module> ret = main() File "/opt/bbhashserv/bin/bitbake-hashserv", line 54, in main server = hashserv.create_server(args.bind, args.database, upstream=args.upstream, read_only=args.read_only) File "/opt/bbhashserv/lib/hashserv/__init__.py", line 120, in create_server from . import server File "/opt/bbhashserv/lib/hashserv/server.py", line 14, in <module> import bb.asyncrpc ModuleNotFoundError: No module named 'bb' Traceback (most recent call last): File "/opt/bbhashserv/bin/bitbake-hashserv", line 61, in <module> ret = main() File "/opt/bbhashserv/bin/bitbake-hashserv", line 54, in main server = hashserv.create_server(args.bind, args.database, upstream=args.upstream, read_only=args.read_only) File "/opt/bbhashserv/lib/hashserv/__init__.py", line 120, in create_server from . import server File "/opt/bbhashserv/lib/hashserv/server.py", line 14, in <module> import bb.asyncrpc File "/opt/bbhashserv/lib/bb/__init__.py", line 128, in <module> from bb import fetch2 as fetch File "/opt/bbhashserv/lib/bb/fetch2/__init__.py", line 1930, in <module> from . import git File "/opt/bbhashserv/lib/bb/fetch2/git.py", line 70, in <module> import bb.progress File "/opt/bbhashserv/lib/bb/progress.py", line 14, in <module> import bb.build File "/opt/bbhashserv/lib/bb/build.py", line 27, in <module> from bb import data, event, utils File "/opt/bbhashserv/lib/bb/data.py", line 36, in <module> from bb import data_smart File "/opt/bbhashserv/lib/bb/data_smart.py", line 23, in <module> import bb, bb.codeparser File "/opt/bbhashserv/lib/bb/codeparser.py", line 26, in <module> import codegen ModuleNotFoundError: No module named 'codegen' Traceback (most recent call last): File "/opt/bbhashserv/bin/bitbake-hashserv", line 61, in <module> ret = main() File "/opt/bbhashserv/bin/bitbake-hashserv", line 54, in main server = hashserv.create_server(args.bind, args.database, upstream=args.upstream, read_only=args.read_only) File "/opt/bbhashserv/lib/hashserv/__init__.py", line 120, in create_server from . import server File "/opt/bbhashserv/lib/hashserv/server.py", line 14, in <module> import bb.asyncrpc File "/opt/bbhashserv/lib/bb/__init__.py", line 128, in <module> from bb import fetch2 as fetch File "/opt/bbhashserv/lib/bb/fetch2/__init__.py", line 1930, in <module> from . import git File "/opt/bbhashserv/lib/bb/fetch2/git.py", line 70, in <module> import bb.progress File "/opt/bbhashserv/lib/bb/progress.py", line 14, in <module> import bb.build File "/opt/bbhashserv/lib/bb/build.py", line 27, in <module> from bb import data, event, utils File "/opt/bbhashserv/lib/bb/data.py", line 36, in <module> from bb import data_smart File "/opt/bbhashserv/lib/bb/data_smart.py", line 23, in <module> import bb, bb.codeparser File "/opt/bbhashserv/lib/bb/codeparser.py", line 32, in <module> from bb.pysh import pyshyacc, pyshlex File "/opt/bbhashserv/lib/bb/pysh/pyshyacc.py", line 13, in <module> import bb.pysh.pyshlex as pyshlex File "/opt/bbhashserv/lib/bb/pysh/pyshlex.py", line 17, in <module> from ply import lex ModuleNotFoundError: No module named 'ply' Traceback (most recent call last): File "/opt/bbhashserv/bin/bitbake-hashserv", line 61, in <module> ret = main() File "/opt/bbhashserv/bin/bitbake-hashserv", line 54, in main server = hashserv.create_server(args.bind, args.database, upstream=args.upstream, read_only=args.read_only) File "/opt/bbhashserv/lib/hashserv/__init__.py", line 120, in create_server from . import server File "/opt/bbhashserv/lib/hashserv/server.py", line 14, in <module> import bb.asyncrpc File "/opt/bbhashserv/lib/bb/__init__.py", line 128, in <module> from bb import fetch2 as fetch File "/opt/bbhashserv/lib/bb/fetch2/__init__.py", line 1935, in <module> from . import wget File "/opt/bbhashserv/lib/bb/fetch2/wget.py", line 30, in <module> from bs4 import BeautifulSoup ModuleNotFoundError: No module named 'bs4' Signed-off-by: Daniel Gomez <daniel@qtec.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0bd637acfcba5a44230c291889d2a5ff571cb8c6) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-23tests/fetch: Handle upstream master -> main branch changeRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-11utils: Update to use exec_module() instead of load_module()yocto-3.4.22021-10.2-honister1.52.2Richard Purdie
This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 68a18fbcb5959e334cf307d7fa8dc63832edb942) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-28tests/fetch: Drop gnu urls from wget connectivity testRichard Purdie
These urls are no longer adding much to the test coverage but the intermittent network issues connecting to them are painful. Drop the urls. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bdf5739c5d831dc97a7d81568f94a0953c71017f) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-12-28fetch: npm: Use temporary file for empty user configStefan Herbrechtsmeier
Always use a temporary file for the user config 'NPM_CONFIG_USERCONFIG' because npm otherwise failed if configs and npmrc aren't set: double-loading config "/dev/null" as "global", previously loaded as "user" Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9f272ad7f76c1559e745e9af686d0a529f917659) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-12-28fetch: npm: Quote destdir in run chmod commandStefan Herbrechtsmeier
Quote destdir in run chmod command to support special characters in package name and to avoid syntax error for packages like '@(._.)/execute'. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a701dfce3f0e74b4d7c687eeda83fe9c8e7240b1) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-12-28process: Do not mix stderr with stdoutAnton Mikanovich
We should not redirect stderr to stdout if we need to get separated stdout and stderr contents from Popen.communicate() later. Signed-off-by: Anton Mikanovich <amikan@ilbers.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1ecc1d9424877df89fcda2f23c306998998a65ff) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-12-14lib/pyinotify.py: Remove deprecated module asyncoreRobert Yang
When build with nativesdk-python3 (3.10) from buildtools: /path/to/bitbake/lib/pyinotify.py:55: DeprecationWarning: The asyncore module is deprecated. The recommended replacement is asyncio The pyinotify.py's upstream didn't have any update in recent 7 years: https://github.com/seb-m/pyinotify And bitbake doesn't use the asyncore module, so remove the related code. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-12data_smart.py: Skip old override syntax checking for anonymous functionsRobert Yang
Fixed when oe-core's path contians append/prepend/remove, e.g.: /path/to/append_test/oe-core/ Initial a build in any build dirs: $ bitbake -p ERROR: Variable __anon_32__buildarea2_xhou_builds_append_test_layers_oe_core_meta_classes_patch_bbclass contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake. The anonymous fuctions has no names, so skip checking for it to fix the issue. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ebd00330c41c75797529ff38d6a0955b93f05d1b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-24fetch2: Fix url remap issue and add testcaseyocto-3.4.12021-10.1-honister1.52.1Richard Purdie
Using "" as a target for .replace() is a really bad idea as it duplicates the replacement for every character in the string. Add a testcase which triggered this and correct the code to return the correct result. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3af1ecf049d2eed56f6d319dc7df6eb4a3d4eebc) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-24utils: Handle lockfile filenames that are too long for filesystemsRichard Purdie
The fetcher mirror code can go crazy creating lock filenames which exceed the filesystem limits. When this happens, the code will loop/hang. Handle the filename too long exception correctly but also truncate lockfile lengths to under 256 since the worst case situation is lockfile overlap and lack of parallelism. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 63baf3440b16e41ac6601de21ced94a94bdf1509) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-16cooker: Fix task-depends.dot for multiconfig targetsRichard Purdie
The right hand side of dependencies in the task dependency file generated by bitbake -g was missing multiconfig prefixes, corrupting the data. Fix this. [YOCTO #14621] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1d5ca721040c5e39aefa11219f62710de6587701) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-16cooker: Handle parsing results queue raceRichard Purdie
The previous fix introduced a race where the queue might not be empty but all the parser processes have exited. Handle this correctly to avoid occasional errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8e7f2b6500e26610f52d128b48ca0a09bf6fb2cb) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-16cooker: Remove debug code, oops :(Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 19291665fa8b6cc331290f2542af3e8e653203f1) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-16cooker: Handle parse threads disappearing to avoid hangsRichard Purdie
If one of the parse threads disappears during parsing for some reason, bitbake currently hangs. Avoid this (and zombie threads hanging around) by joining() threads which have exited. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc86a533d951d13643ce446533370da804782afc) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12runqueue: Fix runall option handlingRichard Purdie
The previous fix for runall option handling had a small bug in it, it didn't clear the originally processed task list which meant it was running too many tasks. Fix this so the list is reset and rebuild correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 87c9e120897ed04dfc64d4752fc602f9bfcb8645) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12runqueue: Fix runall option task deletion ordering issueRichard Purdie
The runbuild option handling in runqueue was flawed as items deleted from the main task list may be dependencies and hence cause index errors. Rather than modify runtaskentries straight away, compute a new shorted list and use that as an input to the second phase. This avoids the need to add tasks back to the list meaning delcount can be simplifed to a simple counter. The second use case in runonly doen't re-add items so doesn't have this issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3428e3c54eb5cc03ff96f9cee6dc839afee7a419) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12tests/fetch: Update pcre.org address after github changesRichard Purdie
vcs.pcre.org was a redirect to github which we use for subversion testing. With the protocol changes at github and the removal of the redirect, use a direct address for github. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6230ca71eb7eb2a6db162e28a01727d00af5299b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12cooker: check if upstream hash equivalence server is availableJose Quaresma
When the user specify an invalid upstream hash equivalence server in BB_HASHSERVE_UPSTREAM notify the user that we can't connect the server. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit be45aeb9a84f30c28711e87e2d2a4a86320a8d94) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12fetch: Handle mirror user/password replacements correctlyRichard Purdie
Username or password replacements in URIs were being appended rather than replaced in mirror url remapping. Fix this and add a test case. [YOCTO #13823] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 66ad58bb87e5158aced572be4f1d5726bc97fcce) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-12tests/fetch: Update github urlsRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 07fca7e3ab696ba985b3ef86ab9031d688bf2df2) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-11-11fetch/wget: Add timeout for checkstatus calls (30s)Richard Purdie
We had an issue where a webserver serving sstate had filesystem issues so would accept connections but effectively not do anything with them. This causes bitbake to hang whilst processing things like sstate objects inside the checkstatus() calls. It can be replicated by setting up a server like: socat -u TCP4-LISTEN:NNN,fork OPEN:/dev/null and pointing SSTATE_MIRRORS in OE at that address. Adding a timeout to the checkstatus calls of 30s means that whilst the system will pause, it will then continue and not hang entirely. Since there isn't a large transfer here, 30s should be a reasonable response time after which we should fall back to building things ourselves. [YOCTO #13716] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-05Revert "parse/ast: Show errors for append/prepend/remove operators combined ↵Richard Purdie
with +=/.=" This reverts commit ae2b34285f8b3a1a3067c5e9b5d29e32e68c75f1. Accidentally applied to the wrong branch. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-04parse/ast: Show errors for append/prepend/remove operators combined with +=/.=Richard Purdie
Operations like XXX:append += "YYY" are almost always wrong and this is a common mistake made in the metadata. Show warnings for these usages with a view to making it a fatal error eventually. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03fetch2: fix downloadfilename issue with premirrorChen Qi
The following commit to fix [Yocto #13039] causes regression of the behavior of PREMIRRORS. "bitbake: fetch2: fix premirror URI when downloadfilename defined" Take meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.4.0.bb as an example. SRC_URI = "\ http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \ ... " With the above commit, it now tries to fetch 1.4.0.tar.gz instead of freeDiameter-1.4.0.tar.gz. This makes https://downloads.yoctoproject.org/mirror/sources not work for freediameter, as it holds freeDiameter-1.4.0.tar.gz. The commit above tries to avoid fetching from invalid url such as: https://<some_mirror>/1.4.0.tar.gz/freeDiameter-1.4.0.tar.gz. And its solution is to make basename to be 1.4.0.tar.gz, thus causing the regression. This patch fixes the above regression. For Yocto #13039, it now tries to fetch from url: https://<some_mirror>/freeDiameter-1.4.0.tar.gz. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 96c30007dc0b32eee2b15771daec7948bc9bfd97) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03tests/fetch.py: add test case to ensure downloadfilename is used for premirrorChen Qi
Add a test case test_fetch_premirror_use_downloadfilename_to_fetch to ensure that 'downloadfilename' is used when fetching from premirror. Although the other two previous test cases, test_fetch_premirror_specify_downloadfilename_regex_uri and test_fetch_premirror_specify_downloadfilename_specific_uri already implicitly contain such verification, we still need to add a very clear case to ensure no regression. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 20aabc3d53f69949810ecf02295725db947ffef8) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03tests/fetch.py: fix premirror test casesChen Qi
When downloadfilename is specified, it is used to fetch from premirror. So fix the test cases accordingly. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3b4d2e3b5024324058360a2a28f33c34114218d0) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03fetch/git: Handle github dropping git:// supportRichard Purdie
github is dropping support for git protocol in Git urls. Add code to remap this to https in a way that could be used in older bitbake versions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26bitbake-worker: Add debug when unpickle failsRichard Purdie
We occasionally see bitbake-worker failing and from the logs, an unpickle error occurs. Add more debug so we can further debug this next time it fails. [YOCTO #14595] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fe8105cc06beca8240b76ea366a1eff5aa9c5412) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26tests/runqueue: Ensure hashserv exits before deleting filesRichard Purdie
We've seen races where the socket may be gone but the server is still writing out it's database. Handle that case too to avoid cleanup tracebacks. [YOCTO #14440] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b9e4fb843cb9d3a4d4404af093a781fab5520465) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26fetch2/perforce: Fix typoRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-19test/fetch: Update urls to match upstream branch name changesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11bitbake: Bump to version 1.52.0yocto-3.42021-10-honister1.52.0Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11hashserv: Improve behaviour for better determinism/sstate reuseRichard Purdie
We have a choice of policy with hashequivalence - whether to reduce sstate duplication in the sstate feed to a minimum or have maximal sstate reuse from the user's perspective. The challenge is that non-matching outhashes are generated due to determinism issues, or due to differences in host gcc version, architecture and so on and the question is how to reconcile then. The approach before this patch is that any new match is added and matches can update. This has the side effect that a queried value from the server can change due to the replacement and you may not always get the same value from the server. With the client side caching bitbake has, this can be suboptimal and when using the autobuilder sstate feed, it results in poor artefact reuse. This patch switches to the other possible behaviour, once a hash is assigned, it doesn't change. This means some sstate artefacts may be duplicated but dependency chains aren't invalidated which I suspect may give better overall performance. Update the tests to match the new behaviour. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11hashserv: Fix diverging report race conditionJoshua Watt
Fixes the hashequivalence server to resolve the diverging report race error. This error occurs when the same task(hash) is run simultaneous on two different builders, and then the results are reported back but the hashes diverge (e.g. have different outhashes), and one outhash is equivalent to a hash and another is not. If taskhash was not originally in the database, the client will fallback to using the taskhash as the suggested unihash and the server will see reports come in like: taskhash: A unihash: A outhash: B taskhash: C unihash: C outhash: B taskhash: C unihash: C outhash: D Note that the second and third reports are the same taskhash, with diverging outhashes. Taskhash C should be equivalent to taskhash (and unihash) A because they share an outhash B, but the server would not do this when tasks were reported in the order shown. It became clear while trying to fix this that single large table to store all reported hashes was going to make these updates difficult since updating the unihash of all entries would be complex and time consuming. Instead, it makes more sense to split apart the database into two tables: One that maps taskhashes to unihashes and one that maps outhashes to taskhashes. This should hopefully improve the parsing query times as well since they only care about the taskhashes to unihashes table, at the cost of more complex INNER JOIN queries on the lesser used API. Note this change does delete existing hash equivlance data and starts a new database table rather than converting existing data. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11hashserv: Add tests for diverging reportsJoshua Watt
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11async: Close sync client event loopJoshua Watt
Prevents `ResourceWarning: unclosed event loop` warnings when using the synchronous client and python exits Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08bitbake: replace http with https for URLsJon Mason
https has been the preferred way to access websites for many years now. Change all of the URLs with a _working_ https server/certificate to use that URL. Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08bitbake:toaster:test: Update SSTATE URLJon Mason
Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08bitbake-worker: Handle pseudo shutdown in Ctrl+C caseRichard Purdie
If the build is interrupted, handle the shutdown of pseudo even in this case to avoid data corruption inside docker containers. [YOCTO #14555] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08knotty/uihelper: Show setscene task progress in summary outputRichard Purdie
With the changes to task accounting, bitbake doesn't show progress when executing setscene tasks on the summary console output. Change to show a progress within the setscene tasks and a progress within the main tasks. I can't see any way to display this more easily without confusing users. [YOCTO #14586] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08fetch2: npmsw: Add support for local tarball and link sourcesStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08fetch2: npm: Create config npmrc in environment instantiationStefan Herbrechtsmeier
Create a configuration npmrc per npm environment to avoid repeated creation of the same configuration file. Create the file via python to avoid multiple npm config calls and add the ability to pass a file path instead of a temporary file. Deprecate the npm configs argument of the run function. The configs should be passed to npm environment or as command specific arguments. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08fetch2: npm: Support npm archives with missing search directory modeStefan Herbrechtsmeier
Delay directory restore and set execute/search directory mode bits in unpack to support npm archives with a missing search directory mode. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08fetch2/gitsm: remove the 'nugget' SRCREV cachingRoss Burton
The cached revisions which are used to decide if a repository doesn't need to be updated are misleading when used in conjunction with mirror tarballs and can cause partial fetches to happen, resulting in unpack errors as repositories were not fetched. A concrete example: edk2-firmware in meta-arm is at version 202102 (ef91b0). This is built on the autobuilder so the source mirror contains the repository as a mirror tarball. If I build edk2-firmware 202102 the gitsm fetcher will initially download the top-level repository and then iterate into the submodules to also fetch those repositories, including cmocka from cryptomilk.org. edk2-firmware will then unpack and build successfully. I then update edk2-firmware to 202105 (e1999b) and build it. Gitsm.needs_update() starts by calling Git.needs_update() which returns False, as the mirror tarball contains this revision. It then looks at the "nuggets" which are SRCREVs it has fetched before. The mirror tarball itself contains the nugget for e1999b as this has been built on the autobuilder, so needs_update return False, no more fetching is done, and the build proceeds to unpack. However, as part of the 202105 upgrade the URL of the cmocka submodule changed, and this new repository was never fetched. This means that unpack fails as one of the required git repositories isn't available. The nugget codepaths appear to be an attempt at optimising the fetch process, but have demonstratable failure cases. Just removing them entirely solves the edk2-firmware example, and all of the fetcher test cases still pass. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>