[1.50][PATCH 0/4] Backport fixes for python 3.10
Backport fixes for running bitbake on Fedora 35, which ships with python 3.10.
Alexander Kanavin (3):
bitbake: correct the collections vs collections.abc deprecation
bitbake: adjust parser error check for python 3.10 compatibility
bitbake: correct deprecation warning in process.py
Justin Bronder (1):
hashserv: let asyncio discover the running loop
lib/bb/cache.py | 3 ++- lib/bb/data_smart.py | 4 ++-- lib/bb/persist_data.py | 5 +++-- lib/bb/server/process.py | 2 +- lib/hashserv/server.py | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-)
[1.50][PATCH 1/4] bitbake: correct the collections vs collections.abc deprecation
From: Alexander Kanavin <[email protected]>
This becomes a hard error in python 3.10.
--- lib/bb/cache.py | 3 ++- lib/bb/data_smart.py | 2 +- lib/bb/persist_data.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-)
lib/bb/cache.py +2 -1
@@ -19,7 +19,8 @@ import os import logging import pickle -from collections import defaultdict, Mapping +from collections import defaultdict +from collections.abc import Mapping import bb.utils from bb import PrefixLoggerAdapter import re
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):
[1.50][PATCH 2/4] hashserv: let asyncio discover the running loop
In reply to Jacob KroonFrom: Justin Bronder <[email protected]>
Quoted 1 line
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
@@ -521,7 +521,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:
@@ -546,7 +546,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)
[1.50][PATCH 3/4] bitbake: adjust parser error check for python 3.10 compatibility
In reply to Jacob KroonFrom: 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
[1.50][PATCH 4/4] bitbake: correct deprecation warning in process.py
In reply to Jacob KroonFrom: Alexander Kanavin <[email protected]>
--- lib/bb/server/process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/server/process.py +1 -1
@@ -659,7 +659,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()
Thanks, I already have these in my queue and would be sent as part of next merge request.
https://cgit.openembedded.org/bitbake-contrib/log/?h=anujm/1.50
Thanks,
Anuj
Quoted 23 lines
-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Jacob Kroon
Sent: Friday, November 19, 2021 12:26 AM
To: [email protected]
Subject: [bitbake-devel] [1.50][PATCH 0/4] Backport fixes for python 3.10Backport fixes for running bitbake on Fedora 35, which ships with python 3.10.
Alexander Kanavin (3):
bitbake: correct the collections vs collections.abc deprecation
bitbake: adjust parser error check for python 3.10 compatibility
bitbake: correct deprecation warning inprocess.pyJustin Bronder (1):
hashserv: let asyncio discover the running looplib/bb/cache.py | 3 ++- lib/bb/data_smart.py | 4 ++-- lib/bb/persist_data.py | 5 +++-- lib/bb/server/process.py | 2 +- lib/hashserv/server.py | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-)
Quoted 8 lines · Anuj
Thanks, I already have these in my queue and would be sent as part of next merge request.
https://cgit.openembedded.org/bitbake-contrib/log/?h=anujm/1.50
Thanks,
Anuj
Super! Thanks Anuj
/Jacob
Quoted 24 lines
Quoted 23 lines
-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Jacob Kroon
Sent: Friday, November 19, 2021 12:26 AM
To: [email protected]
Subject: [bitbake-devel] [1.50][PATCH 0/4] Backport fixes for python 3.10Backport fixes for running bitbake on Fedora 35, which ships with python 3.10.
Alexander Kanavin (3):
bitbake: correct the collections vs collections.abc deprecation
bitbake: adjust parser error check for python 3.10 compatibility
bitbake: correct deprecation warning inprocess.pyJustin Bronder (1):
hashserv: let asyncio discover the running looplib/bb/cache.py | 3 ++- lib/bb/data_smart.py | 4 ++-- lib/bb/persist_data.py | 5 +++-- lib/bb/server/process.py | 2 +- lib/hashserv/server.py | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-)