diff --git a/.SRCINFO b/.SRCINFO index eb48d0e..7f3abb8 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -68,10 +68,18 @@ pkgbase = firedragon backup = usr/lib/firedragon/firedragon.cfg backup = usr/lib/firedragon/distribution/policies.json source = https://gitlab.com/api/v4/projects/55893651/packages/generic/firedragon/11.13.1-1/firedragon-v11.13.1-1.source.tar.zst + source = patch-python3.12-bug1831512.patch + source = patch-python3.12-bug1860051.patch + source = patch-python3.12-bug1866829.patch + source = patch-python3.12-bug1874280.patch source = rustup.sh::https://sh.rustup.rs source = https://gitlab.com/garuda-linux/firedragon/settings/-/raw/master/firedragon.psd source = firedragon.desktop sha256sums = 1ad498bfd401b961611915ffb256ae62a9bacf6d5b207fff93058031309145d8 + sha256sums = 9516c36c145d365c3b65153d83a5b3b0dd8a319b5c30d47a390070892bd431b3 + sha256sums = 168d16a027a81c311c58f9302858244dfa5517f0a95a8d3df1abbf9b93b9d455 + sha256sums = df27ed1e0da5b192224978dc2a593a97e18e6e22062c611fc32b277500324e62 + sha256sums = cf1c69fd3338fd8f5e482f55b669160b08dfb021f2348b620f0a85dd9dee8150 sha256sums = 32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428 sha256sums = 61355930cc59813e7e610ffdab8a01e32be980fffe1dfd8f9654b8f8f9f7fdc0 sha256sums = 53d3e743f3750522318a786befa196237892c93f20571443fdf82a480e7f0560 diff --git a/PKGBUILD b/PKGBUILD index 7709775..937e611 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -78,10 +78,18 @@ options=(!debug backup=("usr/lib/${pkgname}/${pkgname}.cfg" "usr/lib/${pkgname}/distribution/policies.json") source=(https://gitlab.com/api/v4/projects/55893651/packages/generic/firedragon/${_pkgver}/firedragon-v${_pkgver}.source.tar.zst + patch-python3.12-bug1831512.patch + patch-python3.12-bug1860051.patch + patch-python3.12-bug1866829.patch + patch-python3.12-bug1874280.patch rustup.sh::https://sh.rustup.rs https://gitlab.com/garuda-linux/firedragon/settings/-/raw/master/firedragon.psd "${pkgname}.desktop") sha256sums=('1ad498bfd401b961611915ffb256ae62a9bacf6d5b207fff93058031309145d8' + '9516c36c145d365c3b65153d83a5b3b0dd8a319b5c30d47a390070892bd431b3' + '168d16a027a81c311c58f9302858244dfa5517f0a95a8d3df1abbf9b93b9d455' + 'df27ed1e0da5b192224978dc2a593a97e18e6e22062c611fc32b277500324e62' + 'cf1c69fd3338fd8f5e482f55b669160b08dfb021f2348b620f0a85dd9dee8150' '32a680a84cf76014915b3f8aa44e3e40731f3af92cd45eb0fcc6264fd257c428' '61355930cc59813e7e610ffdab8a01e32be980fffe1dfd8f9654b8f8f9f7fdc0' '53d3e743f3750522318a786befa196237892c93f20571443fdf82a480e7f0560') @@ -108,6 +116,12 @@ prepare() { export PATH="${srcdir}/cargo/bin:$PATH" cd firedragon-v"${_pkgver}" || exit + + patch -Nsp1 -i "${srcdir}/patch-python3.12-bug1831512.patch" + patch -Nsp1 -i "${srcdir}/patch-python3.12-bug1860051.patch" + patch -Nsp1 -i "${srcdir}/patch-python3.12-bug1866829.patch" + patch -Nsp1 -i "${srcdir}/patch-python3.12-bug1874280.patch" + cat > ../mozconfig << END ac_add_options --with-app-basename=${_pkgname} ac_add_options --with-app-name=${pkgname} diff --git a/patch-python3.12-bug1831512.patch b/patch-python3.12-bug1831512.patch new file mode 100644 index 0000000..8f3f782 --- /dev/null +++ b/patch-python3.12-bug1831512.patch @@ -0,0 +1,47 @@ +Bug 1831512 [wpt PR 39861] - Remove use of deprecated imp module, a=testonly + +Automatic update from web-platform-tests +Remove use of deprecated imp module + +This was being used to load browser modules from a path specified in a +config file. That would presumably allow vendors to define an +out-of-tree browser module. But in practice vendors are defining the +browser modules in-tree (and it would be very difficult to define a +browser out of tree without suffering frequent breakage). So since imp +is deprecated just remove the entire feature. + +wpt-commits: 67699587804dfd8b77b77eb528f155a42e14906b +wpt-pr: 39861 + + +diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py +--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py ++++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/products.py +@@ -1,26 +1,19 @@ + # mypy: allow-untyped-defs +- + import importlib +-import imp + + from .browsers import product_list + + + def product_module(config, product): + if product not in product_list: + raise ValueError("Unknown product %s" % product) + +- path = config.get("products", {}).get(product, None) +- if path: +- module = imp.load_source('wptrunner.browsers.' + product, path) +- else: +- module = importlib.import_module("wptrunner.browsers." + product) +- ++ module = importlib.import_module("wptrunner.browsers." + product) + if not hasattr(module, "__wptrunner__"): + raise ValueError("Product module does not define __wptrunner__ variable") + + return module + + + class Product: + def __init__(self, config, product): diff --git a/patch-python3.12-bug1860051.patch b/patch-python3.12-bug1860051.patch new file mode 100644 index 0000000..352dd5e --- /dev/null +++ b/patch-python3.12-bug1860051.patch @@ -0,0 +1,91 @@ +Bug 1860051 - Remove use of six in mainfestupdate, r=Sasha + +Differential Revision: https://phabricator.services.mozilla.com/D191624 + +diff --git a/testing/web-platform/manifestupdate.py b/testing/web-platform/manifestupdate.py +--- a/testing/web-platform/manifestupdate.py ++++ b/testing/web-platform/manifestupdate.py +@@ -1,24 +1,23 @@ + # This Source Code Form is subject to the terms of the Mozilla Public + # 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/. + + import argparse ++import configparser + import errno + import hashlib + import os + import sys + + import manifestdownload +-import six + from mach.util import get_state_dir + from mozfile import load_source + from mozlog.structured import commandline +-from six.moves import configparser + from wptrunner import wptcommandline + + manifest = None + + + def do_delayed_imports(wpt_dir): + global manifest + load_source("localpaths", os.path.join(wpt_dir, "tests", "tools", "localpaths.py")) +@@ -108,17 +107,17 @@ def run(src_root, obj_root, logger=None, + if not os.path.exists(config_path): + logger.critical("Config file %s does not exist" % config_path) + return None + + logger.debug("Using config path %s" % config_path) + + test_paths = wptcommandline.get_test_paths(wptcommandline.config.read(config_path)) + +- for paths in six.itervalues(test_paths): ++ for paths in test_paths.values(): + if "manifest_path" not in paths: + paths["manifest_path"] = os.path.join( + paths["metadata_path"], "MANIFEST.json" + ) + + ensure_manifest_directories(logger, test_paths) + + local_config = read_local_config(src_wpt_dir) +@@ -146,17 +145,17 @@ def run(src_root, obj_root, logger=None, + rebuild=kwargs["rebuild"], + cache_root=kwargs["cache_root"], + ) + + return manifests + + + def ensure_manifest_directories(logger, test_paths): +- for paths in six.itervalues(test_paths): ++ for paths in test_paths.values(): + manifest_dir = os.path.dirname(paths["manifest_path"]) + if not os.path.exists(manifest_dir): + logger.info("Creating directory %s" % manifest_dir) + # Even though we just checked the path doesn't exist, there's a chance + # of race condition with another process or thread having created it in + # between. This happens during tests. + try: + os.makedirs(manifest_dir) +@@ -226,17 +225,17 @@ def load_and_update( + test_paths, + rebuild=False, + config_dir=None, + cache_root=None, + update=True, + ): + rv = {} + wptdir_hash = hashlib.sha256(os.path.abspath(wpt_dir).encode()).hexdigest() +- for url_base, paths in six.iteritems(test_paths): ++ for url_base, paths in test_paths.items(): + manifest_path = paths["manifest_path"] + this_cache_root = os.path.join( + cache_root, wptdir_hash, os.path.dirname(paths["manifest_rel_path"]) + ) + m = manifest.manifest.load_and_update( + paths["tests_path"], + manifest_path, + url_base, + diff --git a/patch-python3.12-bug1866829.patch b/patch-python3.12-bug1866829.patch new file mode 100644 index 0000000..458d503 --- /dev/null +++ b/patch-python3.12-bug1866829.patch @@ -0,0 +1,151 @@ +Bug 1866829 - Replace obsolete distutils reference by portable alternatives r=ahochheiden + +distutils.dir_util.copy_tree -> shutil.copytree +distutils.spawn.find_executable -> shutil.which + +Also fix a warning about escape sequence in the process. + +Differential Revision: https://phabricator.services.mozilla.com/D194781 + +diff --git a/testing/mozbase/mozdevice/mozdevice/adb.py b/testing/mozbase/mozdevice/mozdevice/adb.py +--- a/testing/mozbase/mozdevice/mozdevice/adb.py ++++ b/testing/mozbase/mozdevice/mozdevice/adb.py +@@ -10,17 +10,17 @@ import re + import shlex + import shutil + import signal + import subprocess + import sys + import tempfile + import time + import traceback +-from distutils import dir_util ++from shutil import copytree + from threading import Thread + + import six + from six.moves import range + + from . import version_codes + + _TEST_ROOT = None +@@ -2978,17 +2978,17 @@ class ADBDevice(ADBCommand): + if os.path.isfile(local) and self.is_dir(remote): + # force push to use the correct filename in the remote directory + remote = posixpath.join(remote, os.path.basename(local)) + elif os.path.isdir(local): + copy_required = True + temp_parent = tempfile.mkdtemp() + remote_name = os.path.basename(remote) + new_local = os.path.join(temp_parent, remote_name) +- dir_util.copy_tree(local, new_local) ++ copytree(local, new_local) + local = new_local + # See do_sync_push in + # https://android.googlesource.com/platform/system/core/+/master/adb/file_sync_client.cpp + # Work around change in behavior in adb 1.0.36 where if + # the remote destination directory exists, adb push will + # copy the source directory *into* the destination + # directory otherwise it will copy the source directory + # *onto* the destination directory. +@@ -3131,17 +3131,17 @@ class ADBDevice(ADBCommand): + self.cp(remote, intermediate, recursive=True, timeout=timeout) + self.command_output(["pull", intermediate, local], timeout=timeout) + except ADBError as e: + self._logger.error("pull %s %s: %s" % (intermediate, local, str(e))) + finally: + self.rm(intermediate, recursive=True, force=True, timeout=timeout) + finally: + if copy_required: +- dir_util.copy_tree(local, original_local) ++ copytree(local, original_local, dirs_exist_ok=True) + shutil.rmtree(temp_parent) + + def get_file(self, remote, offset=None, length=None, timeout=None): + """Pull file from device and return the file's content + + :param str remote: The path of the remote file. + :param offset: If specified, return only content beyond this offset. + :param length: If specified, limit content length accordingly. +diff --git a/testing/mozbase/mozdevice/mozdevice/remote_process_monitor.py b/testing/mozbase/mozdevice/mozdevice/remote_process_monitor.py +--- a/testing/mozbase/mozdevice/mozdevice/remote_process_monitor.py ++++ b/testing/mozbase/mozdevice/mozdevice/remote_process_monitor.py +@@ -130,17 +130,17 @@ class RemoteProcessMonitor: + if message.get("action") == "test_start": + self.last_test_seen = message["test"] + elif message.get("action") == "test_end": + self.last_test_seen = "{} (finished)".format(message["test"]) + elif message.get("action") == "suite_end": + self.last_test_seen = "Last test finished" + elif message.get("action") == "log": + line = message["message"].strip() +- m = re.match(".*:\s*(\d*)", line) ++ m = re.match(r".*:\s*(\d*)", line) + if m: + try: + val = int(m.group(1)) + if "Passed:" in line: + self.counts["pass"] += val + self.last_test_seen = "Last test finished" + elif "Failed:" in line: + self.counts["fail"] += val +diff --git a/testing/mozbase/mozrunner/mozrunner/application.py b/testing/mozbase/mozrunner/mozrunner/application.py +--- a/testing/mozbase/mozrunner/mozrunner/application.py ++++ b/testing/mozbase/mozrunner/mozrunner/application.py +@@ -1,16 +1,16 @@ + # This Source Code Form is subject to the terms of the Mozilla Public + # 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/. + + import os + import posixpath + from abc import ABCMeta, abstractmethod +-from distutils.spawn import find_executable ++from shutil import which + + import six + from mozdevice import ADBDeviceFactory + from mozprofile import ( + ChromeProfile, + ChromiumProfile, + FirefoxProfile, + Profile, +@@ -46,17 +46,17 @@ class RemoteContext(object): + profile_class = Profile + _bindir = None + remote_test_root = "" + remote_process = None + + @property + def bindir(self): + if self._bindir is None: +- paths = [find_executable("emulator")] ++ paths = [which("emulator")] + paths = [p for p in paths if p is not None if os.path.isfile(p)] + if not paths: + self._bindir = "" + else: + self._bindir = os.path.dirname(paths[0]) + return self._bindir + + @property +@@ -83,17 +83,17 @@ class RemoteContext(object): + return self._remote_profile + + def which(self, binary): + paths = os.environ.get("PATH", {}).split(os.pathsep) + if self.bindir is not None and os.path.abspath(self.bindir) not in paths: + paths.insert(0, os.path.abspath(self.bindir)) + os.environ["PATH"] = os.pathsep.join(paths) + +- return find_executable(binary) ++ return which(binary) + + @abstractmethod + def stop_application(self): + """Run (device manager) command to stop application.""" + pass + + + devices = {} + diff --git a/patch-python3.12-bug1874280.patch b/patch-python3.12-bug1874280.patch new file mode 100644 index 0000000..56b7791 --- /dev/null +++ b/patch-python3.12-bug1874280.patch @@ -0,0 +1,30 @@ +Bug 1874280 - use ConfigParser instead of SafeConfigParser for manifestupdate.py r=jgraham + +Since our minimum supported Python version is 3.7, we can unconditionally +change to ConfigParser here. + +Differential Revision: https://phabricator.services.mozilla.com/D198327 + +diff --git a/testing/web-platform/manifestupdate.py b/testing/web-platform/manifestupdate.py +--- a/testing/web-platform/manifestupdate.py ++++ b/testing/web-platform/manifestupdate.py +@@ -170,17 +170,17 @@ def ensure_manifest_directories(logger, + raise + elif not os.path.isdir(manifest_dir): + raise IOError("Manifest directory is a file") + + + def read_local_config(wpt_dir): + src_config_path = os.path.join(wpt_dir, "wptrunner.ini") + +- parser = configparser.SafeConfigParser() ++ parser = configparser.ConfigParser() + success = parser.read(src_config_path) + assert src_config_path in success + return parser + + + def generate_config(logger, repo_root, wpt_dir, dest_path, force_rewrite=False): + """Generate the local wptrunner.ini file to use locally""" + if not os.path.exists(dest_path): +