Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/qt5webengine-chromium: fix python3.11 build errors
@ 2023-10-25 20:52 Kadir Yilmaz
  2024-06-06  9:46 ` Yann E. MORIN
  2024-07-15 10:18 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Kadir Yilmaz @ 2023-10-25 20:52 UTC (permalink / raw)
  To: buildroot; +Cc: Giulio Benetti, Kadir Yilmaz, Julien Corjon

qt5webengine fails to build due to changes introduced in python3.11:

- [864/23192] ACTION //services/metrics/public/cpp:gen_ukm_builders(/ho
  me/vagrant/output_raspberrypi3_qt5we/build/qt5webengine-5.15.8/src/to
  olchain:target)
  ...
  re.error: global flags not at the start of the expression at position 1

    https://docs.python.org/3.11/library/re.html
    (?aiLmsux)
    Changed in version 3.11: This construction can only be used at the
    start of the expression.

- [3742/22323] ACTION //chrome/app:chromium_strings_grit(/home/vagrant/
  output_raspberrypi3_qt5we/build/qt5webengine-5.15.8/src/toolchain:tar
  get)
  ...
  ValueError: invalid mode: 'rU'

    open(), io.open(), codecs.open() and fileinput.FileInput no longer
    accept 'U' (“universal newline”) in the file mode. In Python 3,
    “universal newline” mode is used by default whenever a file is
    opened in text mode, and the 'U' flag has been deprecated since
    Python 3.3. The newline parameter to these functions controls how
    universal newlines work. (Contributed by Victor Stinner in bpo-37330.)

Signed-off-by: Kadir Yilmaz <kadir.c.yilmaz@gmail.com>
---
 ...x-build-tools-to-run-with-python3.11.patch | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 package/qt5/qt5webengine-chromium/0003-Fix-build-tools-to-run-with-python3.11.patch

diff --git a/package/qt5/qt5webengine-chromium/0003-Fix-build-tools-to-run-with-python3.11.patch b/package/qt5/qt5webengine-chromium/0003-Fix-build-tools-to-run-with-python3.11.patch
new file mode 100644
index 0000000000..44c8337f80
--- /dev/null
+++ b/package/qt5/qt5webengine-chromium/0003-Fix-build-tools-to-run-with-python3.11.patch
@@ -0,0 +1,72 @@
+From 82c9b1d3f4383cd8059690bd34c9d7fa86398b78 Mon Sep 17 00:00:00 2001
+From: Kadir Yilmaz <kadir.c.yilmaz@gmail.com>
+Date: Sat, 21 Oct 2023 22:45:03 +0200
+Subject: [PATCH] Fix build tools to run with python3.11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream: N/A buildroot uses python3.11 which apparently is not yet
+supported by upstream
+
+- re error: global flags not at the start
+
+    https://docs.python.org/3/library/re.html#re-syntax
+    (?aiLmsux)
+    ....
+    Changed in version 3.11: This construction can only be used at the
+    start of the expression
+
+- ValueError: invalid mode: 'rU'
+
+    open(), io.open(), codecs.open() and fileinput.FileInput no longer
+    accept 'U' (“universal newline”) in the file mode. In Python 3,
+    “universal newline” mode is used by default whenever a file is
+    opened in text mode, and the 'U' flag has been deprecated since
+    Python 3.3. The newline parameter to these functions controls how
+    universal newlines work. (Contributed by Victor Stinner in bpo-37330.)
+
+Signed-off-by: Kadir Yilmaz <kadir.c.yilmaz@gmail.com>
+---
+ chromium/tools/grit/grit/util.py        | 2 +-
+ chromium/tools/metrics/ukm/ukm_model.py | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/chromium/tools/grit/grit/util.py b/chromium/tools/grit/grit/util.py
+index 528d766ad6b..6e8cdb0ebfa 100644
+--- a/chromium/tools/grit/grit/util.py
++++ b/chromium/tools/grit/grit/util.py
+@@ -211,7 +211,7 @@ def ReadFile(filename, encoding):
+     mode = 'rb'
+     encoding = None
+   else:
+-    mode = 'rU'
++    mode = 'r'
+ 
+   with io.open(abs(filename), mode, encoding=encoding) as f:
+     return f.read()
+diff --git a/chromium/tools/metrics/ukm/ukm_model.py b/chromium/tools/metrics/ukm/ukm_model.py
+index ec24dd57360..57decab3ccc 100644
+--- a/chromium/tools/metrics/ukm/ukm_model.py
++++ b/chromium/tools/metrics/ukm/ukm_model.py
+@@ -42,7 +42,7 @@ _INDEX_TYPE = models.ObjectNodeType(
+ _STATISTICS_TYPE =  models.ObjectNodeType(
+     'statistics',
+     attributes=[
+-      ('export', str, r'^(?i)(|true|false)$'),
++      ('export', str, r'(?i)^(|true|false)$'),
+     ],
+     children=[
+         models.ChildType(_QUANTILES_TYPE.tag, _QUANTILES_TYPE, multiple=False),
+@@ -94,7 +94,7 @@ _EVENT_TYPE =  models.ObjectNodeType(
+     'event',
+     attributes=[
+       ('name', str, r'^[A-Za-z0-9.]+$'),
+-      ('singular', str, r'^(?i)(|true|false)$'),
++      ('singular', str, r'(?i)^(|true|false)$'),
+     ],
+     alphabetization=[
+         (_OBSOLETE_TYPE.tag, _KEEP_ORDER),
+-- 
+2.25.1
+
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-15 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-25 20:52 [Buildroot] [PATCH 1/1] package/qt5webengine-chromium: fix python3.11 build errors Kadir Yilmaz
2024-06-06  9:46 ` Yann E. MORIN
2024-07-15 10:18 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox