summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2021-01-21fetch2: handle empty elements in _param_str_splitRoss Burton
_param_str_split is used to split ?foo=1;bar=2 into a dictionary, but throws an exception if a lone semicolon is used as the value doesn't split into two items. Fix by checking that the result of the first split has content. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-21fetch2/perforce: Fix localfile to include ud.moduleRichard Purdie
As reported by Katu Txakur, the output depends on the module path set so this needs to be accounted for in localfile. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-21fetch2/wget: Update user-agentChristophe Priouzeau
With the usage of enterprise proxy, the user-agent defined are too old and refused by proxy configuration. Updating to something more modern is desirable. Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-05fetch/git: Fix usehead for non-default namesJoey Degges
The usehead url parameter for git repositories causes bitbake to use whatever commit the repository HEAD is pointing to if the repository happens to have the name 'default'. This is the default name so in many cases it works just fine, but if a different name is specified with the url parameter 'name=newName' then it will fail to parse the recipe with an error along the lines of: ERROR: ExpansionError during parsing /path/to/my/recipe.bb Traceback (most recent call last): File "/path/to/poky/bitbake/lib/bb/fetch2/git.py", line 235, in Git.urldata_init: > ud.setup_revisions(d) File "/path/to/poky/bitbake/lib/bb/fetch2/__init__.py", line 1302, in FetchData.setup_revisions: for name in self.names: > self.revisions[name] = srcrev_internal_helper(self, d, name) File "/path/to/poky/bitbake/lib/bb/fetch2/__init__.py", line 1167, in srcrev_internal_helper(name='newName'): if srcrev == "AUTOINC": > srcrev = ud.method.latest_revision(ud, d, name) File "/path/to/poky/bitbake/lib/bb/fetch2/__init__.py", line 1562, in Git.latest_revision(name='newName'): except KeyError: > revs[key] = rev = self._latest_revision(ud, d, name) return rev File "/path/to/poky/bitbake/lib/bb/fetch2/git.py", line 650, in Git._latest_revision(name='newName'): raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \ > (ud.unresolvedrev[name], ud.host+ud.path)) bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Unable to resolve 'master' in upstream git repository in git ls-remote output for /path/to/local/git/repo Let's fix this by setting the unresolved rev of _all_ repository names to 'HEAD' when the usehead url parameter is specified. Update the currently failing test, test_local_gitfetch_usehead_withname, to now expect success. This change preserves existing behavior that allows usehead to be overridden by a valid looking revision if one happens to be specified instead of AUTOREV. Signed-off-by: Joey Degges <jdegges@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-05tests/fetch: Test usehead with a non-default nameJoey Degges
Add tests for fetching a URL with the usehead parameter set and a non-default name set. We currently expect the local version of this test to fail since there is a bug in the usehead implementation that breaks for non-default names. Signed-off-by: Joey Degges <jdegges@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-05tests/fetch: Document behavior of test_gitfetch_useheadJoey Degges
The test `test_gitfetch_usehead' exercises a way to override the usehead feature by setting SRCREV. It may not be obvious that this is what is being exercised here so let's add some comments to document the expected behavior. Signed-off-by: Joey Degges <jdegges@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-05tests/fetch: Organize usehead tests by net requirementsJoey Degges
Move the local only usehead test to the FetcherLocalTest class so it will be run when BB_SKIP_NETTESTS=yes since it does not require network access. Rename the usehead tests to better match the new organization. Signed-off-by: Joey Degges <jdegges@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-05utils: add docstrings to functionsMilan Shah
A list of functions that now has a docstring. * vercmp_string * explode_dep_versions * prunedir * prune_suffix * to_boolean * contains_any * export_proxies See [YOCTO #9725] for details. Signed-off-by: Milan Shah <mshah@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-21cooker: Include all packages a recipe provides in SkippedPackage.rprovidesPeter Kjellerstedt
The provided packages by a skipped recipe are supposed to be listed in SkippedPackage.rprovides, which is used when generating a meaningful error message when a build fails because of a skipped package. Previously this variable only contained the contents of ${RPROVIDES}. However, most recipes don't define RPROVIDES, they define RPROVIDES_<pkg> for each package they provide. Additionally, the recipe provides the packages in PACKAGES without them being included in ${RPROVIDES}. Before this change, having a runtime dependency on a skipped non-recipe package would result in a build error stating that the build failed because the package was skipped, but without providing any reason for why it was skipped. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-21cache: Make CoreRecipeInfo include rprovides_pkg for skipped recipesPeter Kjellerstedt
This will be needed by SkippedPackage in the cooker. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-19data_smart: Ensure hash reflects vardepvalue flags correctlyRichard Purdie
The get_hash() function is used to decide if the base configuration has changed and hence whether a reparse is required. The vardepvalue flag's value was not expanded but it is often used in contexts like: METADATA_REVISION = "${@base_detect_revision(d)}" METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}" which in it's unexpanded form means reparsing doesn't happen when it should as the data appears unchanged. Update get_hash to expand the values of vardepvalue so reparsing works as expected. This avoids basehash mismatch errors such as the one recently caused by using METADATA_REVISION in poky.conf's DISTRO_VERSION variable. The issue there could be exposed by a recipe using DISTRO_VERSION with the sequence: bitbake os-release <change the revision of the metadata with a dummy commit> bitbake os-release -C install which was caused because METADATA_REVISION changed but the metadata didn't reparse. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-10msg: use safe YAML loaderRoss Burton
If using a YAML file in BB_LOGCONFIG, the unsafe loader is used and this causes a runtime warning: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. As log configuration YAML is relatively simple we can just use safe_load(). Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-10hashserv: Fix broken AF_UNIX path length limitJoshua Watt
Fixes the bug were long paths would break Unix domain socket clients (for real this time; the previous attempt was missing os.path.basename). Adds some tests to prevent regressions Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-09Revert "fetch2: use relative symlinks for anything pulled from PREMIRRORS"Richard Purdie
This reverts commit 481e66ea8fc2fc91903127d66b0f1b0fe86baedb. Unfortunately this caused problems where incorrect paths were found in paths and files were not being found. This was reported on the mailing list but no invetigation or resolution was found. Revert until we can figure out what was wrong.
2020-12-03hashserv: client: Fix AF_UNIX path length limitsJoshua Watt
Restores a fix for unix domain socket path length limits when using the synchronous hash equivalence client that was accidentally removed when the async client was added. Unfortunately, it's much more difficult to fix the same problem when using the async client directly due to the interaction of chdir() and async code, but this will at least restore the old behavior in the synchronous case. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-24Revert "bb.ui: delete __init__.py to make bb.ui a namespace package"Hongxu Jia
The commit [991f92b4d bb.ui: delete __init__.py to make bb.ui a namespace package] caused `bitbake -h' failed ... $ bitbake -h Traceback (most recent call last): File "/buildarea/raid5/hjia/community/poky/bitbake/bin/bitbake", line 35, in <module> sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv), File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/cookerdata.py", line 27, in __init__ self.options, targets = self.parseCommandLine(argv or sys.argv) File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 297, in parseCommandLine options, targets = parser.parse_args(argv) File "/usr/lib64/python3.6/optparse.py", line 1387, in parse_args stop = self._process_args(largs, rargs, values) File "/usr/lib64/python3.6/optparse.py", line 1431, in _process_args self._process_short_opts(rargs, values) File "/usr/lib64/python3.6/optparse.py", line 1536, in _process_short_opts option.process(opt, value, values, self) File "/usr/lib64/python3.6/optparse.py", line 785, in process self.action, self.dest, opt, value, values, parser) File "/usr/lib64/python3.6/optparse.py", line 807, in take_action parser.print_help() File "/usr/lib64/python3.6/optparse.py", line 1647, in print_help file.write(self.format_help()) File "/usr/lib64/python3.6/optparse.py", line 1635, in format_help result.append(self.format_option_help(formatter)) File "/usr/lib64/python3.6/optparse.py", line 1615, in format_option_help result.append(OptionContainer.format_option_help(self, formatter)) File "/usr/lib64/python3.6/optparse.py", line 1061, in format_option_help result.append(formatter.format_option(option)) File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 54, in format_option valid_uis = list_extension_modules(bb.ui, 'main') File "/buildarea/raid5/hjia/community/poky/bitbake/lib/bb/main.py", line 72, in list_extension_modules pkgdir = os.path.dirname(pkg.__file__) AttributeError: module 'bb.ui' has no attribute '__file__' ... This reverts commit 991f92b4d15b0571b6a540964e5216d1b9728539 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20providers: selected version not available should be a warningRoss Burton
If the selected version if not available, bitbake will happily attempt to build something else. This should be a loud warning not a small note. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20fetch2: use relative symlinks for anything pulled from PREMIRRORSHombourger, Cedric
try_mirror_url() creates a symlink named as the original file to make everything look like files specified in SRC_URI were downloaded from their original location. The link is however created as an absolute reference, this makes DL_DIR non-relocatable. This also causes issues with the Isar project since it bind mounts DL_DIR to /downloads to perform some of its build tasks in a chrooted environment (rendering all symbolic links from DL_DIR invalid). Modify ensure_symlink() to take an optional "relative" argument and have that function use os.path.relpath() to produce a relative symlink. Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com> Cc: Chris Larson <Chris_Larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20bitbake: cache: Remove bad keys() functionJoshua Watt
Removes the keys() function from the MulticonfigCache. This appears to be a leftover from before the class inherited from collections.Mapping, is now unnecessary, and was outright incorrect. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20bitbake: hashserve: Add support for readonly upstreamJoshua Watt
Adds support for an upstream server to be specified. The upstream server will be queried for equivalent hashes whenever a miss is found in the local server. If the server returns a match, it is merged into the local database. In order to keep the get stream queries as fast as possible since they are the critical path when bitbake is preparing the run queue, missing tasks provided by the server are not immediately pulled from the upstream server, but instead are put into a queue to be backfilled by a worker task later. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20bitbake: hashserve: Add async clientJoshua Watt
Adds support for create a client that operates using Python asynchronous I/O. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-20lib/bb/fetch2/__init__.py: drop _PYTHON_SYSCONFIGDATA_NAME unsettingAlexander Kanavin
With introduction of python3targetconfig class in core this is no longer needed. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-09cookerdata: tweak to avoid mutable default argumentChris Laplante
Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-08bb.ui: delete __init__.py to make bb.ui a namespace packageChris Laplante
This would permit creation of third-party UI modules without having to incorporate them directly into BitBake, with BitBake able to automatically discover them in the same way it finds its built-in UIs. See https://packaging.python.org/guides/packaging-namespace-packages/ Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-08main: extract creation of argument parser into function so it can be ↵Chris Laplante
utilized externally, e.g. by unit tests Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-08BBHandler: prompt error when task name contain expressionLee Chee Yang
Task name contain expresion (eg, do_foo_remove_bar) can cause fatal error. Check for naming before addtask. Prompt with understandable error message when expression found in task name. [YOCTO #8805] Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-02fetch2/git: Document that we won't support passwords in git urlsRichard Purdie
This keeps coming up, document why we don't do this and the alternatives. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-02fetch2: add zstd support to unpackMert Kirpici
This commit adds unpack support to fetched files with extensions: '.tar.zst', '.tzst' and '.zst' Signed-off-by: Mert Kirpici <mert.kirpici@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-02siggen: Remove broken optimisationRichard Purdie
When a single signature is locked, dependent task checksum calculations fail. This in turn is because get_unihash cannot be cached correctly by this function. Remove that has turned out to be a poor optimisation to avoid that bug. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-30monitordisk: remove unused function parameterMaxime Roussin-Bélanger
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-30cache: remove unused variables.Maxime Roussin-Bélanger
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-30bitbake: Post release version bumpRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-26main: Handle cooker daemon startup erroryocto-3.22020-10.1-gatesgarth2020-10-gatesgarth1.48.11.48.0Stacy Gaikovaia
On startup, bitbake spawns a cooker daemon and waits for it's acknowledgement signal. If the acknowledgement doesn't happen in time,the bitbake object will fail to initialize and exit. The error that occurs in this case isn't handled by the existing try - catch block because SystemExit inherits from a different base Exception class. This commit adds SystemExit to the list of expected bitbake server startup errors. [YOCTO #13993] Signed-off-by: Stacy Gaikovaia <stacy.gaikovaia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-26tests/fetch: Update upstream master->main branchname transitionRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-19toaster: Update documentation links to new URLsReyna, David
Update the Toaster documentation links to the new Yocto Project URLs. [YOCTO #14092] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-19bitbake: Bump version to 1.48.0 ready for the new releaseRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-16ui/toasterui: Fix startup faults from incorrect event sequencingRichard Purdie
Toaster has been failing to start correctly when in interactive mode. The issue is due to setEventMask being called (which triggers parsing) before the environment has been sent from the UI over to the server. This means PATH isn't setup, which causes the sanity checks on HOSTTOOLS to fail in base.bbclass. The fix is to ensure the environment is sent to the server before other commands are run. The pain in debugging this highlights other improvements to the logging are needed. [YOCTO #14079] Reviewed-by: Tim Orling <timothy.t.orling@linux.intel.com> Tested-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-15toaster: Enable Gatesgarth branch in place of ZeusDavid Reyna
Toaster directly supports the last two stable branches of Yocto Project. With "Gatesgarth " being released, it is time to replace "Zeus". [YOCTO #14086] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-15lib/bb/ui/knotty: fix typo in parseprogressTim Orling
After parseprogress.finish() it was intended to set parseprogress to None, but a typo means this is not happening. Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-15bitbake: fetch/git: use shlex.quote() to support spaces in SRC_URI urlCharlie Davies
This commit replaces the instances where escaped double quotes are used to support SRC_URI url containing spaces with the more pythonic shlex.quote(). Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-11process: Show command exceptions in the server log as wellRichard Purdie
There are autobuilder logs where the server commands are failing but we have no debug info in the server log. Improve this to try and understand what is failing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-09tinfoil: When sending commands we need to process eventsRichard Purdie
The server may be displaying useful information for the user through log messages so we should display anything that has been sent. Its either this or expecting every UI to implement this code around every command call which isn't good API. [YOCTO #14054] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-09command: Ensure exceptions inheriting from BBHandledException are visibleRichard Purdie
Previous changes allowed BBHandledException to be detected but not exceptions which inherit from it. Fix this. The code really needs totally reworking to preserve the exceptions. [YOCTO #14054] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-01cooker: Avoid tracebacks if data was never setupRichard Purdie
Recent changes mean data might not be setup. If its not, avoid tracebacks. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-28siggen: use correct umask when writing siginfoRoss Burton
We try to write sstate with group-write permissions so that sstate-cache can be shared between multiple users. However the siginfo files are created in various tasks which may set their own umask (such as do_populate_sysroot, 0022). This results in no group write permission on the intermediate directories, which is fatal when sharing a cache. Fix this by wrapping the siginfo mkdir in a umask change to 0002. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-28utils: add umask changing context managerRoss Burton
Add a umask context manager which can be used to temporarily change the umask in a 'with' block. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24tests/fetch: backslash support in file:// URIsLeif Middelschulte
Implements backslashes in local filenames. A typical usecase for such a filename is a systemd unit. Example: `dev-disk-by\x2dlabel-FOO.device` Signed-off-by: Leif Middelschulte <leif.middelschulte@klsmartin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24fetch2: fix handling of `\` in file:// SRC_URILeif Middelschulte
Using backslashes in file:// URIs was broken. Either the resolver would fail or the subsequent `cp` command. Try to avoid this by putting the filenames into quotes. Fixes https://bugzilla.yoctoproject.org/show_bug.cgi?id=8161 Signed-off-by: Leif Middelschulte <leif.middelschulte@klsmartin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-24taskexp: update for GTK API changesRoss Burton
The introspected API for GtkTreeModel and friends had some unexpected quirks which have now been fixed, see[1] for details. However, for example Ubuntu 20.04 has the fixed GTK but not an updated pygobject which means taskexp raises an exception on startup. Solve by manually looking at what functions are present and calling the right one. [ YOCTO #14055 ] [1] https://gitlab.gnome.org/GNOME/pygobject/-/commit/9cdbc56fbac4db2de78dc080934b8f0a7efc892a Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-23bitbake: siggen: clean_basepath: improve perfo and readabilityJean-Francois Dagenais
This change improves performance by reducing runtime about 33% for typical inputs. (using test_clean_basepath_performance) It is also easier to read, and slightly more resilient to future changes since it doesn't mention 'virtual' anymore. Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Co-Developed-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>