Browse Source

clean up build files and reshuffle at the end of the queue

Frank-Rainer Grahl 1 month ago
parent
commit
20e48af095

+ 65 - 77
mozilla-release/patches/1377445-2no3-89a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1618883823 0
 # Node ID 0ce69d9f596b3910876f4838c5b04250a553b9c4
-# Parent  8a5f94f0c1a1858913ad485c208862dc331b4750
+# Parent  e1e6bb90e15a555f872492a154c053aff7c56a6b
 Bug 1377445 - Remove build dependencies on gtk+2. r=firefox-build-system-reviewers,mhentges
 
 Differential Revision: https://phabricator.services.mozilla.com/D111997
@@ -119,7 +119,7 @@ diff --git a/old-configure.in b/old-configure.in
  dnl Set various checks
  dnl ========================================================
  MISSING_X=
-@@ -1755,21 +1754,16 @@ if test "$COMPILE_ENVIRONMENT"; then
+@@ -1775,21 +1774,16 @@ if test "$COMPILE_ENVIRONMENT"; then
      dnl GDK_VERSION_MIN_REQUIRED is not set here as GDK3 deprecated warnings
      dnl are suppressed by widget/gtk/compat-gtk3/gdk/gdkversionmacros.h.
      AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MAX_ALLOWED)
@@ -226,31 +226,27 @@ diff --git a/python/mozboot/mozboot/freebsd.py b/python/mozboot/mozboot/freebsd.
              'v4l_compat',
              'yasm',
          ]
