[1.46][PATCH 0/8] Patch review
Please review this next set of patches for dunfell/1.46 and have comments back by end of day Thursday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2772
The following changes since commit b4117231bf070703b9375af4411bcd160e07fdae:
build/msg: Cleanup verbose option handling (2021-09-30 04:12:50 -1000)
are available in the Git repository at:
git://git.openembedded.org/bitbake-contrib stable/1.46-nut
http://cgit.openembedded.org/bitbake-contrib/log/?h=stable/1.46-nut
Alexander Kanavin (5):
bitbake: correct the collections vs collections.abc deprecation
bitbake: fix regexp deprecation warnings
bitbake: do not import imp in layerindexlib
bitbake: adjust parser error check for python 3.10 compatibility
bitbake: correct deprecation warning in process.py
Chris Laplante (1):
compat.py: remove file since it no longer actually implements anything
Justin Bronder (1):
hashserv: let asyncio discover the running loop
Richard Purdie (1):
test/fetch: Update urls to match upstream branch name changes
lib/bb/compat.py | 10 ---------- lib/bb/data_smart.py | 4 ++-- lib/bb/event.py | 16 ++++++++-------- lib/bb/persist_data.py | 13 +++++++------ lib/bb/server/process.py | 2 +- lib/bb/tests/event.py | 17 +++++++++-------- lib/bb/tests/fetch.py | 6 +++--- lib/bblayers/query.py | 6 +++--- lib/hashserv/server.py | 4 ++-- lib/layerindexlib/__init__.py | 1 - 10 files changed, 35 insertions(+), 44 deletions(-) delete mode 100644 lib/bb/compat.py
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 1/8] compat.py: remove file since it no longer actually implements anything
From: Chris Laplante <[email protected]>
Now that compat.py just imports Python standard library stuff, get rid of the layer of indirection.
--- lib/bb/compat.py | 10 ---------- lib/bb/event.py | 16 ++++++++-------- lib/bb/persist_data.py | 8 ++++---- lib/bb/tests/event.py | 17 +++++++++-------- 4 files changed, 21 insertions(+), 30 deletions(-) delete mode 100644 lib/bb/compat.py
lib/bb/compat.py deleted +0 -10
@@ -1,10 +0,0 @@ -# -# SPDX-License-Identifier: GPL-2.0-only -# - -"""Code pulled from future python versions, here for compatibility""" - -from collections import MutableMapping, KeysView, ValuesView, ItemsView, OrderedDict -from functools import total_ordering - -
lib/bb/event.py +8 -8
@@ -10,17 +10,17 @@ BitBake build tools. # SPDX-License-Identifier: GPL-2.0-only # -import sys -import pickle -import logging -import atexit -import traceback import ast +import atexit +import collections +import logging +import pickle +import sys import threading +import traceback -import bb.utils -import bb.compat import bb.exceptions +import bb.utils # This is the pid for which we should generate the event. This is set when # the runqueue forks off.
@@ -56,7 +56,7 @@ def set_class_handlers(h): _handlers = h def clean_class_handlers(): - return bb.compat.OrderedDict() + return collections.OrderedDict() # Internal _handlers = clean_class_handlers()
lib/bb/persist_data.py +4 -4
@@ -12,14 +12,14 @@ currently, providing a key/value store accessed by 'domain'. # import collections +import contextlib +import functools import logging import os.path +import sqlite3 import sys import warnings -from bb.compat import total_ordering from collections import Mapping -import sqlite3 -import contextlib sqlversion = sqlite3.sqlite_version_info if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
@@ -28,7 +28,7 @@ if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): logger = logging.getLogger("BitBake.PersistData") -@total_ordering [email protected]_ordering class SQLTable(collections.MutableMapping): class _Decorators(object): @staticmethod
lib/bb/tests/event.py +9 -8
@@ -6,17 +6,18 @@ # SPDX-License-Identifier: GPL-2.0-only # -import unittest -import bb -import logging -import bb.compat -import bb.event +import collections import importlib +import logging +import pickle import threading import time -import pickle +import unittest from unittest.mock import Mock from unittest.mock import call + +import bb +import bb.event from bb.msg import BBLogFormatter
@@ -75,7 +76,7 @@ class EventHandlingTest(unittest.TestCase): def _create_test_handlers(self): """ Method used to create a test handler ordered dictionary """ - test_handlers = bb.compat.OrderedDict() + test_handlers = collections.OrderedDict() test_handlers["handler1"] = self._test_process.handler1 test_handlers["handler2"] = self._test_process.handler2 return test_handlers
@@ -96,7 +97,7 @@ class EventHandlingTest(unittest.TestCase): def test_clean_class_handlers(self): """ Test clean_class_handlers method """ - cleanDict = bb.compat.OrderedDict() + cleanDict = collections.OrderedDict() self.assertEqual(cleanDict, bb.event.clean_class_handlers())
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 2/8] bitbake: correct the collections vs collections.abc deprecation
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
This becomes a hard error in python 3.10.
--- lib/bb/data_smart.py | 2 +- lib/bb/persist_data.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
lib/bb/data_smart.py +1 -1
@@ -17,7 +17,7 @@ BitBake build tools. # Based on functions from the base bb module, Copyright 2003 Holger Schurig import copy, re, sys, traceback -from collections import MutableMapping +from collections.abc import MutableMapping import logging import hashlib import bb, bb.codeparser
lib/bb/persist_data.py +3 -2
@@ -12,6 +12,7 @@ currently, providing a key/value store accessed by 'domain'. # import collections +import collections.abc import contextlib import functools import logging
@@ -19,7 +20,7 @@ import os.path import sqlite3 import sys import warnings -from collections import Mapping +from collections.abc import Mapping sqlversion = sqlite3.sqlite_version_info if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
@@ -29,7 +30,7 @@ if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3): logger = logging.getLogger("BitBake.PersistData") @functools.total_ordering -class SQLTable(collections.MutableMapping): +class SQLTable(collections.abc.MutableMapping): class _Decorators(object): @staticmethod def retry(*, reconnect=True):
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 3/8] bitbake: fix regexp deprecation warnings
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
See here for details:
https://docs.python.org/3/library/re.html
--- lib/bblayers/query.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/bblayers/query.py +3 -3
@@ -433,10 +433,10 @@ NOTE: .bbappend files can impact the dependencies. line = fnfile.readline() # The "require/include xxx" in conf/machine/*.conf, .inc and .bbclass - conf_re = re.compile(".*/conf/machine/[^\/]*\.conf$") - inc_re = re.compile(".*\.inc$") + conf_re = re.compile(r".*/conf/machine/[^\/]*\.conf$") + inc_re = re.compile(r".*\.inc$") # The "inherit xxx" in .bbclass - bbclass_re = re.compile(".*\.bbclass$") + bbclass_re = re.compile(r".*\.bbclass$") for layerdir in self.bblayers: layername = self.get_layer_name(layerdir) for dirpath, dirnames, filenames in os.walk(layerdir):
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 4/8] bitbake: do not import imp in layerindexlib
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
The module is deprecated and unused.
--- lib/layerindexlib/__init__.py | 1 - 1 file changed, 1 deletion(-)
lib/layerindexlib/__init__.py +0 -1
@@ -6,7 +6,6 @@ import datetime import logging -import imp from collections import OrderedDict from layerindexlib.plugin import LayerIndexPluginUrlError
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 5/8] bitbake: adjust parser error check for python 3.10 compatibility
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
The change was introduced in
https://github.com/python/cpython/commit/a698d52c3975c80b45b139b2f08402ec514dce75
--- lib/bb/data_smart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data_smart.py +1 -1
@@ -403,7 +403,7 @@ class DataSmart(MutableMapping): s = __expand_python_regexp__.sub(varparse.python_sub, s) except SyntaxError as e: # Likely unmatched brackets, just don't expand the expression - if e.msg != "EOL while scanning string literal": + if e.msg != "EOL while scanning string literal" and not e.msg.startswith("unterminated string literal"): raise if s == olds: break
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 6/8] bitbake: correct deprecation warning in process.py
In reply to Steve SakomanFrom: Alexander Kanavin <[email protected]>
--- lib/bb/server/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/server/process.py +1 -1
@@ -587,7 +587,7 @@ class BBUIEventQueue: self.reader = ConnectionReader(readfd) self.t = threading.Thread() - self.t.setDaemon(True) + self.t.daemon = True self.t.run = self.startCallbackHandler self.t.start()
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 7/8] test/fetch: Update urls to match upstream branch name changes
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
--- lib/bb/tests/fetch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/bb/tests/fetch.py +3 -3
@@ -937,7 +937,7 @@ class FetcherNetworkTest(FetcherTest): @skipIfNoNetwork() def test_git_submodule_CLI11(self): - url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf" + url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=bd4dc911847d0cde7a6b41dfa626a85aab213baf;branch=main" fetcher = bb.fetch.Fetch([url], self.d) fetcher.download() # Previous cwd has been deleted
@@ -952,12 +952,12 @@ class FetcherNetworkTest(FetcherTest): @skipIfNoNetwork() def test_git_submodule_update_CLI11(self): """ Prevent regression on update detection not finding missing submodule, or modules without needed commits """ - url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714" + url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=cf6a99fa69aaefe477cc52e3ef4a7d2d7fa40714;branch=main" fetcher = bb.fetch.Fetch([url], self.d) fetcher.download() # CLI11 that pulls in a newer nlohmann-json - url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca" + url = "gitsm://github.com/CLIUtils/CLI11;protocol=git;rev=49ac989a9527ee9bb496de9ded7b4872c2e0e5ca;branch=main" fetcher = bb.fetch.Fetch([url], self.d) fetcher.download() # Previous cwd has been deleted
Signature · 1 line
2.25.1
[bitbake][dunfell][1.46][PATCH 8/8] hashserv: let asyncio discover the running loop
In reply to Steve SakomanFrom: Justin Bronder <[email protected]>
From 3.10 documentation [1]:
Deprecated since version 3.8, removed in version 3.10: The loop parameter. This function has been implicitly getting the current running loop since 3.7
This is fixed in master as a side-effect of cf9bc0310b0092bf52b61057405aeb51c86ba137 which is more intrusive but likewise drops the loop parameter.
1. https://docs.python.org/3/library/asyncio-stream.html#asyncio.open_connection
--- lib/hashserv/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/hashserv/server.py +2 -2
@@ -420,7 +420,7 @@ class Server(object): def start_tcp_server(self, host, port): self.server = self.loop.run_until_complete( - asyncio.start_server(self.handle_client, host, port, loop=self.loop) + asyncio.start_server(self.handle_client, host, port) ) for s in self.server.sockets:
@@ -445,7 +445,7 @@ class Server(object): # Work around path length limits in AF_UNIX os.chdir(os.path.dirname(path)) self.server = self.loop.run_until_complete( - asyncio.start_unix_server(self.handle_client, os.path.basename(path), loop=self.loop) + asyncio.start_unix_server(self.handle_client, os.path.basename(path)) ) finally: os.chdir(cwd)
Signature · 1 line
2.25.1