public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/chromium] epel9-next: Fix build error caused by python-3.9 on EL9
@ 2026-08-07 16:08 Than Ngo
  0 siblings, 0 replies; only message in thread
From: Than Ngo @ 2026-08-07 16:08 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/chromium
Branch : epel9-next
Commit : fe4b6492581ba8e782e491115ba0107d972b934d
Author : Than Ngo <than@redhat.com>
Date   : 2025-12-04T18:25:39+01:00
Stats  : +26/-65 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/chromium/c/fe4b6492581ba8e782e491115ba0107d972b934d?branch=epel9-next

Log:
Fix build error caused by python-3.9 on EL9

---
diff --git a/chromium-142-python-3.9-ftbfs.patch b/chromium-142-python-3.9-ftbfs.patch
deleted file mode 100644
index 093205a..0000000
--- a/chromium-142-python-3.9-ftbfs.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-Fix FTBFS caused by old python-3.9.x on el9
-
-File "/builddir/build/BUILD/chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py", line 81, in EnumDict
-    type: str | None
-TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
-
-File "/builddir/build/BUILD/chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py", line 106, in <module>
-
-   ) -> tuple[str | None, ExtractionErrors]:
-
-TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
-
-File "/builddir/build/BUILD/chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py", line 643, in <module>
-
-   def _GetObsoleteReason(node: xml.dom.minidom.Element) -> str | None:
-
-TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
-
-diff -up chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py.me chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py
---- chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py.me	2025-10-28 20:14:35.609014587 +0100
-+++ chromium-142.0.7444.52/tools/metrics/histograms/extract_histograms.py	2025-10-28 20:30:30.123641508 +0100
-@@ -21,6 +21,7 @@ from typing import Any, TypedDict
- import xml.dom.minidom
- 
- import histogram_configuration_model
-+from typing import Optional, Union
- 
- sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
- import xml_utils
-@@ -78,7 +79,7 @@ class EnumDict(TypedDict, total=False):
-   """A dict representing an enum."""
- 
-   name: str
--  type: str | None
-+  type: Optional[str]
-   buckets: list[_BucketDict]
-   summary: str
- 
-@@ -102,7 +103,7 @@ def ExpandHistogramNameWithSuffixes(
-     suffix_name: str,
-     histogram_name: str,
-     histogram_suffixes_node: xml.dom.minidom.Element,
--) -> tuple[str | None, ExtractionErrors]:
-+) -> tuple[Optional[str], ExtractionErrors]:
-   """Creates a new histogram name based on a histogram suffix.
- 
-   Args:
-@@ -304,7 +305,7 @@ def _ExtractOwners(node: xml.dom.minidom
- 
- def _ExtractImprovementDirection(
-     histogram_node: xml.dom.minidom.Element,
--) -> tuple[str | None, ExtractionErrors]:
-+) -> tuple[Union[str, None], ExtractionErrors]:
-   """Extracts improvement direction from the given histogram element, if any.
- 
-   Args:
-@@ -639,7 +640,7 @@ def ExtractVariantsFromXmlTree(
-   return variants_dict, errors
- 
- 
--def _GetObsoleteReason(node: xml.dom.minidom.Element) -> str | None:
-+def _GetObsoleteReason(node: xml.dom.minidom.Element) -> Optional[str]:
-   """If the node's histogram is obsolete, returns a string explanation.
- 
-   Otherwise, returns None.

diff --git a/chromium-143-python-3.9-ftbfs.patch b/chromium-143-python-3.9-ftbfs.patch
index fc7dc46..d69e5c3 100644
--- a/chromium-143-python-3.9-ftbfs.patch
+++ b/chromium-143-python-3.9-ftbfs.patch
@@ -1,3 +1,16 @@
+Author: <than@redhat.com>
+
+Fix build error caused by python-3.9 on EL9
+
+Traceback (most recent call last):
+  File "/builddir/build/BUILD/chromium-143.0.7499.40/out/Release/../../tools/metrics/histograms/generate_allowlist_from_histograms_file.py", line 10, in <module>
+    import extract_histograms
+  File "/builddir/build/BUILD/chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py", line 24, in <module>
+    import xml_utils
+  File "/builddir/build/BUILD/chromium-143.0.7499.40/tools/metrics/histograms/../common/xml_utils.py", line 14, in <module>
+    DomTree = minidom.Element | minidom.Document
+TypeError: unsupported operand type(s) for |: 'type' and 'type'
+
 diff -up chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py.python-3.9-ftbfs chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py
 --- chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py.python-3.9-ftbfs	2025-11-19 22:40:05.000000000 +0100
 +++ chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py	2025-12-02 17:23:41.996802101 +0100
@@ -45,3 +58,16 @@ diff -up chromium-143.0.7499.40/tools/metrics/histograms/extract_histograms.py.p
    """If the node's histogram is obsolete, returns a string explanation.
  
    Otherwise, returns None.
+diff -up chromium-143.0.7499.40/tools/metrics/common/xml_utils.py.than chromium-143.0.7499.40/tools/metrics/common/xml_utils.py
+--- chromium-143.0.7499.40/tools/metrics/common/xml_utils.py.than	2025-12-04 17:48:11.924111675 +0100
++++ chromium-143.0.7499.40/tools/metrics/common/xml_utils.py	2025-12-04 17:49:42.451979769 +0100
+@@ -11,7 +11,8 @@ from xml.dom import minidom
+ # The implementation of Node type is possible with extra runtime checks, however
+ # using a more specific type makes the intent clearer and avoids potential
+ # warnings about attributes like `tagName` not being present on all Node types.
+-DomTree = minidom.Element | minidom.Document
++from typing import Union
++DomTree = Union[minidom.Element, minidom.Document]
+ 
+ _ELEMENT_NODE = minidom.Node.ELEMENT_NODE
+ 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-07 16:08 [rpms/chromium] epel9-next: Fix build error caused by python-3.9 on EL9 Than Ngo

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