-diff --git a/python/mozboot/mozboot/gentoo.py.1377445.later b/python/mozboot/mozboot/gentoo.py.1377445.later
-new file mode 100644
---- /dev/null
-+++ b/python/mozboot/mozboot/gentoo.py.1377445.later
-@@ -0,0 +1,20 @@
-+--- gentoo.py
-++++ gentoo.py
-+@@ -46,17 +46,16 @@ class GentooBootstrapper(LinuxBootstrapp
-+             [
-+                 "emerge",
-+                 "--oneshot",
-+                 "--noreplace",
-+                 "--quiet",
-+                 "--newuse",
-+                 "dev-libs/dbus-glib",
-+                 "media-sound/pulseaudio",
-+-                "x11-libs/gtk+:2",
-+                 "x11-libs/gtk+:3",
-+                 "x11-libs/libXt",
-+             ]
-+         )
-+ 
-+     def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
-+         self.run_as_root(["emerge", "--noreplace", "--quiet", "dev-java/openjdk-bin"])
-+ 
+diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
+--- a/python/mozboot/mozboot/gentoo.py
++++ b/python/mozboot/mozboot/gentoo.py
+@@ -41,17 +41,16 @@ class GentooBootstrapper(
+ 
+     def ensure_browser_packages(self, artifact_mode=False):
+         # TODO: Figure out what not to install for artifact mode
+         self.run_as_root(['emerge',
+                           '--oneshot', '--noreplace', '--quiet', '--newuse',
+                           'dev-lang/yasm',
+                           'dev-libs/dbus-glib',
+                           'media-sound/pulseaudio',
+-                          'x11-libs/gtk+:2',
+                           'x11-libs/gtk+:3',
+                           'x11-libs/libXt'
+                           ])
+ 
+     def ensure_mobile_android_packages(self, artifact_mode=False):
+         self.run_as_root(['emerge', '--noreplace', '--quiet',
+                           'dev-java/openjdk-bin'])
+ 
 diff --git a/python/mozboot/mozboot/openbsd.py b/python/mozboot/mozboot/openbsd.py
 --- a/python/mozboot/mozboot/openbsd.py
 +++ b/python/mozboot/mozboot/openbsd.py
@@ -272,56 +268,48 @@ diff --git a/python/mozboot/mozboot/openbsd.py b/python/mozboot/mozboot/openbsd.
      def install_system_packages(self):
          # we use -z because there's no other way to say "any autoconf-2.13"
          self.run_as_root(['pkg_add', '-z'] + self.packages)
-diff --git a/python/mozboot/mozboot/opensuse.py.1377445.later b/python/mozboot/mozboot/opensuse.py.1377445.later
-new file mode 100644
---- /dev/null
-+++ b/python/mozboot/mozboot/opensuse.py.1377445.later
-@@ -0,0 +1,20 @@
-+--- opensuse.py
-++++ opensuse.py
-+@@ -26,17 +26,16 @@ class OpenSUSEBootstrapper(LinuxBootstra
-+         "gtk3-devel",
-+         "dbus-1-glib-devel",
-+         "gconf2-devel",
-+         "glibc-devel-static",
-+         "libstdc++-devel",
-+         "libXt-devel",
-+         "libproxy-devel",
-+         "libuuid-devel",
-+-        "gtk2-devel",
-+         "clang-devel",
-+         "patterns-gnome-devel_gnome",
-+     ]
-+ 
-+     BROWSER_GROUP_PACKAGES = [
-+         "devel_C_C++",
-+         "devel_gnome",
-+     ]
-diff --git a/python/mozboot/mozboot/solus.py.1377445.later b/python/mozboot/mozboot/solus.py.1377445.later
-new file mode 100644
---- /dev/null
-+++ b/python/mozboot/mozboot/solus.py.1377445.later
-@@ -0,0 +1,20 @@
-+--- solus.py
-++++ solus.py
-+@@ -27,17 +27,16 @@ class SolusBootstrapper(LinuxBootstrappe
-+     ]
-+     SYSTEM_COMPONENTS = [
-+         "system.devel",
-+     ]
-+ 
-+     BROWSER_PACKAGES = [
-+         "alsa-lib",
-+         "dbus",
-+-        "libgtk-2",
-+         "libgtk-3",
-+         "libevent",
-+         "libvpx",
-+         "libxt",
-+         "nasm",
-+         "libstartup-notification",
-+         "gst-plugins-base",
-+         "gst-plugins-good",
+diff --git a/python/mozboot/mozboot/opensuse.py b/python/mozboot/mozboot/opensuse.py
+--- a/python/mozboot/mozboot/opensuse.py
++++ b/python/mozboot/mozboot/opensuse.py
+@@ -32,17 +32,16 @@ class OpenSUSEBootstrapper(
+         'dbus-1-glib-devel',
+         'gconf2-devel',
+         'glibc-devel-static',
+         'libstdc++-devel',
+         'libXt-devel',
+         'libproxy-devel',
+         'libuuid-devel',
+         'yasm',
+-        'gtk2-devel',
+         'clang-devel',
+         'patterns-gnome-devel_gnome',
+     ]
+ 
+     BROWSER_GROUP_PACKAGES = [
+         'devel_C_C++',
+         'devel_gnome',
+     ]
+diff --git a/python/mozboot/mozboot/solus.py b/python/mozboot/mozboot/solus.py
+--- a/python/mozboot/mozboot/solus.py
++++ b/python/mozboot/mozboot/solus.py
+@@ -32,17 +32,16 @@ class SolusBootstrapper(
+     ]
+     SYSTEM_COMPONENTS = [
+         'system.devel',
+     ]
+ 
+     BROWSER_PACKAGES = [
+         'alsa-lib',
+         'dbus',
+-        'libgtk-2',
+         'libgtk-3',
+         'libevent',
+         'libvpx',
+         'libxt',
+         'nasm',
+         'libstartup-notification',
+         'gst-plugins-base',
+         'gst-plugins-good',
 diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
 --- a/toolkit/library/moz.build
 +++ b/toolkit/library/moz.build

+ 50 - 0
mozilla-release/patches/1507272-1-88a1.patch

@@ -0,0 +1,50 @@
+# HG changeset patch
+# User Mitchell Hentges <mhentges@mozilla.com>
+# Date 1615565232 0
+# Node ID 5629a873f547642f76f049bd5322472f54799d2c
+# Parent  3b71392c6a2275f9ab5401385639065f2e226f27
+Bug 1507272: Removes unused parameter in bootstrap function r=firefox-build-system-reviewers,glandium
+
+Differential Revision: https://phabricator.services.mozilla.com/D106813
+
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -460,17 +460,17 @@ def current_firefox_checkout(env, hg=Non
+         path, child = os.path.split(path)
+         if child == '':
+             break
+ 
+     raise UserError('Could not identify the root directory of your checkout! '
+                     'Are you running `mach bootstrap` in an hg or git clone?')
+ 
+ 
+-def update_git_tools(git, root_state_dir, top_src_dir):
++def update_git_tools(git, root_state_dir):
+     """Update git tools, hooks and extensions"""
+     # Ensure git-cinnabar is up to date.
+     cinnabar_dir = os.path.join(root_state_dir, 'git-cinnabar')
+ 
+     # Ensure the latest revision of git-cinnabar is present.
+     update_git_repo(git, 'https://github.com/glandium/git-cinnabar.git',
+                     cinnabar_dir)
+ 
+@@ -521,17 +521,17 @@ def configure_git(git, root_state_dir, t
+             old_version=git_version,
+             minimum_recommended_version=MINIMUM_RECOMMENDED_GIT_VERSION))
+ 
+     if git_version >= LooseVersion('2.17'):
+         # "core.untrackedCache" has a bug before 2.17
+         subprocess.check_call(
+             [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
+ 
+-    cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
++    cinnabar_dir = update_git_tools(git, root_state_dir)
+ 
+     print(ADD_GIT_TOOLS_PATH.format(cinnabar_dir))
+ 
+ 
+ def _warn_if_risky_revision(path):
+     # Warn the user if they're trying to bootstrap from an obviously old
+     # version of tree as reported by the version control system (a month in
+     # this case). This is an approximate calculation but is probably good

+ 52 - 0
mozilla-release/patches/1519636-11-68a1.patch

@@ -0,0 +1,52 @@
+# HG changeset patch
+# User Sylvestre Ledru <sledru@mozilla.com>
+# Date 1553672004 0
+#      Wed Mar 27 07:33:24 2019 +0000
+# Node ID fa3daa92292dde4bf9405c56e43a464e53c349a2
+# Parent  79f6afbc9059b4210a7e1cf0864a62919ca5d018
+Bug 1519636 - Ride along: Add media/libdav1d/version.h to the ignore list r=andi
+
+Differential Revision: https://phabricator.services.mozilla.com/D24558
+
+diff --git a/.clang-format-ignore b/.clang-format-ignore
+--- a/.clang-format-ignore
++++ b/.clang-format-ignore
+@@ -62,16 +62,17 @@ ipc/chromium/.*
+ js/src/ctypes/libffi/.*
+ js/src/dtoa.c.*
+ js/src/jit/arm64/vixl/.*
+ media/ffvpx/.*
+ media/gmp-clearkey/0.1/openaes/.*
+ media/kiss_fft/.*
+ media/libav/.*
+ media/libcubeb/.*
++media/libdav1d/version.h
+ media/libjpeg/.*
+ media/libmkv/.*
+ media/libnestegg/.*
+ media/libogg/.*
+ media/libopus/.*
+ media/libpng/.*
+ media/libsoundtouch/.*
+ media/libspeex_resampler/.*
+diff --git a/tools/rewriting/ThirdPartyPaths.txt b/tools/rewriting/ThirdPartyPaths.txt
+--- a/tools/rewriting/ThirdPartyPaths.txt
++++ b/tools/rewriting/ThirdPartyPaths.txt
+@@ -25,16 +25,17 @@ js/src/ctypes/libffi/
+ js/src/dtoa.c
+ js/src/jit/arm64/vixl/
+ js/src/vtune/ittnotify_config.h
+ media/ffvpx/
+ media/gmp-clearkey/0.1/openaes/
+ media/kiss_fft/
+ media/libav/
+ media/libcubeb/
++media/libdav1d/version.h
+ media/libjpeg/
+ media/libmkv/
+ media/libnestegg/
+ media/libogg/
+ media/libopus/
+ media/libpng/
+ media/libsoundtouch/
+ media/libspeex_resampler/

+ 54 - 0
mozilla-release/patches/1519636-20-69a1.patch

@@ -0,0 +1,54 @@
+# HG changeset patch
+# User Ehsan Akhgari <ehsan@mozilla.com>
+# Date 1561707478 0
+#      Fri Jun 28 07:37:58 2019 +0000
+# Node ID 98eb0b753429a9da45154a18c3779e7840c72619
+# Parent  21d501143e0b3a29f7bbd98705077ad0deb411ff
+Bug 1519636 - Mark the entire media/libdav1d directory as third-party; r=andi
+
+Differential Revision: https://phabricator.services.mozilla.com/D35474
+
+diff --git a/.clang-format-ignore b/.clang-format-ignore
+--- a/.clang-format-ignore
++++ b/.clang-format-ignore
+@@ -62,17 +62,17 @@ ipc/chromium/.*
+ js/src/ctypes/libffi/.*
+ js/src/dtoa.c.*
+ js/src/jit/arm64/vixl/.*
+ media/ffvpx/.*
+ media/gmp-clearkey/0.1/openaes/.*
+ media/kiss_fft/.*
+ media/libav/.*
+ media/libcubeb/.*
+-media/libdav1d/version.h
++media/libdav1d/.*
+ media/libjpeg/.*
+ media/libmkv/.*
+ media/libnestegg/.*
+ media/libogg/.*
+ media/libopus/.*
+ media/libpng/.*
+ media/libsoundtouch/.*
+ media/libspeex_resampler/.*
+diff --git a/tools/rewriting/ThirdPartyPaths.txt b/tools/rewriting/ThirdPartyPaths.txt
+--- a/tools/rewriting/ThirdPartyPaths.txt
++++ b/tools/rewriting/ThirdPartyPaths.txt
+@@ -25,17 +25,17 @@ js/src/ctypes/libffi/
+ js/src/dtoa.c
+ js/src/jit/arm64/vixl/
+ js/src/vtune/ittnotify_config.h
+ media/ffvpx/
+ media/gmp-clearkey/0.1/openaes/
+ media/kiss_fft/
+ media/libav/
+ media/libcubeb/
+-media/libdav1d/version.h
++media/libdav1d/
+ media/libjpeg/
+ media/libmkv/
+ media/libnestegg/
+ media/libogg/
+ media/libopus/
+ media/libpng/
+ media/libsoundtouch/
+ media/libspeex_resampler/

+ 0 - 0
mozilla-release/patches/1519636-xx-elfhack-112a1.patch → mozilla-release/patches/1519636-74-elfhack-112a1.patch


+ 0 - 0
mozilla-release/patches/1519636-xx-elfhack-130a1.patch → mozilla-release/patches/1519636-80-elfhack-130a1.patch


+ 179 - 0
mozilla-release/patches/1630317-77a1.patch

@@ -0,0 +1,179 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1586984338 0
+# Node ID 32a048d1d8035a8801431614e2781af98aa9c6a9
+# Parent  d5b5e31f48ab78158f921e594cfde70776a248ae
+Bug 1630317 - Add a warning if there is an attempt to mach bootstrap from an "old commit" r=nalexander
+
+Differential Revision: https://phabricator.services.mozilla.com/D71076
+
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -1,20 +1,21 @@
+ # 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/.
+ 
+ from __future__ import absolute_import, print_function, unicode_literals
+ 
+ from collections import OrderedDict
+ 
++import os
+ import platform
+ import sys
+-import os
+ import subprocess
++import time
+ 
+ # NOTE: This script is intended to be run with a vanilla Python install.  We
+ # have to rely on the standard library instead of Python 2+3 helpers like
+ # the six module.
+ if sys.version_info < (3,):
+     from ConfigParser import (
+         Error as ConfigParserError,
+         RawConfigParser,
+@@ -125,16 +126,25 @@ may be called ~/.bashrc or ~/.bash_profi
+ lines:
+ 
+     export PATH="{}:$PATH"
+ 
+ Then restart your shell.
+ '''
+ 
+ 
++OLD_REVISION_WARNING = '''
++WARNING! You appear to be running `mach bootstrap` from an old revision.
++bootstrap is meant primarily for getting developer environments up-to-date to
++build the latest version of tree. Running bootstrap on old revisions may fail
++and is not guaranteed to bring your machine to any working state in particular.
++Proceed at your own peril.
++'''
++
++
+ class Bootstrapper(object):
+     """Main class that performs system bootstrap."""
+ 
+     def __init__(self, choice=None, no_interactive=False, hg_configure=False,
+                  no_system_changes=False, mach_context=None):
+         self.instance = None
+         self.choice = choice
+         self.hg_configure = hg_configure
+@@ -417,28 +427,30 @@ def current_firefox_checkout(env, hg=Non
+         git_dir = os.path.join(path, '.git')
+         if hg and os.path.exists(hg_dir):
+             # Verify the hg repo is a Firefox repo by looking at rev 0.
+             try:
+                 node = subprocess.check_output(
+                     [hg, 'log', '-r', '0', '--template', '{node}'],
+                     cwd=path, env=env, universal_newlines=True)
+                 if node in HG_ROOT_REVISIONS:
++                    _warn_if_risky_revision(path)
+                     return ('hg', path)
+                 # Else the root revision is different. There could be nested
+                 # repos. So keep traversing the parents.
+             except subprocess.CalledProcessError:
+                 pass
+ 
+         # Just check for known-good files in the checkout, to prevent attempted
+         # foot-shootings.  Determining a canonical git checkout of mozilla-unified
+         # is...complicated
+         elif os.path.exists(git_dir):
+             moz_configure = os.path.join(path, 'moz.configure')
+             if os.path.exists(moz_configure):
++                _warn_if_risky_revision(path)
+                 return ('git', path)
+ 
+         path, child = os.path.split(path)
+         if child == '':
+             break
+ 
+     raise UserError('Could not identify the root directory of your checkout! '
+                     'Are you running `mach bootstrap` in an hg or git clone?')
+@@ -486,8 +498,20 @@ def update_git_repo(git, url, dest):
+         print('=' * 80)
+ 
+ 
+ def configure_git(git, root_state_dir, top_src_dir):
+     """Run the Git configuration steps."""
+     cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
+ 
+     print(ADD_GIT_TOOLS_PATH.format(cinnabar_dir))
++
++
++def _warn_if_risky_revision(path):
++    # Warn the user if they're trying to bootstrap from an obviously old
++    # version of tree as reported by the version control system (a month in
++    # this case). This is an approximate calculation but is probably good
++    # enough for our purposes.
++    NUM_SECONDS_IN_MONTH = 60 * 60 * 24 * 30
++    from mozversioncontrol import get_repository_object
++    repo = get_repository_object(path)
++    if (time.time() - repo.get_commit_time()) >= NUM_SECONDS_IN_MONTH:
++        print(OLD_REVISION_WARNING)
+diff --git a/python/mozversioncontrol/mozversioncontrol/__init__.py b/python/mozversioncontrol/mozversioncontrol/__init__.py
+--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
++++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
+@@ -144,16 +144,21 @@ class Repository(object):
+     def head_ref(self):
+         """Hash of HEAD revision."""
+ 
+     @abc.abstractproperty
+     def base_ref(self):
+         """Hash of revision the current topic branch is based on."""
+ 
+     @abc.abstractmethod
++    def get_commit_time(self):
++        """Return the Unix time of the HEAD revision.
++        """
++
++    @abc.abstractmethod
+     def sparse_checkout_present(self):
+         """Whether the working directory is using a sparse checkout.
+ 
+         A sparse checkout is defined as a working directory that only
+         materializes a subset of files in a given revision.
+ 
+         Returns a bool.
+         """
+@@ -289,16 +294,20 @@ class HgRepository(Repository):
+     def _run(self, *args, **runargs):
+         if not self._client.server:
+             return super(HgRepository, self)._run(*args, **runargs)
+ 
+         # hglib requires bytes on python 3
+         args = [a.encode('utf-8') if not isinstance(a, bytes) else a for a in args]
+         return self._client.rawcommand(args).decode('utf-8')
+ 
++    def get_commit_time(self):
++        return int(self._run(
++            'parent', '--template', '{word(0, date|hgdate)}').strip())
++
+     def sparse_checkout_present(self):
+         # We assume a sparse checkout is enabled if the .hg/sparse file
+         # has data. Strictly speaking, we should look for a requirement in
+         # .hg/requires. But since the requirement is still experimental
+         # as of Mercurial 4.3, it's probably more trouble than its worth
+         # to verify it.
+         sparse = os.path.join(self.path, '.hg', 'sparse')
+ 
+@@ -428,16 +437,19 @@ class GitRepository(Repository):
+     @property
+     def has_git_cinnabar(self):
+         try:
+             self._run('cinnabar', '--version')
+         except subprocess.CalledProcessError:
+             return False
+         return True
+ 
++    def get_commit_time(self):
++        return int(self._run('log', '-1', '--format=%ct').strip())
++
+     def sparse_checkout_present(self):
+         # Not yet implemented.
+         return False
+ 
+     def get_upstream(self):
+         ref = self._run('symbolic-ref', '-q', 'HEAD').strip()
+         upstream = self._run('for-each-ref', '--format=%(upstream:short)', ref).strip()
+ 

+ 157 - 0
mozilla-release/patches/1631382-77a1.patch

@@ -0,0 +1,157 @@
+# HG changeset patch
+# User Gabriele Svelto <gsvelto@mozilla.com>
+# Date 1587629377 0
+# Node ID 42192ff2aa4c4dac0144b31ea39ea9aa8a3c728d
+# Parent  596680c66da388d4d01248a4b5e97483f90ac1f2
+Bug 1631382 - Update the Gentoo |mach bootstrap| implementation r=glandium
+
+This fixes multiple issues:
+* It switches mobile builds from the Oracle JDK to OpenJDK and removes all the
+  logic needed to download the former
+* It only installs the build dependencies required for building Firefox and
+  stores them in the world file
+
+Differential Revision: https://phabricator.services.mozilla.com/D71539
+
+diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
+--- a/python/mozboot/mozboot/gentoo.py
++++ b/python/mozboot/mozboot/gentoo.py
+@@ -10,121 +10,63 @@ from mozboot.linux_common import (
+     LucetcInstall,
+     NasmInstall,
+     NodeInstall,
+     SccacheInstall,
+     StyloInstall,
+     WasiSysrootInstall,
+ )
+ 
+-try:
+-    from urllib2 import urlopen
+-except ImportError:
+-    from urllib.request import urlopen
+-
+-import re
+-import subprocess
+-
+ 
+ class GentooBootstrapper(
+         NasmInstall, NodeInstall, StyloInstall, ClangStaticAnalysisInstall,
+         SccacheInstall, LucetcInstall, WasiSysrootInstall, BaseBootstrapper):
+ 
+     def __init__(self, version, dist_id, **kwargs):
+         BaseBootstrapper.__init__(self, **kwargs)
+ 
+         self.version = version
+         self.dist_id = dist_id
+ 
+     def install_system_packages(self):
+-        self.run_as_root(['emerge', '--noreplace', '--quiet', 'nodejs'])
++        self.ensure_system_packages()
+ 
+     def install_browser_packages(self):
+         self.ensure_browser_packages()
+ 
+     def install_browser_artifact_mode_packages(self):
+         self.ensure_browser_packages(artifact_mode=True)
+ 
+     def install_mobile_android_packages(self):
+         self.ensure_mobile_android_packages(artifact_mode=False)
+ 
+     def install_mobile_android_artifact_mode_packages(self):
+         self.ensure_mobile_android_packages(artifact_mode=True)
+ 
++    def ensure_system_packages(self):
++        self.run_as_root(['emerge', '--noreplace', '--quiet',
++                          'app-arch/zip',
++                          'sys-devel/autoconf:2.1'
++                          ])
++
+     def ensure_browser_packages(self, artifact_mode=False):
+         # TODO: Figure out what not to install for artifact mode
+-        self.run_as_root(['emerge', '--onlydeps', '--quiet', 'firefox'])
+-        self.run_as_root(['emerge', '--noreplace', '--quiet', 'gtk+'])
+-
+-    @staticmethod
+-    def _get_distdir():
+-        # Obtain the path held in the DISTDIR portage variable
+-        output = subprocess.check_output(
+-            ['emerge', '--info'], universal_newlines=True)
+-        match = re.search('^DISTDIR="(?P<distdir>.*)"$', output, re.MULTILINE)
+-        return match.group('distdir')
+-
+-    @staticmethod
+-    def _get_jdk_filename(emerge_output):
+-        match = re.search(r'^ \* *(?P<tarball>jdk-.*-linux-.*.tar.gz)$',
+-                          emerge_output, re.MULTILINE)
+-
+-        return match.group('tarball')
+-
+-    @staticmethod
+-    def _get_jdk_page_urls(emerge_output):
+-        urls = re.findall(r'^ \* *(https?://.*\.html)$', emerge_output,
+-                          re.MULTILINE)
+-        return [re.sub('^http://', 'https://', url) for url in urls]
+-
+-    @staticmethod
+-    def _get_jdk_url(filename, urls):
+-        for url in urls:
+-            contents = urlopen(url).read()
+-            match = re.search('.*(?P<url>https?://.*' + filename + ')',
+-                              contents, re.MULTILINE)
+-            if match:
+-                url = match.group('url')
+-                return re.sub('^http://', 'https://', url)
+-
+-        raise Exception("Could not find the JDK tarball URL")
+-
+-    def _fetch_jdk_tarball(self, filename, url):
+-        distdir = self._get_distdir()
+-        cookie = 'Cookie: oraclelicense=accept-securebackup-cookie'
+-        self.run_as_root(['wget', '--no-verbose', '--show-progress', '-c', '-O',
+-                          distdir + '/' + filename, '--header', cookie, url])
++        self.run_as_root(['emerge',
++                          '--oneshot', '--noreplace', '--quiet', '--newuse',
++                          'dev-lang/yasm',
++                          'dev-libs/dbus-glib',
++                          'media-sound/pulseaudio',
++                          'x11-libs/gtk+:2',
++                          'x11-libs/gtk+:3',
++                          'x11-libs/libXt'
++                          ])
+ 
+     def ensure_mobile_android_packages(self, artifact_mode=False):
+-        # For downloading the Oracle JDK, Android SDK and NDK.
+-        self.run_as_root(['emerge', '--noreplace', '--quiet', 'wget'])
+-
+-        # Find the JDK file name and URL(s)
+-        try:
+-            output = self.check_output(['emerge', '--pretend', '--fetchonly',
+-                                        'oracle-jdk-bin'],
+-                                       env=None,
+-                                       stderr=subprocess.STDOUT,
+-                                       universal_newlines=True)
+-        except subprocess.CalledProcessError as e:
+-            output = e.output
+-
+-        jdk_filename = self._get_jdk_filename(output)
+-        jdk_page_urls = self._get_jdk_page_urls(output)
+-        jdk_url = self._get_jdk_url(jdk_filename, jdk_page_urls)
+-
+-        # Fetch the Oracle JDK since portage can't fetch it on its own
+-        self._fetch_jdk_tarball(jdk_filename, jdk_url)
+-
+-        # Install the Oracle JDK. We explicitly prompt the user to accept the
+-        # changes because this command might need to modify the portage
+-        # configuration files and doing so without user supervision is dangerous
+         self.run_as_root(['emerge', '--noreplace', '--quiet',
+-                          '--autounmask-continue', '--ask',
+-                          'dev-java/oracle-jdk-bin'])
++                          'dev-java/openjdk-bin'])
+ 
+         self.ensure_java()
+         from mozboot import android
+         android.ensure_android('linux', artifact_mode=artifact_mode,
+                                no_interactive=self.no_interactive)
+ 
+     def suggest_mobile_android_mozconfig(self, artifact_mode=False):
+         from mozboot import android

+ 4 - 4
mozilla-release/patches/1632874-1-79a1.patch

@@ -2,7 +2,7 @@
 # User Mitchell Hentges <mhentges@mozilla.com>
 # Date 1591645016 0
 # Node ID c9c52538d77d06601c253b2efaa3b207b540318a
-# Parent  a9c196ca10dc2d3f346369471563eaf85dc42863
+# Parent  6ed5caa3c9c769d7af8a439f8deb47e3519c9c0c
 Bug 1632874: |mach bootstrap| should write mozconfig file if it doesn't exist r=rstewart
 
 Rather than always printing instructions at the end of the bootstrap phase, we will now create a mozconfig
@@ -512,9 +512,9 @@ diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py
 diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
 --- a/python/mozboot/mozboot/gentoo.py
 +++ b/python/mozboot/mozboot/gentoo.py
-@@ -113,20 +113,20 @@ class GentooBootstrapper(
-                           '--autounmask-continue', '--ask',
-                           'dev-java/oracle-jdk-bin'])
+@@ -55,20 +55,20 @@ class GentooBootstrapper(
+         self.run_as_root(['emerge', '--noreplace', '--quiet',
+                           'dev-java/openjdk-bin'])
  
          self.ensure_java()
          from mozboot import android

+ 3 - 10
mozilla-release/patches/1635834-78a1.patch

@@ -2,7 +2,7 @@
 # User Geoff Brown <gbrown@mozilla.com>
 # Date 1588964983 0
 # Node ID d97b600d3846804f429bc71154e968490f571168
-# Parent  8f58b22269ad1c3d627a57a91c82a9c049676cb0
+# Parent  45196d1463c7e8006643356f1efb1c54b1294f1d
 Bug 1635834 - Install minidump_stackwalk in 'mach bootstrap'; r=nalexander
 
 Install minidump_stackwalk as part of 'mach bootstrap' so that it is readily available
@@ -76,7 +76,7 @@ diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py
 diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
 --- a/python/mozboot/mozboot/bootstrap.py
 +++ b/python/mozboot/mozboot/bootstrap.py
-@@ -324,16 +324,17 @@ class Bootstrapper(object):
+@@ -329,16 +329,17 @@ class Bootstrapper(object):
              sys.exit(1)
  
          if not have_clone:
@@ -168,7 +168,7 @@ diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py
 diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
 --- a/python/mozboot/mozboot/gentoo.py
 +++ b/python/mozboot/mozboot/gentoo.py
-@@ -3,16 +3,17 @@
+@@ -3,26 +3,28 @@
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  
  from __future__ import absolute_import, print_function, unicode_literals
@@ -185,13 +185,6 @@ diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
      WasiSysrootInstall,
  )
  
- try:
-@@ -21,16 +22,17 @@ except ImportError:
-     from urllib.request import urlopen
- 
- import re
- import subprocess
- 
  
  class GentooBootstrapper(
          NasmInstall, NodeInstall, StyloInstall, ClangStaticAnalysisInstall,

+ 2 - 10
mozilla-release/patches/1638012-78a1.patch

@@ -2,7 +2,7 @@
 # User Nathan Froyd <froydnj@mozilla.com>
 # Date 1589819229 0
 # Node ID 69e7bacf059bcef8befee258f8a0bb631a15c4f9
-# Parent  8647434b0d2a6a1e0b4fc549a846b90832de22df
+# Parent  0055ce6a063f0556034bb8f8a0e44e7823671ef1
 Bug 1638012 - commonize taskcluster-related bootstrappers for Linux; r=nalexander
 
 This change doesn't fix all of the boilerplate involved in declaring
@@ -148,7 +148,7 @@ diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py
 diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
 --- a/python/mozboot/mozboot/gentoo.py
 +++ b/python/mozboot/mozboot/gentoo.py
-@@ -1,39 +1,29 @@
+@@ -1,31 +1,21 @@
  # 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/.
@@ -168,14 +168,6 @@ diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py
 -)
 +from mozboot.linux_common import LinuxBootstrapper
  
- try:
-     from urllib2 import urlopen
- except ImportError:
-     from urllib.request import urlopen
- 
- import re
- import subprocess
- 
  
  class GentooBootstrapper(
 -        NasmInstall, NodeInstall, StyloInstall, ClangStaticAnalysisInstall,

+ 133 - 0
mozilla-release/patches/1645196-80a1.patch

@@ -0,0 +1,133 @@
+# HG changeset patch
+# User Mitchell Hentges <mhentges@mozilla.com>
+# Date 1594385664 0
+# Node ID 422c5c783008f10b0ca3f2379a8ab5df69353eba
+# Parent  814e2d41a648868812d02c575f46df69719d0ccc
+Bug 1645196: Tune git settings to improve performance r=rstewart
+
+Also adds a warning if a user's git version is older than 2.24
+
+Differential Revision: https://phabricator.services.mozilla.com/D82128
+
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -6,16 +6,17 @@ from __future__ import absolute_import, 
+ 
+ from collections import OrderedDict
+ 
+ import os
+ import platform
+ import sys
+ import subprocess
+ import time
++from distutils.version import LooseVersion
+ 
+ # NOTE: This script is intended to be run with a vanilla Python install.  We
+ # have to rely on the standard library instead of Python 2+3 helpers like
+ # the six module.
+ if sys.version_info < (3,):
+     from ConfigParser import (
+         Error as ConfigParserError,
+         RawConfigParser,
+@@ -38,19 +39,17 @@ from mozboot.gentoo import GentooBootstr
+ from mozboot.osx import OSXBootstrapper
+ from mozboot.openbsd import OpenBSDBootstrapper
+ from mozboot.archlinux import ArchlinuxBootstrapper
+ from mozboot.solus import SolusBootstrapper
+ from mozboot.void import VoidBootstrapper
+ from mozboot.windows import WindowsBootstrapper
+ from mozboot.mozillabuild import MozillaBuildBootstrapper
+ from mozboot.mozconfig import find_mozconfig
+-from mozboot.util import (
+-    get_state_dir,
+-)
++from mozboot.util import get_state_dir
+ 
+ # Use distro package to retrieve linux platform information
+ import distro
+ 
+ APPLICATION_CHOICE = '''
+ Note on Artifact Mode:
+ 
+ Artifact builds download prebuilt C++ components rather than building
+@@ -135,16 +134,25 @@ OLD_REVISION_WARNING = '''
+ WARNING! You appear to be running `mach bootstrap` from an old revision.
+ bootstrap is meant primarily for getting developer environments up-to-date to
+ build the latest version of tree. Running bootstrap on old revisions may fail
+ and is not guaranteed to bring your machine to any working state in particular.
+ Proceed at your own peril.
+ '''
+ 
+ 
++# Version 2.24 changes the "core.commitGraph" setting to be "True" by default.
++MINIMUM_RECOMMENDED_GIT_VERSION = LooseVersion('2.24')
++OLD_GIT_WARNING = '''
++You are running an older version of git ("{old_version}").
++We recommend upgrading to at least version "{minimum_recommended_version}" to improve
++performance.
++'''.strip()
++
++
+ class Bootstrapper(object):
+     """Main class that performs system bootstrap."""
+ 
+     def __init__(self, choice=None, no_interactive=False, hg_configure=False,
+                  no_system_changes=False, mach_context=None):
+         self.instance = None
+         self.choice = choice
+         self.hg_configure = hg_configure
+@@ -495,16 +503,30 @@ def update_git_repo(git, url, dest):
+         subprocess.check_call(pull_args, cwd=cwd)
+         subprocess.check_call(update_args, cwd=dest)
+     finally:
+         print('=' * 80)
+ 
+ 
+ def configure_git(git, root_state_dir, top_src_dir):
+     """Run the Git configuration steps."""
++    from mozversioncontrol import GitRepository
++
++    repository = GitRepository(top_src_dir)
++    git_version = LooseVersion(repository.tool_version)
++
++    if git_version < MINIMUM_RECOMMENDED_GIT_VERSION:
++        print(OLD_GIT_WARNING.format(
++            old_version=git_version,
++            minimum_recommended_version=MINIMUM_RECOMMENDED_GIT_VERSION))
++
++    if git_version >= LooseVersion('2.17'):
++        # "core.untrackedCache" has a bug before 2.17
++        repository.set_config('core.untrackedCache', 'true')
++
+     cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
+ 
+     print(ADD_GIT_TOOLS_PATH.format(cinnabar_dir))
+ 
+ 
+ def _warn_if_risky_revision(path):
+     # Warn the user if they're trying to bootstrap from an obviously old
+     # version of tree as reported by the version control system (a month in
+diff --git a/python/mozversioncontrol/mozversioncontrol/__init__.py b/python/mozversioncontrol/mozversioncontrol/__init__.py
+--- a/python/mozversioncontrol/mozversioncontrol/__init__.py
++++ b/python/mozversioncontrol/mozversioncontrol/__init__.py
+@@ -527,16 +527,19 @@ class GitRepository(Repository):
+ 
+         self._run('commit', '--allow-empty', '-m', message)
+         try:
+             subprocess.check_call((self._tool, 'push', 'hg::ssh://hg.mozilla.org/try',
+                                    '+HEAD:refs/heads/branches/default/tip'), cwd=self.path)
+         finally:
+             self._run('reset', 'HEAD~')
+ 
++    def set_config(self, name, value):
++        self._run('config', name, value)
++
+ 
+ def get_repository_object(path, hg='hg', git='git'):
+     '''Get a repository object for the repository at `path`.
+     If `path` is not a known VCS repository, raise an exception.
+     '''
+     if os.path.isdir(os.path.join(path, '.hg')):
+         return HgRepository(path, hg=hg)
+     elif os.path.exists(os.path.join(path, '.git')):

+ 101 - 120
mozilla-release/patches/1647792-82a1.patch

@@ -2,7 +2,7 @@
 # User Ricky Stewart <rstewart@mozilla.com>
 # Date 1598985756 0
 # Node ID 8134800276e920f0ae7f83438d13fcea80d63776
-# Parent  6cf8892e0d257a108af8d1045e21a225ab40d23b
+# Parent  cceb47737e06b4b54b79128c61bfc250dcbb7221
 Bug 1647792 - Standalone `bootstrap.py` script clones before running `mach bootstrap` r=mhentges,froydnj,mhoye
 
 Note that when I refer to "standalone `bootstrap.py`" here, I'm referring to the file `python/mozboot/bin/bootstrap.py` and no other similarly-named file in-tree.
@@ -78,7 +78,11 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
  
 -from io import BytesIO
  from optparse import OptionParser
--
++from urllib.request import urlopen
++
++CLONE_MERCURIAL_PULL_FAIL = '''
++Failed to pull from hg.mozilla.org.
+ 
 -# NOTE: This script is intended to be run with a vanilla Python install.  We
 -# have to rely on the standard library instead of Python 2+3 helpers like
 -# the six module.
@@ -86,63 +90,6 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 -    from urllib2 import urlopen
 -except ImportError:
 -    from urllib.request import urlopen
--
--
--# The next two variables define where in the repository the Python files
--# reside. This is used to remotely download file content when it isn't
--# available locally.
--REPOSITORY_PATH_PREFIX = 'python/mozboot/'
--
--TEMPDIR = None
--
--
--def setup_proxy():
--    # Some Linux environments define ALL_PROXY, which is a SOCKS proxy
--    # intended for all protocols. Python doesn't currently automatically
--    # detect this like it does for http_proxy and https_proxy.
--    if 'ALL_PROXY' in os.environ and 'https_proxy' not in os.environ:
--        os.environ['https_proxy'] = os.environ['ALL_PROXY']
--    if 'ALL_PROXY' in os.environ and 'http_proxy' not in os.environ:
--        os.environ['http_proxy'] = os.environ['ALL_PROXY']
--
--
--def fetch_files(repo_url, repo_rev, repo_type):
--    setup_proxy()
--    repo_url = repo_url.rstrip('/')
--
--    files = {}
--
--    if repo_type == 'hgweb':
--        url = repo_url + '/archive/%s.zip/python/mozboot' % repo_rev
--        req = urlopen(url=url, timeout=30)
--        data = BytesIO(req.read())
--        data.seek(0)
--        zip = zipfile.ZipFile(data, 'r')
--        for f in zip.infolist():
--            # The paths are prefixed with the repo and revision name before the
--            # directory name.
--            offset = f.filename.find(REPOSITORY_PATH_PREFIX) + len(REPOSITORY_PATH_PREFIX)
--            name = f.filename[offset:]
--
--            # We only care about the Python modules.
--            if not name.startswith('mozboot/'):
--                continue
--
--            files[name] = zip.read(f)
--
--        # Retrieve distro script
--        url = repo_url + '/archive/%s.zip/third_party/python/distro/distro.py' % repo_rev
--        req = urlopen(url=url, timeout=30)
--        data = BytesIO(req.read())
--        data.seek(0)
--        zip = zipfile.ZipFile(data, 'r')
--        files["distro.py"] = zip.read(zip.infolist()[0])
--
-+from urllib.request import urlopen
-+
-+CLONE_MERCURIAL_PULL_FAIL = '''
-+Failed to pull from hg.mozilla.org.
-+
 +This is most likely because of unstable network connection.
 +Try running `cd %s && hg pull https://hg.mozilla.org/mozilla-unified` manually,
 +or download a mercurial bundle and use it:
@@ -153,11 +100,16 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +    'hg': 'Mercurial',
 +    'git': 'Git',
 +}
-+
-+
+ 
+ 
+-# The next two variables define where in the repository the Python files
+-# reside. This is used to remotely download file content when it isn't
+-# available locally.
+-REPOSITORY_PATH_PREFIX = 'python/mozboot/'
 +def which(name):
 +    """Python implementation of which.
-+
+ 
+-TEMPDIR = None
 +    It returns the path of an executable or None if it couldn't be found.
 +    """
 +    # git-cinnabar.exe doesn't exist, but .exe versions of the other executables
@@ -172,8 +124,16 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +            return test
 +
 +    return None
-+
-+
+ 
+ 
+-def setup_proxy():
+-    # Some Linux environments define ALL_PROXY, which is a SOCKS proxy
+-    # intended for all protocols. Python doesn't currently automatically
+-    # detect this like it does for http_proxy and https_proxy.
+-    if 'ALL_PROXY' in os.environ and 'https_proxy' not in os.environ:
+-        os.environ['https_proxy'] = os.environ['ALL_PROXY']
+-    if 'ALL_PROXY' in os.environ and 'http_proxy' not in os.environ:
+-        os.environ['http_proxy'] = os.environ['ALL_PROXY']
 +def validate_clone_dest(dest):
 +    dest = os.path.abspath(dest)
 +
@@ -186,15 +146,7 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +
 +    if not os.listdir(dest):
 +        return dest
-     else:
--        raise NotImplementedError('Not sure how to handle repo type.', repo_type)
--
--    return files
--
--
--def ensure_environment(repo_url=None, repo_rev=None, repo_type=None):
--    """Ensure we can load the Python modules necessary to perform bootstrap."""
--
++    else:
 +        print('ERROR! Destination directory %s exists but is nonempty.' %
 +              dest)
 +        return None
@@ -215,8 +167,25 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +            return dest
 +        if no_interactive:
 +            return None
-+
-+
+ 
+ 
+-def fetch_files(repo_url, repo_rev, repo_type):
+-    setup_proxy()
+-    repo_url = repo_url.rstrip('/')
+-
+-    files = {}
+-
+-    if repo_type == 'hgweb':
+-        url = repo_url + '/archive/%s.zip/python/mozboot' % repo_rev
+-        req = urlopen(url=url, timeout=30)
+-        data = BytesIO(req.read())
+-        data.seek(0)
+-        zip = zipfile.ZipFile(data, 'r')
+-        for f in zip.infolist():
+-            # The paths are prefixed with the repo and revision name before the
+-            # directory name.
+-            offset = f.filename.find(REPOSITORY_PATH_PREFIX) + len(REPOSITORY_PATH_PREFIX)
+-            name = f.filename[offset:]
 +def hg_clone_firefox(hg, dest):
 +    # We create an empty repo then modify the config before adding data.
 +    # This is necessary to ensure storage settings are optimally
@@ -233,7 +202,12 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +    if res:
 +        print('unable to create destination repo; please try cloning manually')
 +        return None
-+
+ 
+-            # We only care about the Python modules.
+-            if not name.startswith('mozboot/'):
+-                continue
+-
+-            files[name] = zip.read(f)
 +    # Strictly speaking, this could overwrite a config based on a template
 +    # the user has installed. Let's pretend this problem doesn't exist
 +    # unless someone complains about it.
@@ -241,7 +215,14 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +        fh.write('[paths]\n')
 +        fh.write('default = https://hg.mozilla.org/mozilla-unified\n')
 +        fh.write('\n')
-+
+ 
+-        # Retrieve distro script
+-        url = repo_url + '/archive/%s.zip/third_party/python/distro/distro.py' % repo_rev
+-        req = urlopen(url=url, timeout=30)
+-        data = BytesIO(req.read())
+-        data.seek(0)
+-        zip = zipfile.ZipFile(data, 'r')
+-        files["distro.py"] = zip.read(zip.infolist()[0])
 +        # The server uses aggressivemergedeltas which can blow up delta chain
 +        # length. This can cause performance to tank due to delta chains being
 +        # too long. Limit the delta chain length to something reasonable
@@ -249,22 +230,28 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +        fh.write('[format]\n')
 +        fh.write('# This is necessary to keep performance in check\n')
 +        fh.write('maxchainlen = 10000\n')
-+
+ 
+-    else:
+-        raise NotImplementedError('Not sure how to handle repo type.', repo_type)
 +    res = subprocess.call(
 +        [hg, 'pull', 'https://hg.mozilla.org/mozilla-unified'], cwd=dest)
 +    print('')
 +    if res:
 +        print(CLONE_MERCURIAL_PULL_FAIL % dest)
 +        return None
-+
+ 
+-    return files
 +    print('updating to "central" - the development head of Gecko and Firefox')
 +    res = subprocess.call([hg, 'update', '-r', 'central'], cwd=dest)
 +    if res:
 +        print('error updating; you will need to `cd %s && hg update -r central` '
 +              'manually' % dest)
 +    return dest
-+
-+
+ 
+ 
+-def ensure_environment(repo_url=None, repo_rev=None, repo_type=None):
+-    """Ensure we can load the Python modules necessary to perform bootstrap."""
+-
 +def git_clone_firefox(git, dest, watchman):
 +    tempdir = None
 +    cinnabar = None
@@ -277,37 +264,6 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 -        # and have the files in a sibling directory.
 -        pardir = os.path.join(os.path.dirname(__file__), os.path.pardir)
 -        include = os.path.normpath(pardir)
--
--        sys.path.append(include)
--        try:
--            from mozboot.bootstrap import Bootstrapper
--            return Bootstrapper
--        except ImportError:
--            sys.path.pop()
--
--            # The next fallback is to download the files from the source
--            # repository.
--            files = fetch_files(repo_url, repo_rev, repo_type)
--
--            # Install them into a temporary location. They will be deleted
--            # after this script has finished executing.
--            global TEMPDIR
--            TEMPDIR = tempfile.mkdtemp()
--
--            for relpath in files.keys():
--                destpath = os.path.join(TEMPDIR, relpath)
--                destdir = os.path.dirname(destpath)
--
--                if not os.path.exists(destdir):
--                    os.makedirs(destdir)
--
--                with open(destpath, 'wb') as fh:
--                    fh.write(files[relpath])
--
--            # This should always work.
--            sys.path.append(TEMPDIR)
--            from mozboot.bootstrap import Bootstrapper
--            return Bootstrapper
 +        cinnabar = which('git-cinnabar')
 +        if not cinnabar:
 +            cinnabar_url = ('https://github.com/glandium/git-cinnabar/archive/'
@@ -340,7 +296,13 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +                  'will ask if you would like to configure git; answer yes, '
 +                  'and be sure to add git-cinnabar to your PATH according to '
 +                  'the bootstrapper output.')
-+
+ 
+-        sys.path.append(include)
+-        try:
+-            from mozboot.bootstrap import Bootstrapper
+-            return Bootstrapper
+-        except ImportError:
+-            sys.path.pop()
 +        # We're guaranteed to have `git-cinnabar` installed now.
 +        # Configure git per the git-cinnabar requirements.
 +        subprocess.check_call(
@@ -350,7 +312,10 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +                              env=env)
 +        subprocess.check_call([git, 'config', 'pull.ff', 'only'], cwd=dest,
 +                              env=env)
-+
+ 
+-            # The next fallback is to download the files from the source
+-            # repository.
+-            files = fetch_files(repo_url, repo_rev, repo_type)
 +        watchman_sample = os.path.join(
 +            dest, '.git/hooks/fsmonitor-watchman.sample')
 +        # Older versions of git didn't include fsmonitor-watchman.sample.
@@ -362,7 +327,11 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +                copy_args = ['cp', '.git/hooks/fsmonitor-watchman.sample',
 +                             '.git/hooks/query-watchman']
 +                subprocess.check_call(copy_args, cwd=dest)
-+
+ 
+-            # Install them into a temporary location. They will be deleted
+-            # after this script has finished executing.
+-            global TEMPDIR
+-            TEMPDIR = tempfile.mkdtemp()
 +            config_args = [git, 'config', 'core.fsmonitor',
 +                           '.git/hooks/query-watchman']
 +            subprocess.check_call(config_args, cwd=dest, env=env)
@@ -375,7 +344,13 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +        if tempdir:
 +            shutil.rmtree(tempdir)
 +
-+
+ 
+-            for relpath in files.keys():
+-                destpath = os.path.join(TEMPDIR, relpath)
+-                destdir = os.path.dirname(destpath)
+-
+-                if not os.path.exists(destdir):
+-                    os.makedirs(destdir)
 +def clone(vcs, no_interactive):
 +    hg = which('hg')
 +    if not hg:
@@ -392,7 +367,9 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +            print('Git is not installed.')
 +            print('Try installing git using your system package manager.')
 +            return None
-+
+ 
+-                with open(destpath, 'wb') as fh:
+-                    fh.write(files[relpath])
 +    dest = input_clone_dest(vcs, no_interactive)
 +    if not dest:
 +        return None
@@ -404,7 +381,11 @@ diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py
 +    else:
 +        watchman = which('watchman')
 +        return git_clone_firefox(binary, dest, watchman)
-+
+ 
+-            # This should always work.
+-            sys.path.append(TEMPDIR)
+-            from mozboot.bootstrap import Bootstrapper
+-            return Bootstrapper
 +
 +def bootstrap(srcdir, application_choice, no_interactive, no_system_changes):
 +    args = [sys.executable, os.path.join(srcdir, 'mach'), 'bootstrap']
@@ -692,7 +673,7 @@ diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootst
 -    return True
 -
 -
- def current_firefox_checkout(check_output, env, hg=None):
+ def current_firefox_checkout(env, hg=None):
      """Determine whether we're in a Firefox checkout.
  
      Returns one of None, ``git``, or ``hg``.
@@ -700,7 +681,7 @@ diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootst
      HG_ROOT_REVISIONS = set([
          # From mozilla-unified.
          '8ba995b74e18334ab3707f27e9eb8f4e37ba3d29',
-@@ -702,47 +560,8 @@ def update_git_repo(git, url, dest):
+@@ -701,47 +559,8 @@ def update_git_repo(git, url, dest):
          print('=' * 80)
  
  

+ 412 - 0
mozilla-release/patches/1651403-80a1.patch

@@ -0,0 +1,412 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1594309727 0
+# Node ID 7a29f8f30a7badfbb110952bb195c12f11fb0494
+# Parent  c37c9629565cd065074c33ed110cf18702037853
+Bug 1651403 - Clean up `bootstrap` code post-Python 3 migration r=nalexander
+
+Since bug 1647865, we're no longer allowing `bootstrap` to be run with Python 2. Therefore we have leeway to make a bunch of simplifications.
+
+Differential Revision: https://phabricator.services.mozilla.com/D82737
+
+diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py
+--- a/python/mozboot/mozboot/base.py
++++ b/python/mozboot/mozboot/base.py
+@@ -417,24 +417,16 @@ class BaseBootstrapper(object):
+         self.run_as_root(command)
+ 
+     def apt_add_architecture(self, arch):
+         command = ['dpkg', '--add-architecture']
+         command.extend(arch)
+ 
+         self.run_as_root(command)
+ 
+-    def check_output(self, *args, **kwargs):
+-        """Run subprocess.check_output even if Python doesn't provide it."""
+-        # TODO Legacy Python 2.6 code, can be removed.
+-        # We had a custom check_output() function for Python 2.6 backward
+-        # compatibility.  Since py2.6 support was dropped we can remove this
+-        # method.
+-        return subprocess.check_output(*args, **kwargs)
+-
+     def prompt_int(self, prompt, low, high, limit=5):
+         ''' Prompts the user with prompt and requires an integer between low and high. '''
+         valid = False
+         while not valid and limit > 0:
+             try:
+                 choice = int(input(prompt))
+                 if not low <= choice <= high:
+                     print("ERROR! Please enter a valid option!")
+@@ -492,21 +484,21 @@ class BaseBootstrapper(object):
+         variable during the invocation to set options, PATH,
+         etc.
+         '''
+         if not name:
+             name = os.path.basename(path)
+         if name.endswith('.exe'):
+             name = name[:-4]
+ 
+-        info = self.check_output([path, version_param],
+-                                 env=env,
+-                                 stderr=subprocess.STDOUT,
+-                                 universal_newlines=True)
++        info = subprocess.check_output(
++            [path, version_param], env=env, stderr=subprocess.STDOUT,
++            universal_newlines=True)
+         match = re.search(name + ' ([a-z0-9\.]+)', info)
++
+         if not match:
+             print('ERROR! Unable to identify %s version.' % name)
+             return None
+ 
+         return LooseVersion(match.group(1))
+ 
+     def _parse_version(self, path, name=None, env=None):
+         return self._parse_version_impl(path, name, env, "--version")
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -373,17 +373,16 @@ class Bootstrapper(object):
+             raise Exception('Please pick a valid application choice: (%s)' %
+                             '/'.join(APPLICATIONS.keys()))
+ 
+         if self.instance.no_system_changes:
+             state_dir_available, state_dir = self.try_to_create_state_dir()
+             # We need to enable the loading of hgrc in case extensions are
+             # required to open the repo.
+             r = current_firefox_checkout(
+-                check_output=self.instance.check_output,
+                 env=self.instance._hg_cleanenv(load_hgrc=True),
+                 hg=self.instance.which('hg'))
+             (checkout_type, checkout_root) = r
+             have_clone = bool(checkout_type)
+ 
+             self.maybe_install_private_packages_or_exit(state_dir,
+                                                         state_dir_available,
+                                                         have_clone,
+@@ -399,18 +398,17 @@ class Bootstrapper(object):
+         hg_installed, hg_modern = self.instance.ensure_mercurial_modern()
+         self.instance.ensure_python_modern()
+         self.instance.ensure_rust_modern()
+ 
+         state_dir_available, state_dir = self.try_to_create_state_dir()
+ 
+         # We need to enable the loading of hgrc in case extensions are
+         # required to open the repo.
+-        r = current_firefox_checkout(check_output=self.instance.check_output,
+-                                     env=self.instance._hg_cleanenv(load_hgrc=True),
++        r = current_firefox_checkout(env=self.instance._hg_cleanenv(load_hgrc=True),
+                                      hg=self.instance.which('hg'))
+         (checkout_type, checkout_root) = r
+ 
+         # If we didn't specify a VCS, and we aren't in an exiting clone,
+         # offer a choice
+         if not self.vcs:
+             if checkout_type and False:
+                 vcs = checkout_type
+@@ -612,37 +610,36 @@ def hg_clone_firefox(hg, dest):
+     res = subprocess.call([hg, 'update', '-r', 'central'], cwd=dest)
+     if res:
+         print('error updating; you will need to `hg update` manually')
+ 
+     print('Firefox source code available at %s' % dest)
+     return True
+ 
+ 
+-def current_firefox_checkout(check_output, env, hg=None):
++def current_firefox_checkout(env, hg=None):
+     """Determine whether we're in a Firefox checkout.
+ 
+     Returns one of None, ``git``, or ``hg``.
+     """
+     HG_ROOT_REVISIONS = set([
+         # From mozilla-unified.
+         '8ba995b74e18334ab3707f27e9eb8f4e37ba3d29',
+     ])
+ 
+     path = os.getcwd()
+     while path:
+         hg_dir = os.path.join(path, '.hg')
+         git_dir = os.path.join(path, '.git')
+         if hg and os.path.exists(hg_dir):
+             # Verify the hg repo is a Firefox repo by looking at rev 0.
+             try:
+-                node = check_output([hg, 'log', '-r', '0', '--template', '{node}'],
+-                                    cwd=path,
+-                                    env=env,
+-                                    universal_newlines=True)
++                node = subprocess.check_output(
++                    [hg, 'log', '-r', '0', '--template', '{node}'],
++                    cwd=path, env=env, universal_newlines=True)
+                 if node in HG_ROOT_REVISIONS:
+                     return ('hg', path)
+                 # Else the root revision is different. There could be nested
+                 # repos. So keep traversing the parents.
+             except subprocess.CalledProcessError:
+                 pass
+ 
+         # Just check for known-good files in the checkout, to prevent attempted
+diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py
+--- a/python/mozboot/mozboot/debian.py
++++ b/python/mozboot/mozboot/debian.py
+@@ -1,14 +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/.
+ 
+ from __future__ import absolute_import, print_function, unicode_literals
+ 
++import subprocess
++
+ from mozboot.base import BaseBootstrapper
+ from mozboot.linux_common import LinuxBootstrapper
+ 
+ 
+ MERCURIAL_INSTALL_PROMPT = '''
+ Mercurial releases a new version every 3 months and your distro's package
+ may become out of date. This may cause incompatibility with some
+ Mercurial extensions that rely on new Mercurial features. As a result,
+@@ -99,17 +101,17 @@ class DebianBootstrapper(
+         # Python 3 may not be present on all distros. Search for it and
+         # install if found.
+         packages = list(self.packages)
+ 
+         have_python3 = any([self.which('python3'), self.which('python3.6'),
+                             self.which('python3.5')])
+ 
+         if not have_python3:
+-            python3_packages = self.check_output(
++            python3_packages = subprocess.check_output(
+                 ['apt-cache', 'pkgnames', 'python3'], universal_newlines=True)
+             python3_packages = python3_packages.splitlines()
+ 
+             if 'python3' in python3_packages:
+                 packages.extend(['python3', 'python3-dev'])
+ 
+         self.apt_install(*packages)
+ 
+diff --git a/python/mozboot/mozboot/osx.py b/python/mozboot/mozboot/osx.py
+--- a/python/mozboot/mozboot/osx.py
++++ b/python/mozboot/mozboot/osx.py
+@@ -224,18 +224,18 @@ class OSXBootstrapper(BaseBootstrapper):
+         # OS X 10.7 have Xcode come from the app store. However, users can
+         # still install Xcode into any arbitrary location. We honor the
+         # location of Xcode as set by xcode-select. This should also pick up
+         # developer preview releases of Xcode, which can be installed into
+         # paths like /Applications/Xcode5-DP6.app.
+         elif self.os_version >= StrictVersion('10.7'):
+             select = self.which('xcode-select')
+             try:
+-                output = self.check_output([select, '--print-path'],
+-                                           stderr=subprocess.STDOUT)
++                output = subprocess.check_output([select, '--print-path'],
++                                                 stderr=subprocess.STDOUT)
+             except subprocess.CalledProcessError as e:
+                 # This seems to appear on fresh OS X machines before any Xcode
+                 # has been installed. It may only occur on OS X 10.9 and later.
+                 if b'unable to get active developer directory' in e.output:
+                     print(XCODE_NO_DEVELOPER_DIRECTORY)
+                     self._install_xcode_app_store()
+                     assert False  # Above should exit.
+ 
+diff --git a/python/mozboot/mozboot/osx.py.1651403.later b/python/mozboot/mozboot/osx.py.1651403.later
+new file mode 100644
+--- /dev/null
++++ b/python/mozboot/mozboot/osx.py.1651403.later
+@@ -0,0 +1,152 @@
++--- osx.py
+++++ osx.py
++Add https://bugzilla.mozilla.org/show_bug.cgi?id=1569046
++before fixing the .later file
++
++@@ -246,39 +246,39 @@ class OSXBootstrapper(BaseBootstrapper):
++             if b'.app/' not in output:
++                 print(XCODE_REQUIRED)
++                 self._install_xcode_app_store()
++                 assert False  # Above should exit.
++ 
++         # Once Xcode is installed, you need to agree to the license before you can
++         # use it.
++         try:
++-            output = self.check_output(['/usr/bin/xcrun', 'clang'],
++-                                       stderr=subprocess.STDOUT)
+++            output = subprocess.check_output(['/usr/bin/xcrun', 'clang'],
+++                                             stderr=subprocess.STDOUT)
++         except subprocess.CalledProcessError as e:
++             if b'license' in e.output:
++                 xcodebuild = self.which('xcodebuild')
++                 try:
++-                    self.check_output([xcodebuild, '-license'],
++-                                      stderr=subprocess.STDOUT)
+++                    subprocess.check_output([xcodebuild, '-license'],
+++                                            stderr=subprocess.STDOUT)
++                 except subprocess.CalledProcessError as e:
++                     if b'requires admin privileges' in e.output:
++                         self.run_as_root([xcodebuild, '-license'])
++ 
++         # Even then we're not done! We need to install the Xcode command line tools.
++         # As of Mountain Lion, apparently the only way to do this is to go through a
++         # menu dialog inside Xcode itself. We're not making this up.
++         if self.os_version >= StrictVersion('10.7'):
++             if not os.path.exists('/usr/bin/clang'):
++                 print(XCODE_COMMAND_LINE_TOOLS_MISSING)
++                 print(INSTALL_XCODE_COMMAND_LINE_TOOLS_STEPS)
++                 sys.exit(1)
++ 
++-            output = self.check_output(['/usr/bin/clang', '--version'],
++-                                       universal_newlines=True)
+++            output = subprocess.check_output(['/usr/bin/clang', '--version'],
+++                                             universal_newlines=True)
++             match = RE_CLANG_VERSION.search(output)
++             if match is None:
++                 raise Exception('Could not determine Clang version.')
++ 
++             version = StrictVersion(match.group(1))
++ 
++             if version < APPLE_CLANG_MINIMUM_VERSION:
++                 print(UPGRADE_XCODE_COMMAND_LINE_TOOLS)
++@@ -297,25 +297,25 @@ class OSXBootstrapper(BaseBootstrapper):
++         # which('brew') is found.
++         assert self.brew is not None
++ 
++     def _ensure_homebrew_packages(self, packages, extra_brew_args=[]):
++         self._ensure_homebrew_found()
++         self._ensure_package_manager_updated()
++         cmd = [self.brew] + extra_brew_args
++ 
++-        installed = set(self.check_output(cmd + ['list'],
++-                                          universal_newlines=True).split())
+++        installed = set(subprocess.check_output(
+++            cmd + ['list'], universal_newlines=True).split())
++         to_install = set(
++             package for package in packages if package not in installed)
++ 
++         # The "--quiet" tells "brew" to only list the package names, and not the
++         # comparison between current and new version.
++-        outdated = set(self.check_output(cmd + ['outdated', '--quiet'],
++-                                         universal_newlines=True).split())
+++        outdated = set(subprocess.check_output(cmd + ['outdated', '--quiet'],
+++                                               universal_newlines=True).split())
++         to_upgrade = set(package for package in packages if package in outdated)
++ 
++         if to_install or to_upgrade:
++             print(PACKAGE_MANAGER_PACKAGES % ('Homebrew',))
++         if 'python@2' in to_install:
++             # Special handling for Python 2 since brew can't install it
++             # out-of-the-box any more.
++             to_install.remove('python@2')
++@@ -327,28 +327,29 @@ class OSXBootstrapper(BaseBootstrapper):
++         if to_install:
++             subprocess.check_call(cmd + ['install'] + list(to_install))
++         if to_upgrade:
++             subprocess.check_call(cmd + ['upgrade'] + list(to_upgrade))
++ 
++     def _ensure_homebrew_casks(self, casks):
++         self._ensure_homebrew_found()
++ 
++-        known_taps = self.check_output([self.brew, 'tap'])
+++        known_taps = subprocess.check_output([self.brew, 'tap'])
++ 
++         # Ensure that we can access old versions of packages.
++         if b'homebrew/cask-versions' not in known_taps:
++-            self.check_output([self.brew, 'tap', 'homebrew/cask-versions'])
+++            subprocess.check_output([self.brew, 'tap',
+++                                     'homebrew/cask-versions'])
++ 
++         # "caskroom/versions" has been renamed to "homebrew/cask-versions", so
++         # it is safe to remove the old tap. Removing the old tap is necessary
++         # to avoid the error "Cask [name of cask] exists in multiple taps".
++         # See https://bugzilla.mozilla.org/show_bug.cgi?id=1544981
++         if b'caskroom/versions' in known_taps:
++-            self.check_output([self.brew, 'untap', 'caskroom/versions'])
+++            subprocess.check_output([self.brew, 'untap', 'caskroom/versions'])
++ 
++         # Change |brew install cask| into |brew cask install cask|.
++         self._ensure_homebrew_packages(casks, extra_brew_args=['cask'])
++ 
++     def ensure_homebrew_system_packages(self, install_mercurial):
++         # We need to install Python because Mercurial requires the
++         # Python development headers which are missing from OS X (at
++         # least on 10.8) and because the build system wants a version
++@@ -410,17 +411,17 @@ class OSXBootstrapper(BaseBootstrapper):
++         from mozboot import android
++         return android.generate_mozconfig('macosx', artifact_mode=artifact_mode)
++ 
++     def _ensure_macports_packages(self, packages):
++         self.port = self.which('port')
++         assert self.port is not None
++ 
++         installed = set(
++-            self.check_output(
+++            subprocess.check_output(
++                 [self.port, 'installed'],
++                 universal_newlines=True).split())
++ 
++         missing = [package for package in packages if package not in installed]
++         if missing:
++             print(PACKAGE_MANAGER_PACKAGES % ('MacPorts',))
++             self.run_as_root([self.port, '-v', 'install'] + missing)
++ 
++@@ -435,17 +436,17 @@ class OSXBootstrapper(BaseBootstrapper):
++             'nodejs8'
++         ]
++         if install_mercurial:
++             packages.append('mercurial')
++ 
++         self._ensure_macports_packages(packages)
++ 
++         pythons = set(
++-            self.check_output(
+++            subprocess.check_output(
++                 [self.port, 'select', '--list', 'python'],
++                 universal_newlines=True).split('\n'))
++         active = ''
++         for python in pythons:
++             if 'active' in python:
++                 active = python
++         if 'python27' not in active:
++             self.run_as_root([self.port, 'select', '--set', 'python', 'python27'])
+diff --git a/python/mozboot/mozboot/void.py b/python/mozboot/mozboot/void.py
+--- a/python/mozboot/mozboot/void.py
++++ b/python/mozboot/mozboot/void.py
+@@ -17,16 +17,17 @@ class VoidBootstrapper(
+         BaseBootstrapper):
+ 
+     PACKAGES = [
+         'autoconf213',
+         'clang',
+         'make',
+         'mercurial',
+         'nodejs',
++        'python3-pip',
+         'unzip',
+         'zip',
+     ]
+ 
+     BROWSER_PACKAGES = [
+         'dbus-devel',
+         'dbus-glib-devel',
+         'gtk+3-devel',
+@@ -49,22 +50,16 @@ class VoidBootstrapper(
+         self.distro = "void"
+         self.version = version
+         self.dist_id = dist_id
+ 
+         self.packages = self.PACKAGES
+         self.browser_packages = self.BROWSER_PACKAGES
+         self.mobile_android_packages = self.MOBILE_ANDROID_PACKAGES
+ 
+-        # Check if we need Python2 or Python3 pip.
+-        if sys.version_info[0] == 3:
+-            self.packages.append('python3-pip')
+-        else:
+-            self.packages.append('python-pip')
+-
+     def run_as_root(self, command):
+         # VoidLinux doesn't support users sudo'ing most commands by default because of the group
+         # configuration.
+         if os.geteuid() != 0:
+             command = ['su', 'root', '-c', ' '.join(command)]
+ 
+         print('Executing as root:', subprocess.list2cmdline(command))
+ 

+ 71 - 0
mozilla-release/patches/1652736-80a1.patch

@@ -0,0 +1,71 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1594757091 0
+# Node ID 4fd63426ba9d3d26b82cc03438f83473b943f439
+# Parent  a19eba86fca8483d381597d3458e1fae0137ae63
+Bug 1652736 - Remove import of `mozversioncontrol` which breaks standalone `bootstrap.py` r=nalexander
+
+Differential Revision: https://phabricator.services.mozilla.com/D83557
+
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -3,16 +3,17 @@
+ # You can obtain one at http://mozilla.org/MPL/2.0/.
+ 
+ from __future__ import absolute_import, print_function, unicode_literals
+ 
+ from collections import OrderedDict
+ 
+ import os
+ import platform
++import re
+ import sys
+ import subprocess
+ import time
+ from distutils.version import LooseVersion
+ 
+ # NOTE: This script is intended to be run with a vanilla Python install.  We
+ # have to rely on the standard library instead of Python 2+3 helpers like
+ # the six module.
+@@ -503,29 +504,33 @@ def update_git_repo(git, url, dest):
+         subprocess.check_call(pull_args, cwd=cwd)
+         subprocess.check_call(update_args, cwd=dest)
+     finally:
+         print('=' * 80)
+ 
+ 
+ def configure_git(git, root_state_dir, top_src_dir):
+     """Run the Git configuration steps."""
+-    from mozversioncontrol import GitRepository
+-
+-    repository = GitRepository(top_src_dir)
+-    git_version = LooseVersion(repository.tool_version)
++    match = re.search(r'(\d+\.\d+\.\d+)',
++                      subprocess.check_output([git, '--version'],
++                                              universal_newlines=True))
++    if not match:
++        raise Exception('Could not find git version')
++    git_version = LooseVersion(match.group(1))
+ 
+     if git_version < MINIMUM_RECOMMENDED_GIT_VERSION:
+         print(OLD_GIT_WARNING.format(
+             old_version=git_version,
+             minimum_recommended_version=MINIMUM_RECOMMENDED_GIT_VERSION))
+ 
+-    if git_version >= LooseVersion('2.17'):
+-        # "core.untrackedCache" has a bug before 2.17
+-        repository.set_config('core.untrackedCache', 'true')
++    if top_src_dir and os.path.exists(top_src_dir):
++        if git_version >= LooseVersion('2.17'):
++            # "core.untrackedCache" has a bug before 2.17
++            subprocess.check_call(
++                [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
+ 
+     cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
+ 
+     print(ADD_GIT_TOOLS_PATH.format(cinnabar_dir))
+ 
+ 
+ def _warn_if_risky_revision(path):
+     # Warn the user if they're trying to bootstrap from an obviously old

+ 1 - 1
mozilla-release/patches/1659411-2-81a1.patch

@@ -1,5 +1,5 @@
 # HG changeset patch
-# User Tarek Ziadé <tarek@mozilla.com>
+# User Tarek Ziade <tarek@mozilla.com>
 # Date 1598456822 0
 # Node ID bce9ec148eef138c89fe2a0c0a3e7ed58e87e3cd
 # Parent  8622f9472e52d6046e28def8c3f6da86040f051b

+ 4 - 6
mozilla-release/patches/1662632-82a1.patch

@@ -2,7 +2,7 @@
 # User Ricky Stewart <rstewart@mozilla.com>
 # Date 1599058642 0
 # Node ID fc60813b36e9b19e4f746601b5bf6b326a8c7e36
-# Parent  f427208a0f6ca892495a1871bb86321a52d2054e
+# Parent  5a253424897dce90abedd8254eea30dc4335c29d
 Bug 1662632 - Fix `UnboundLocalError` due to undefined variable `have_clone` in `mach bootstrap` r=froydnj
 
 This consolidates the `have_clone` logic in one place unconditionally. After bug 1647792 we're deprecating the use case where `bootstrap` is run without a clone, so that's not a problem.
@@ -14,7 +14,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D89152
 diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
 --- a/python/mozboot/mozboot/bootstrap.py
 +++ b/python/mozboot/mozboot/bootstrap.py
-@@ -296,27 +296,28 @@ class Bootstrapper(object):
+@@ -298,26 +298,28 @@ class Bootstrapper(object):
          elif self.choice in APPLICATIONS.keys():
              name, application = self.choice, APPLICATIONS[self.choice]
          elif self.choice in APPLICATIONS.values():
@@ -39,7 +39,6 @@ diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootst
 -            # We need to enable the loading of hgrc in case extensions are
 -            # required to open the repo.
 -            r = current_firefox_checkout(
--                check_output=self.instance.check_output,
 -                env=self.instance._hg_cleanenv(load_hgrc=True),
 -                hg=self.instance.which('hg'))
 -            (checkout_type, checkout_root) = r
@@ -53,7 +52,7 @@ diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootst
              self._output_mozconfig(application)
              sys.exit(0)
  
-@@ -324,25 +325,16 @@ class Bootstrapper(object):
+@@ -325,24 +327,16 @@ class Bootstrapper(object):
  
          # Like 'install_browser_packages' or 'install_mobile_android_packages'.
          getattr(self.instance, 'install_%s_packages' % application)()
@@ -66,8 +65,7 @@ diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootst
 -
 -        # We need to enable the loading of hgrc in case extensions are
 -        # required to open the repo.
--        r = current_firefox_checkout(check_output=self.instance.check_output,
--                                     env=self.instance._hg_cleanenv(load_hgrc=True),
+-        r = current_firefox_checkout(env=self.instance._hg_cleanenv(load_hgrc=True),
 -                                     hg=self.instance.which('hg'))
 -        (checkout_type, checkout_root) = r
 -

+ 75 - 0
mozilla-release/patches/1662893-FIX-82a1.patch

@@ -0,0 +1,75 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1599582786 0
+# Node ID a4f631604a0cc37c67b2d694fb913a0226505088
+# Parent  8f669d4e0ef0609926dd79947a5a905cccdd9053
+Bug 1662893 - Refactor `bootstrap` to reflect that the `~/.mozbuild` state directory and a local checkout are both mandatory r=glandium
+
+`bootstrap` is written in such a way that we don't necessarily assume the existence of either the global state directory (`~/.mozbuild`) or a local checkout of `mozilla-central`. The independence from `~/.mozbuild` is a design decision that may have been appropriate at some point, but today it's arguably useless to continue executing `bootstrap` without a global state directory (we install a bunch of build dependencies there, as well as the `mach` `virtualenv`s that are needed for running non-`bootstrap` `mach` commands after bug 1656993). The independence from a local checkout is an artifact of the old design of `python/mozboot/bin/bootstrap.py`, which is no longer necessary as of bug 1647792.
+
+With that in mind, 1) throw errors if we can't create the global state directory or find the topsrcdir, and 2) remove all existing conditionals of the form "if the global state directory exists" or "if the root of the checkout exists" since these conditions are always going to be true in practice.
+
+Differential Revision: https://phabricator.services.mozilla.com/D89220
+
+diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py
+--- a/python/mozboot/mozboot/bootstrap.py
++++ b/python/mozboot/mozboot/bootstrap.py
+@@ -516,21 +516,20 @@ def configure_git(git, root_state_dir, t
+         raise Exception('Could not find git version')
+     git_version = LooseVersion(match.group(1))
+ 
+     if git_version < MINIMUM_RECOMMENDED_GIT_VERSION:
+         print(OLD_GIT_WARNING.format(
+             old_version=git_version,
+             minimum_recommended_version=MINIMUM_RECOMMENDED_GIT_VERSION))
+ 
+-    if top_src_dir and os.path.exists(top_src_dir):
+-        if git_version >= LooseVersion('2.17'):
+-            # "core.untrackedCache" has a bug before 2.17
+-            subprocess.check_call(
+-                [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
++    if git_version >= LooseVersion('2.17'):
++        # "core.untrackedCache" has a bug before 2.17
++        subprocess.check_call(
++            [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
+ 
+     cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
+ 
+     print(ADD_GIT_TOOLS_PATH.format(cinnabar_dir))
+ 
+ 
+ def _warn_if_risky_revision(path):
+     # Warn the user if they're trying to bootstrap from an obviously old
+diff --git a/python/mozboot/mozboot/bootstrap.py.1662893.later b/python/mozboot/mozboot/bootstrap.py.1662893.later
+deleted file mode 100644
+--- a/python/mozboot/mozboot/bootstrap.py.1662893.later
++++ /dev/null
+@@ -1,28 +0,0 @@
+---- bootstrap.py
+-+++ bootstrap.py
+-@@ -670,21 +599,20 @@ def configure_git(git, cinnabar, root_st
+-         raise Exception('Could not find git version')
+-     git_version = LooseVersion(match.group(1))
+- 
+-     if git_version < MINIMUM_RECOMMENDED_GIT_VERSION:
+-         print(OLD_GIT_WARNING.format(
+-             old_version=git_version,
+-             minimum_recommended_version=MINIMUM_RECOMMENDED_GIT_VERSION))
+- 
+--    if top_src_dir and os.path.exists(top_src_dir):
+--        if git_version >= LooseVersion('2.17'):
+--            # "core.untrackedCache" has a bug before 2.17
+--            subprocess.check_call(
+--                [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
+-+    if git_version >= LooseVersion('2.17'):
+-+        # "core.untrackedCache" has a bug before 2.17
+-+        subprocess.check_call(
+-+            [git, 'config', 'core.untrackedCache', 'true'], cwd=top_src_dir)
+- 
+-     cinnabar_dir = update_git_tools(git, root_state_dir, top_src_dir)
+- 
+-     if not cinnabar:
+-         print(ADD_GIT_CINNABAR_PATH.format(cinnabar_dir))
+- 
+- 
+- def _warn_if_risky_revision(path):

+ 3 - 3
mozilla-release/patches/1672894-84a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1603461248 0
 # Node ID 484f408e18dd25bbb2e51f7f2cc34d6453bcf4d7
-# Parent  c71dcd59611f4290da0d59f60887207ccd318c92
+# Parent  aad1221a9349f27786d58523014453957c5586c4
 Bug 1672894 - Don't bootstrap autoconf 2.13. r=firefox-build-system-reviewers,rstewart DONTBUILD
 
 We've vendored it in bug 1663863 so we don't need it installed on the
@@ -55,7 +55,7 @@ diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/cen
 diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py
 --- a/python/mozboot/mozboot/debian.py
 +++ b/python/mozboot/mozboot/debian.py
-@@ -26,17 +26,16 @@ Your choice: '''
+@@ -28,17 +28,16 @@ Your choice: '''
  
  
  class DebianBootstrapper(
@@ -238,10 +238,10 @@ diff --git a/python/mozboot/mozboot/void.py b/python/mozboot/mozboot/void.py
          'make',
          'mercurial',
          'nodejs',
+         'python3-pip',
          'unzip',
          'zip',
      ]
- 
 diff --git a/python/mozboot/mozboot/windows.py b/python/mozboot/mozboot/windows.py
 --- a/python/mozboot/mozboot/windows.py
 +++ b/python/mozboot/mozboot/windows.py

+ 29 - 0
mozilla-release/patches/NOBUG-nasm-icu-25320.patch

@@ -0,0 +1,29 @@
+# HG changeset patch
+# User Frank-Rainer Grahl <frgrahl@gmx.net>
+# Date 1726194014 -7200
+# Parent  ba57bae2b93ce0551eca096a3eee2e240090603d
+No Bug - Use nasm for icu data file. r=me a=me
+
+Replacement for Bug 1650299 while we keep msvc support.
+
+diff --git a/config/external/icu/data/moz.build b/config/external/icu/data/moz.build
+--- a/config/external/icu/data/moz.build
++++ b/config/external/icu/data/moz.build
+@@ -22,15 +22,15 @@ asflags = [
+ ]
+ LOCAL_INCLUDES += ['.']
+ 
+ if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64':
+     icudata = 'icudata.asm'
+     GeneratedFile(icudata, script='genicudata.py',
+                   inputs=[CONFIG['ICU_DATA_FILE']], flags=[data_symbol])
+     SOURCES += ['!%s' % icudata]
+-elif CONFIG['HAVE_YASM']:
+-    USE_YASM = True
++elif CONFIG['HAVE_NASM']:
++    USE_NASM = True
+     SOURCES += ['icudata.s']
+     ASFLAGS += asflags
+ elif CONFIG['GNU_AS']:
+     SOURCES += ['icudata_gas.S']
+     ASFLAGS += asflags

+ 29 - 19
mozilla-release/patches/series

@@ -6351,6 +6351,7 @@ NOBUG-removenonascii67a1-25314.patch
 1621440-77a1.patch
 1629797-77a1.patch
 1621441-77a1.patch
+1631382-77a1.patch
 1632354-77a1.patch
 1631211-77a1.patch
 1632531-1only-PARTIAL-77a1.patch
@@ -6539,6 +6540,7 @@ NOBUG-removenonascii67a1-25314.patch
 1649850-80a1.patch
 1481425-2-80a1.patch
 1607426-1-80a1.patch
+1651403-80a1.patch
 1616694-1only-80a1.patch
 1652675-80a1.patch
 1633880-1-6811.patch
@@ -7287,25 +7289,30 @@ TOP-NOBUG-nsstyle-prefers-contrast.patch
 TOP-NOBUG-nsstyle-prefers-reduced-motion.patch
 TOP-1909714-NSS3904-11514.patch
 TOP-NOBUG-blockquad0-25319.patch
-1902935-seamonkey-credits-25320.patch
-1435568-60a1.patch
-1180498-68a1.patch
 1363723-1-FIX-57a1.patch
 1363723-2-57a1.patch
 1408777-FIX-58a1.patch
 1416893-59a1.patch
 1419131-59a1.patch
+1424867-1-59a1.patch
+1424867-2-59a1.patch
+1424867-3-59a1.patch
 1260598-59a1.patch
 1405796-59a1.patch
 1427825-59a1.patch
+1430729-59a1.patch
+1431109-59a1.patch
+1435223-59a1.patch
 1432513-60a1.patch
 1431264-1-60a1.patch
 1431264-2-60a1.patch
 1431264-3-60a1.patch
+1435568-60a1.patch
 1433891-60a1.patch
-1402999-60a1.patch
 857348-60a1.patch
 1442196-60a1.patch
+1402999-60a1.patch
+1438196-60a1.patch
 1444003-60a1.patch
 1444633-60a1.patch
 1444851-61a1.patch
@@ -7316,19 +7323,22 @@ TOP-NOBUG-blockquad0-25319.patch
 1431256-5-61a1.patch
 1449530-1-61a1.patch
 1449530-2-61a1.patch
-1862395-incorrect-version-resistfingerprinting-v2-25320.patch
-1737436-use-mozilla-compat-version-define-25320.patch
-1424867-1-59a1.patch
-1424867-2-59a1.patch
-1424867-3-59a1.patch
-1430729-59a1.patch
-1431109-59a1.patch
-1435223-59a1.patch
-1438196-60a1.patch
 1461614-62a1.patch
 1464890-63a1.patch
 1477540-63a1.patch
-1519636-xx-elfhack-112a1.patch
+1519636-11-68a1.patch
+1541792_PARTIAL-68a1.patch
+1180498-68a1.patch
+1519636-20-69a1.patch
+1630317-77a1.patch
+1645196-80a1.patch
+1652736-80a1.patch
+1662893-FIX-82a1.patch
+1663863-82a1.patch
+1672894-84a1.patch
+1670807-84a1.patch
+1507272-1-88a1.patch
+1519636-74-elfhack-112a1.patch
 1838328-116a1.patch
 1839746-116a1.patch
 1840931-116a1.patch
@@ -7353,8 +7363,8 @@ TOP-NOBUG-blockquad0-25319.patch
 1898109-128a1.patch
 1903254-129a1.patch
 1903021-129a1.patch
-1519636-xx-elfhack-130a1.patch
-1541792_PARTIAL-68a1.patch
-1663863-82a1.patch
-1672894-84a1.patch
-1670807-84a1.patch
+1519636-80-elfhack-130a1.patch
+NOBUG-nasm-icu-25320.patch
+1902935-seamonkey-credits-25320.patch
+1862395-incorrect-version-resistfingerprinting-v2-25320.patch
+1737436-use-mozilla-compat-version-define-25320.patch