[2.0][PATCH 00/18] Patch review
Please review this set of patches for 2.0/kirkstone and have comments back by end of day Thursday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3642
except for a known intermittent issue on the qemumips-alt test, which passed on subsequent retest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/102/builds/3028
The following changes since commit c212b0f3b542efa19f15782421196b7f4b64b0b9:
fetch2/crate: fix logger.debug line (2022-04-15 09:41:19 +0100)
are available in the Git repository at:
git://git.openembedded.org/bitbake-contrib stable/2.0-nut
http://cgit.openembedded.org/bitbake-contrib/log/?h=stable/2.0-nut
Matt Madison (1):
providers: use local variable for packages_dynamic pattern
Richard Purdie (15):
tests/parse: Fix one test overwriting another server/process: Drop unused import ui/buildinfohelper: Drop unused import
cooker: Drop unused loop
msg: Drop unused local variable
buildinfohelper: Drop unused function
fetch2/crate: Drop unused import
siggen: Drop pointless break statement
ui/knotty: Drop pointless pass statement
persist_data: Use a valid exception for missing implementation
runqueue: Drop pointless variable assignment
buildinfohelper: Drop unused variables
fetch2/osc: Add missing parameter
runqueue: Fix sig file location when using multiconfig fetch/git : Use cat as pager
Robert Yang (1):
fetch2/ssh.py: decode path back for ssh
Roland Hieber (1):
cache: correctly handle file names containing colons
lib/bb/cache.py | 2 +- lib/bb/cooker.py | 25 ++++++++++++------------- lib/bb/fetch2/crate.py | 1 - lib/bb/fetch2/git.py | 2 +- lib/bb/fetch2/osc.py | 2 +- lib/bb/fetch2/ssh.py | 6 ++++-- lib/bb/msg.py | 1 - lib/bb/persist_data.py | 2 +- lib/bb/providers.py | 6 +++--- lib/bb/runqueue.py | 3 +-- lib/bb/server/process.py | 1 - lib/bb/siggen.py | 1 - lib/bb/tests/parse.py | 2 +- lib/bb/ui/buildinfohelper.py | 27 +++------------------------ lib/bb/ui/knotty.py | 1 - 15 files changed, 28 insertions(+), 54 deletions(-)
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 01/18] providers: use local variable for packages_dynamic pattern
From: Matt Madison <[email protected]>
During parsing, Python raises
RuntimeError: dictionary changed size during iteration
in getRuntimeProviders, if you happen to have a recipe with an explicit RDEPENDS on a dynamic package containing a '+' character, such as 'gtk+3-locale-en'.
This is because we're using the modified pattern as the key into the packages_dynamic dict to append to rproviders, and since that key doesn't exist, the dict is getting modified to add a new, empty, entry for it. So even without the runtime error, we'd be generating an incorrect result.
Fix this by using a local variable for modifying the pattern and using the original key to retrieve the value on a match.
--- lib/bb/providers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/bb/providers.py +3 -3
@@ -396,8 +396,8 @@ def getRuntimeProviders(dataCache, rdepend): return rproviders # Only search dynamic packages if we can't find anything in other variables - for pattern in dataCache.packages_dynamic: - pattern = pattern.replace(r'+', r"\+") + for pat_key in dataCache.packages_dynamic: + pattern = pat_key.replace(r'+', r"\+") if pattern in regexp_cache: regexp = regexp_cache[pattern] else:
@@ -408,7 +408,7 @@ def getRuntimeProviders(dataCache, rdepend): raise regexp_cache[pattern] = regexp if regexp.match(rdepend): - rproviders += dataCache.packages_dynamic[pattern] + rproviders += dataCache.packages_dynamic[pat_key] logger.debug("Assuming %s is a dynamic package, but it may not exist" % rdepend) return rproviders
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 03/18] server/process: Drop unused import
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/server/process.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/server/process.py +0 -1
@@ -20,7 +20,6 @@ import os import sys import time import select -import signal import socket import subprocess import errno
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 04/18] ui/buildinfohelper: Drop unused import
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/ui/buildinfohelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/ui/buildinfohelper.py +1 -1
@@ -45,7 +45,7 @@ from pprint import pformat import logging from datetime import datetime, timedelta -from django.db import transaction, connection +from django.db import transaction # pylint: disable=invalid-name
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 02/18] tests/parse: Fix one test overwriting another
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
Fix an issue where two tests have the same name with one overwriting the other.
--- lib/bb/tests/parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/tests/parse.py +1 -1
@@ -119,7 +119,7 @@ EXTRA_OECONF:class-target = "b" EXTRA_OECONF:append = " c" """ - def test_parse_overrides(self): + def test_parse_overrides2(self): f = self.parsehelper(self.overridetest2) d = bb.parse.handle(f.name, self.d)[''] d.appendVar("EXTRA_OECONF", " d")
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 07/18] buildinfohelper: Drop unused function
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
The function has a loop where the variable is never used which I was going to fix but the entire function never seems to be called so remove it entirely.
--- lib/bb/ui/buildinfohelper.py | 21 --------------------- 1 file changed, 21 deletions(-)
lib/bb/ui/buildinfohelper.py +0 -21
@@ -1062,27 +1062,6 @@ class BuildInfoHelper(object): return recipe_info - def _get_path_information(self, task_object): - self._ensure_build() - - assert isinstance(task_object, Task) - build_stats_format = "{tmpdir}/buildstats/{buildname}/{package}/" - build_stats_path = [] - - for t in self.internal_state['targets']: - buildname = self.internal_state['build'].build_name - pe, pv = task_object.recipe.version.split(":",1) - if pe: - package = task_object.recipe.name + "-" + pe + "_" + pv - else: - package = task_object.recipe.name + "-" + pv - - build_stats_path.append(build_stats_format.format(tmpdir=self.tmp_dir, - buildname=buildname, - package=package)) - - return build_stats_path - ################################ ## external available methods to store information
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 08/18] fetch2/crate: Drop unused import
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/fetch2/crate.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/fetch2/crate.py +0 -1
@@ -13,7 +13,6 @@ BitBake 'Fetch' implementation for crates.io import hashlib import json import os -import shutil import subprocess import bb from bb.fetch2 import logger, subprocess_setup, UnpackError
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 06/18] msg: Drop unused local variable
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/msg.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/msg.py +0 -1
@@ -133,7 +133,6 @@ class LogFilterShowOnce(logging.Filter): self.seen_errors = set() def filter(self, record): - msg = record.msg if record.levelno == bb.msg.BBLogFormatter.WARNONCE: if record.msg in self.seen_warnings: return False
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 05/18] cooker: Drop unused loop
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/cooker.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
lib/bb/cooker.py +12 -13
@@ -744,19 +744,18 @@ class BBCooker: taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc]) mcdeps |= set(taskdata[mc].get_mcdepends()) new = False - for mc in self.multiconfigs: - for k in mcdeps: - if k in seen: - continue - l = k.split(':') - depmc = l[2] - if depmc not in self.multiconfigs: - bb.fatal("Multiconfig dependency %s depends on nonexistent multiconfig configuration named configuration %s" % (k,depmc)) - else: - logger.debug("Adding providers for multiconfig dependency %s" % l[3]) - taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3]) - seen.add(k) - new = True + for k in mcdeps: + if k in seen: + continue + l = k.split(':') + depmc = l[2] + if depmc not in self.multiconfigs: + bb.fatal("Multiconfig dependency %s depends on nonexistent multiconfig configuration named configuration %s" % (k,depmc)) + else: + logger.debug("Adding providers for multiconfig dependency %s" % l[3]) + taskdata[depmc].add_provider(localdata[depmc], self.recipecaches[depmc], l[3]) + seen.add(k) + new = True for mc in self.multiconfigs: taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 09/18] siggen: Drop pointless break statement
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/siggen.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/siggen.py +0 -1
@@ -40,7 +40,6 @@ def init(d): for sg in siggens: if desired == sg.name: return sg(d) - break else: logger.error("Invalid signature generator '%s', using default 'noop'\n" "Available generators: %s", desired,
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 10/18] ui/knotty: Drop pointless pass statement
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/ui/knotty.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/ui/knotty.py +0 -1
@@ -877,7 +877,6 @@ def main(server, eventHandler, params, tf = TerminalFilter): state_force_shutdown() main.shutdown = main.shutdown + 1 - pass except Exception as e: import traceback sys.stderr.write(traceback.format_exc())
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 11/18] persist_data: Use a valid exception for missing implementation
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/persist_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/persist_data.py +1 -1
@@ -208,7 +208,7 @@ class SQLTable(collections.abc.MutableMapping): def __lt__(self, other): if not isinstance(other, Mapping): - raise NotImplemented + raise NotImplementedError() return len(self) < len(other)
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 12/18] runqueue: Drop pointless variable assignment
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
This is set at the start of the loop anyway so it does nothing. Drop the pointless code.
--- lib/bb/runqueue.py | 1 - 1 file changed, 1 deletion(-)
lib/bb/runqueue.py +0 -1
@@ -2664,7 +2664,6 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): sq_revdeps_squash[point] = set() if point in rqdata.runq_setscene_tids: sq_revdeps_squash[point] = tasks - tasks = set() continue for dep in rqdata.runtaskentries[point].depends: if point in sq_revdeps[dep]:
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 13/18] buildinfohelper: Drop unused variables
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/ui/buildinfohelper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/bb/ui/buildinfohelper.py +2 -2
@@ -496,7 +496,7 @@ class ORMWrapper(object): if not parent_path: parent_path = "/" parent_obj = self._cached_get(Target_File, target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) - tf_obj = Target_File.objects.create( + Target_File.objects.create( target = target_obj, path = path, size = size,
@@ -561,7 +561,7 @@ class ORMWrapper(object): parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY) - tf_obj = Target_File.objects.create( + Target_File.objects.create( target = target_obj, path = path, size = size,
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 15/18] fetch2/ssh.py: decode path back for ssh
In reply to Steve SakomanFrom: Robert Yang <[email protected]>
The path has been encoded by urllib.parse.quote(), so decode it back for ssh.
Fixed when fetch from PREMIRRORS via ssh:
$ bitbake bonnie++ libsigc++-2.0 -cfetch
scp: /path/to/downloads/libsigc%2B%2B-2.10.7.tar.xz: No such file or directory
--- lib/bb/fetch2/ssh.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/bb/fetch2/ssh.py +4 -2
@@ -32,6 +32,7 @@ IETF secsh internet draft: import re, os from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd +import urllib __pattern__ = re.compile(r'''
@@ -70,6 +71,7 @@ class SSH(FetchMethod): "git:// prefix with protocol=ssh", urldata.url) m = __pattern__.match(urldata.url) path = m.group('path') + path = urllib.parse.unquote(path) host = m.group('host') urldata.localpath = os.path.join(d.getVar('DL_DIR'), os.path.basename(os.path.normpath(path)))
@@ -99,7 +101,7 @@ class SSH(FetchMethod): if path[0] != '~': path = '/%s' % path - path = path.replace("%3A", ":") + path = urllib.parse.unquote(path) fr += ':%s' % path
@@ -139,7 +141,7 @@ class SSH(FetchMethod): if path[0] != '~': path = '/%s' % path - path = path.replace("%3A", ":") + path = urllib.parse.unquote(path) cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( portarg,
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 14/18] fetch2/osc: Add missing parameter
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
This probably means the osc fetcher isn't being used but fix the missing parameter.
--- lib/bb/fetch2/osc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/osc.py +1 -1
@@ -43,7 +43,7 @@ class Osc(FetchMethod): ud.revision = ud.parm['rev'] else: pv = d.getVar("PV", False) - rev = bb.fetch2.srcrev_internal_helper(ud, d) + rev = bb.fetch2.srcrev_internal_helper(ud, d, '') if rev: ud.revision = rev else:
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 17/18] cache: correctly handle file names containing colons
In reply to Steve SakomanFrom: Roland Hieber <[email protected]>
File names containing colons cause split() to return a list with more than two elements, which will lead to a stack trace ending in:
ValueError: too many values to unpack (expected 2)
Split only once at the last colon, thereby making sure that only two elements are returned.
--- lib/bb/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/cache.py +1 -1
@@ -619,7 +619,7 @@ class Cache(NoCache): for f in flist: if not f: continue - f, exist = f.split(":") + f, exist = f.rsplit(":", 1) if (exist == "True" and not os.path.exists(f)) or (exist == "False" and os.path.exists(f)): self.logger.debug2("%s's file checksum list file %s changed", fn, f)
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 16/18] runqueue: Fix sig file location when using multiconfig
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
We're using the wrong data store when trying to locate siginfo files, fix this. Thanks to Gregory Lumen <[email protected]> for spotting.
[YOCTO #14774]
--- lib/bb/runqueue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/runqueue.py +1 -1
@@ -1674,7 +1674,7 @@ class RunQueue: (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn] h = self.rqdata.runtaskentries[tid].hash - matches = bb.siggen.find_siginfo(pn, taskname, [], self.cfgData) + matches = bb.siggen.find_siginfo(pn, taskname, [], self.cooker.databuilder.mcdata[mc]) match = None for m in matches: if h in m:
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 18/18] fetch/git : Use cat as pager
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
We don't have less in HOSTTOOLS in OE and this can confuse git. Force the pager to cat to be consistent and minimal everywhere.
--- lib/bb/fetch2/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/fetch2/git.py +1 -1
@@ -240,7 +240,7 @@ class Git(FetchMethod): for name in ud.names: ud.unresolvedrev[name] = 'HEAD' - ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false" + ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat" write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0" ud.write_tarballs = write_tarballs != "0" or ud.rebaseable
Signature · 1 line
2.25.1