public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Than Ngo <than@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/chromium] epel9-next: Fix build error caused by python-3.9 on EL9
Date: Fri, 07 Aug 2026 16:08:32 GMT	[thread overview]
Message-ID: <178611891228.1.3734291539024009670.rpms-chromium-fe4b6492581b@fedoraproject.org> (raw)

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
+ 

                 reply	other threads:[~2026-08-07 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178611891228.1.3734291539024009670.rpms-chromium-fe4b6492581b@fedoraproject.org \
    --to=than@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox