From 811d1ba06142bdeb8002298d5e109dd4f3ab520d Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Mon, 6 Jun 2022 00:07:23 +0200 Subject: [PATCH] upstream fixes for python 3.10 (stripped down and adjusted for 78.*) --- mozjs78.spec | 2 + python3.10.patch | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 python3.10.patch diff --git a/mozjs78.spec b/mozjs78.spec index e5896b8..2657ce2 100644 --- a/mozjs78.spec +++ b/mozjs78.spec @@ -18,6 +18,7 @@ Patch2: include-configure-script.patch Patch3: x32.patch Patch4: %{name}-x32-rust.patch Patch5: arm.patch +Patch6: python3.10.patch URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey BuildRequires: autoconf2_13 >= 2.13 BuildRequires: cargo @@ -81,6 +82,7 @@ Pliki nagłówkowe do biblioteki JavaScript. %patch4 -p1 %endif %patch5 -p1 +%patch6 -p1 %build export PYTHON="%{__python}" diff --git a/python3.10.patch b/python3.10.patch new file mode 100644 index 0000000..7f28753 --- /dev/null +++ b/python3.10.patch @@ -0,0 +1,105 @@ + +# HG changeset patch +# User Emilio Cobos Álvarez +# Date 1625585189 0 +# Node ID 2418633d529c6df00a83e973295eed0e891990a6 +# Parent 0b5bfe85b344b34894f72176099da78c3849b5cc +Bug 1719144 - Fix various imports for Python 3.10. r=firefox-build-system-reviewers,mhentges + +These are enough for me to run bootstrap+configure+build. + +Some touch third-party code (gyp), but per discussion in the earlier +versions of this revision that seems fine. + +Differential Revision: https://phabricator.services.mozilla.com/D119080 + +diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py +--- a/python/mozbuild/mozbuild/backend/configenvironment.py ++++ b/python/mozbuild/mozbuild/backend/configenvironment.py +@@ -4,17 +4,18 @@ + + from __future__ import absolute_import, print_function + + import os + import six + import sys + import json + +-from collections import Iterable, OrderedDict ++from collections.abc import Iterable ++from collections import OrderedDict + from types import ModuleType + + import mozpack.path as mozpath + + from mozbuild.util import ( + FileAvoidWrite, + memoized_property, + ReadOnlyDict, +diff --git a/python/mozbuild/mozbuild/makeutil.py b/python/mozbuild/mozbuild/makeutil.py +--- a/python/mozbuild/mozbuild/makeutil.py ++++ b/python/mozbuild/mozbuild/makeutil.py +@@ -2,17 +2,17 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + + from __future__ import absolute_import, print_function, unicode_literals + + import os + import re + import six +-from collections import Iterable ++from collections.abc import Iterable + + + class Makefile(object): + '''Provides an interface for writing simple makefiles + + Instances of this class are created, populated with rules, then + written. + ''' +diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py +--- a/python/mozbuild/mozbuild/util.py ++++ b/python/mozbuild/mozbuild/util.py +@@ -804,17 +805,17 @@ class HierarchicalStringList(object): + __slots__ = ('_strings', '_children') + + def __init__(self): + # Please change ContextDerivedTypedHierarchicalStringList in context.py + # if you make changes here. + self._strings = StrictOrderingOnAppendList() + self._children = {} + +- class StringListAdaptor(collections.Sequence): ++ class StringListAdaptor(collections.abc.Sequence): + def __init__(self, hsl): + self._hsl = hsl + + def __getitem__(self, index): + return self._hsl._strings[index] + + def __len__(self): + return len(self._hsl._strings) +diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py +--- a/testing/mozbase/manifestparser/manifestparser/filters.py ++++ b/testing/mozbase/manifestparser/manifestparser/filters.py +@@ -7,17 +7,18 @@ A filter is a callable that accepts an i + dictionary of values, and returns a new iterable of test objects. It is + possible to define custom filters if the built-in ones are not enough. + """ + + from __future__ import absolute_import + + import itertools + import os +-from collections import defaultdict, MutableSequence ++from collections import defaultdict ++from collections.abc import MutableSequence + + import six + from six import string_types + + from .expression import ( + parse, + ParseError, + ) -- 2.44.0