Browse Source

build fixes

Frank-Rainer Grahl 3 weeks ago
parent
commit
154bac7fce
51 changed files with 7987 additions and 434 deletions
  1. 36 0
      comm-release/patches/1658682-1-81a1.patch
  2. 42 0
      comm-release/patches/1658682-2-81a1.patch
  3. 48 0
      comm-release/patches/1661940-82a1.patch
  4. 3 0
      comm-release/patches/series
  5. 0 59
      mozilla-release/patches/1460451-62a1.patch
  6. 149 0
      mozilla-release/patches/1519990-2-83a1.patch
  7. 904 0
      mozilla-release/patches/1519990-3-83a1.patch
  8. 1675 0
      mozilla-release/patches/1520395-83a1.patch
  9. 290 0
      mozilla-release/patches/1564097-72a1.patch
  10. 241 0
      mozilla-release/patches/1640578-78a1.patch
  11. 8 9
      mozilla-release/patches/1641775-78a1.patch
  12. 47 0
      mozilla-release/patches/1642893-79a1.patch
  13. 140 0
      mozilla-release/patches/1651680-1-81a1.patch
  14. 61 0
      mozilla-release/patches/1651680-2-81a1.patch
  15. 373 0
      mozilla-release/patches/1657954-81a1.patch
  16. 411 0
      mozilla-release/patches/1658976-1-82a1.patch
  17. 43 0
      mozilla-release/patches/1658976-2-82a1.patch
  18. 88 0
      mozilla-release/patches/1661790-82a1.patch
  19. 126 0
      mozilla-release/patches/1664077-1-82a1.patch
  20. 670 0
      mozilla-release/patches/1664077-2-82a1.patch
  21. 156 0
      mozilla-release/patches/1664077-3-82a1.patch
  22. 6 6
      mozilla-release/patches/1664083-82a1.patch
  23. 137 0
      mozilla-release/patches/1667436-83a1.patch
  24. 5 5
      mozilla-release/patches/1667896-83a1.patch
  25. 125 0
      mozilla-release/patches/1669633-1-83a1.patch
  26. 86 0
      mozilla-release/patches/1669633-2-83a1.patch
  27. 84 0
      mozilla-release/patches/1669633-3-83a1.patch
  28. 92 0
      mozilla-release/patches/1669633-4-83a1.patch
  29. 260 0
      mozilla-release/patches/1669633-5-83a1.patch
  30. 337 0
      mozilla-release/patches/1669633-6-83a1.patch
  31. 33 0
      mozilla-release/patches/1669633-7-83a1.patch
  32. 519 0
      mozilla-release/patches/1669633-8-83a1.patch
  33. 192 0
      mozilla-release/patches/1669633-9-83a1.patch
  34. 483 0
      mozilla-release/patches/1670385-83a1.patch
  35. 4 4
      mozilla-release/patches/1672940-84a1.patch
  36. 3 3
      mozilla-release/patches/1678291-2-85a1.patch
  37. 2 2
      mozilla-release/patches/1681406-85a1.patch
  38. 3 3
      mozilla-release/patches/1683797-2-88a1.patch
  39. 1 67
      mozilla-release/patches/1692383-87a1.patch
  40. 8 8
      mozilla-release/patches/1692940-02-88a1.patch
  41. 5 5
      mozilla-release/patches/1692945-2-87a1.patch
  42. 1 20
      mozilla-release/patches/1695773-88a1.patch
  43. 0 144
      mozilla-release/patches/1716972-91a1.patch
  44. 3 3
      mozilla-release/patches/1718878-2-9107.patch
  45. 9 9
      mozilla-release/patches/1728988-1-VS2022-base-25310.patch
  46. 10 10
      mozilla-release/patches/1747754-PARTIAL-97a1.patch
  47. 20 43
      mozilla-release/patches/NOBUG-nukemozlinker-25319.patch
  48. 1 23
      mozilla-release/patches/TOP-NOBUG-PLASTER-Stylo-25314.patch
  49. 4 4
      mozilla-release/patches/TOP-NOBUG-REGEXP-21-1634135-78a1-25318.patch
  50. 4 4
      mozilla-release/patches/TOP-NOBUG-REGEXP-37-1642493-79a1-25318.patch
  51. 39 3
      mozilla-release/patches/series

+ 36 - 0
comm-release/patches/1658682-1-81a1.patch

@@ -0,0 +1,36 @@
+# HG changeset patch
+# User Geoff Lankow <geoff@darktrojan.net>
+# Date 1597212923 -43200
+# Node ID df603c869b395894281cc506d601f0fb496ddbba
+# Parent  c5db472ada2c151023027d1a2b0ddf79eaf4184d
+Bug 1658682 - Port bug 1657954 - Move various branding options from `old-configure`. rs=bustage-fix CLOSED TREE
+
+diff --git a/mail/config/mozconfigs/common b/mail/config/mozconfigs/common
+--- a/mail/config/mozconfigs/common
++++ b/mail/config/mozconfigs/common
+@@ -1,6 +1,7 @@
+ ac_add_options --enable-application=comm/mail
++ac_add_options --with-app-basename=Thunderbird
+ 
+ # Disable enforcing that add-ons are signed by the trusted root.
+ MOZ_REQUIRE_SIGNING=0
+ 
+ . "$topsrcdir/build/mozconfig.common.override"
+diff --git a/mail/confvars.sh b/mail/confvars.sh
+--- a/mail/confvars.sh
++++ b/mail/confvars.sh
+@@ -1,14 +1,13 @@
+ #! /bin/sh
+ # 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/.
+ 
+-MOZ_APP_BASENAME=Thunderbird
+ MOZ_APP_NAME=thunderbird
+ MOZ_UPDATER=1
+ 
+ if test "$OS_ARCH" = "WINNT" -o \
+         "$OS_ARCH" = "Linux"; then
+   MOZ_BUNDLED_FONTS=1
+ fi
+ 

+ 42 - 0
comm-release/patches/1658682-2-81a1.patch

@@ -0,0 +1,42 @@
+# HG changeset patch
+# User Rob Lemley <rob@thunderbird.net>
+# Date 1597359196 0
+# Node ID e4570b54f818d3dadadefbc36973d00d9df1da52
+# Parent  ddaa76fcb5b4b6a65714b00cc9a0ecbb674707ba
+Bug 1658682 - Follow-up: Do not require --with-app-basename in mozconfig. r=darktrojan
+
+Differential Revision: https://phabricator.services.mozilla.com/D87010
+
+diff --git a/mail/config/mozconfigs/common b/mail/config/mozconfigs/common
+--- a/mail/config/mozconfigs/common
++++ b/mail/config/mozconfigs/common
+@@ -1,7 +1,6 @@
+ ac_add_options --enable-application=comm/mail
+-ac_add_options --with-app-basename=Thunderbird
+ 
+ # Disable enforcing that add-ons are signed by the trusted root.
+ MOZ_REQUIRE_SIGNING=0
+ 
+ . "$topsrcdir/build/mozconfig.common.override"
+diff --git a/mail/moz.configure b/mail/moz.configure
+--- a/mail/moz.configure
++++ b/mail/moz.configure
+@@ -2,16 +2,18 @@
+ # vim: set filetype=python:
+ # 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/.
+ 
+ set_config('MOZ_THUNDERBIRD', True)
+ set_define('MOZ_THUNDERBIRD', True)
+ 
++imply_option('MOZ_APP_BASENAME', 'Thunderbird')
++
+ @depends(target_is_windows, target_is_linux)
+ def bundled_fonts(is_windows, is_linux):
+     if is_windows or is_linux:
+         return True
+ 
+ set_config('MOZ_BUNDLED_FONTS', bundled_fonts)
+ add_old_configure_assignment('MOZ_BUNDLED_FONTS', bundled_fonts)
+ 

+ 48 - 0
comm-release/patches/1661940-82a1.patch

@@ -0,0 +1,48 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1597235901 14400
+# Node ID a758fbce517a4db8338e8bfe726c484fb6aeda88
+# Parent  f04669189ebf57b9c430b3caff1fe7adaa652ea2
+Bug 1661940 - Move suite MOZ_APP_BASENAME to moz.configure. r=frg
+Port relevant parts of Bug 1657954 "Move various branding options from old-configure".
+
+diff --git a/suite/confvars.sh b/suite/confvars.sh
+--- a/suite/confvars.sh
++++ b/suite/confvars.sh
+@@ -1,14 +1,13 @@
+ #! /bin/sh
+ # 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/.
+ 
+-MOZ_APP_BASENAME=SeaMonkey
+ MOZ_APP_VENDOR=Mozilla
+ MOZ_APP_NAME=seamonkey
+ MOZ_APP_DISPLAYNAME=SeaMonkey
+ 
+ MOZ_APP_VERSION=$SEAMONKEY_VERSION
+ MOZ_APP_VERSION_DISPLAY=$SEAMONKEY_VERSION_DISPLAY
+ MOZ_PKG_VERSION=$SEAMONKEY_VERSION_PACKAGE
+ 
+diff --git a/suite/moz.configure b/suite/moz.configure
+--- a/suite/moz.configure
++++ b/suite/moz.configure
+@@ -2,16 +2,18 @@
+ # vim: set filetype=python:
+ # 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/.
+ 
+ set_config('MOZ_SUITE', True)
+ set_define('MOZ_SUITE', True)
+ 
++imply_option('MOZ_APP_BASENAME', 'SeaMonkey')
++
+ @depends(target_is_windows, target_is_linux)
+ def bundled_fonts(is_windows, is_linux):
+     if is_windows or is_linux:
+         return True
+ 
+ set_config('MOZ_BUNDLED_FONTS', bundled_fonts)
+ add_old_configure_assignment('MOZ_BUNDLED_FONTS', bundled_fonts)
+ 

+ 3 - 0
comm-release/patches/series

@@ -2192,3 +2192,6 @@ TOP-1906540-mozdevice-removal-comm-25320.patch
 9999999-wikiico-25320.patch
 9999999-wikiico-25320.patch
 1920367-domi-remove-atomservice-25320.patch
 1920367-domi-remove-atomservice-25320.patch
 1920565-irc-channels-v1_1-25320.patch
 1920565-irc-channels-v1_1-25320.patch
+1658682-1-81a1.patch
+1658682-2-81a1.patch
+1661940-82a1.patch

+ 0 - 59
mozilla-release/patches/1460451-62a1.patch

@@ -1,59 +0,0 @@
-# HG changeset patch
-# User Gregory Szorc <gps@mozilla.com>
-# Date 1525920861 25200
-#      Wed May 09 19:54:21 2018 -0700
-# Node ID 6feab03068cb0f2216f319bacf6d4df38e488002
-# Parent  552899c4145f3ae228ac4629a4b250a4b405e04d
-Bug 1460451 - Add /usr/bin/python3 to Debian images; r=glandium
-
-The python3-minimal package provides /usr/bin/python3 on Debian.
-
-This commit installs this package so a `python3` executable is
-provided.
-
-This required backporting the package to wheezy. The final patch
-is trivial. But I wasted a bit of time figuring out why `mk-build-deps`
-wasn't working. It would no-op and exit 0 and then the build would
-complain about missing dependencies!
-
-glandium's theory is that the ":any" multiarch support on wheezy
-isn't complete. Removing ":any" seems to make things "just work."
-
-MozReview-Commit-ID: FBicpK4SmkQ
-
-diff --git a/build/debian-packages/python3-defaults-wheezy.diff b/build/debian-packages/python3-defaults-wheezy.diff
-new file mode 100644
---- /dev/null
-+++ b/build/debian-packages/python3-defaults-wheezy.diff
-@@ -0,0 +1,31 @@
-+diff --git a/debian/changelog b/debian/changelog
-+index a2948ae..338ed66 100644
-+--- a/debian/changelog
-++++ b/debian/changelog
-+@@ -1,3 +1,11 @@
-++python3-defaults (3.5.3-1.deb7moz1) wheezy; urgency=medium
-++
-++  * Mozilla backport for wheezy.
-++  * debian/control.in
-++    * Remove :any from dependencies because it seems to confuse wheezy
-++
-++ -- Gregory Szorc <gps@mozilla.com>  Tue, 9 May 2018 15:00:00 -0800
-++
-+ python3-defaults (3.5.3-1) unstable; urgency=medium
-+
-+   * Bump version to 3.5.3.
-+diff --git a/debian/control.in b/debian/control.in
-+index 89e1aa4..e58be76 100644
-+--- a/debian/control.in
-++++ b/debian/control.in
-+@@ -5,8 +5,8 @@ Maintainer: Matthias Klose <doko@debian.org>
-+ Uploaders: Piotr O<C5><BC>arowski <piotr@debian.org>, Scott Kitterman <scott@kitterman.com>
-+ Build-Depends: debhelper (>= 9), @bd_i586@
-+   lsb-release,
-+-  python3-minimal:any,
-+-  python3.5-minimal:any,
-++  python3-minimal,
-++  python3.5-minimal,
-+   python3-docutils,
-+   debiandoc-sgml
-+ Standards-Version: 3.9.8

+ 149 - 0
mozilla-release/patches/1519990-2-83a1.patch

@@ -0,0 +1,149 @@
+# HG changeset patch
+# User Andrew Halberstadt <ahal@pm.me>
+# Date 1602173703 0
+# Node ID b6feb8c69d7727a613945fcbeced79350d226d9c
+# Parent  b765865fcaf23e9bf19087ccf7f93da11653368e
+Bug 1519990 - [mach] Some light refactoring in commandinfo.py, r=mhentges
+
+Differential Revision: https://phabricator.services.mozilla.com/D90415
+
+diff --git a/python/mach/mach/commands/commandinfo.py b/python/mach/mach/commands/commandinfo.py
+--- a/python/mach/mach/commands/commandinfo.py
++++ b/python/mach/mach/commands/commandinfo.py
+@@ -8,99 +8,106 @@ import argparse
+ from itertools import chain
+ 
+ from mach.decorators import (
+     CommandProvider,
+     Command,
+     CommandArgument,
+ )
+ from mozbuild.base import MachCommandBase
++from mozbuild.util import memoize, memoized_property
+ 
+ 
+ @CommandProvider
+ class BuiltinCommands(MachCommandBase):
+ 
+     @property
+-    def command_keys(self):
+-        # NOTE 'REMOVED' is a function in testing/mochitest/mach_commands.py
+-        return (k for k, v in
+-                self._mach_context.commands.command_handlers.items()
+-                if not v.conditions
+-                or getattr(v.conditions[0], '__name__', None) != 'REMOVED')
++    def command_handlers(self):
++        """A dictionary of command handlers keyed by command name."""
++        return self._mach_context.commands.command_handlers
++
++    @memoized_property
++    def commands(self):
++        """A sorted list of all command names."""
++        return sorted(self.command_handlers)
++
++    @memoize
++    def get_handler_options(self, handler):
++        """Given a command handler, return all available options."""
++        targets = []
++
++        # The 'option_strings' are of the form [('-f', '--foo'), ('-b', '--bar'), ...].
++        option_strings = [item[0] for item in handler.arguments]
++        # Filter out positional arguments (we don't want to complete their metavar).
++        option_strings = [opt for opt in option_strings if opt[0].startswith('-')]
++        targets.extend(chain(*option_strings))
++
++        # If the command uses its own ArgumentParser, extract options from there as well.
++        if handler.parser:
++            targets.extend(chain(*[action.option_strings
++                                   for action in handler.parser._actions]))
++
++        return targets
+ 
+     @Command('mach-commands', category='misc',
+              description='List all mach commands.')
+-    def commands(self):
+-        print("\n".join(sorted(self.command_keys)))
++    def run_commands(self):
++        print("\n".join(self.commands))
+ 
+     @Command('mach-debug-commands', category='misc',
+              description='Show info about available mach commands.')
+     @CommandArgument('match', metavar='MATCH', default=None, nargs='?',
+                      help='Only display commands containing given substring.')
+-    def debug_commands(self, match=None):
++    def run_debug_commands(self, match=None):
+         import inspect
+ 
+-        handlers = self._mach_context.commands.command_handlers
+-        for command in sorted(self.command_keys):
++        for command, handler in self.command_handlers.items():
+             if match and match not in command:
+                 continue
+ 
+-            handler = handlers[command]
+             cls = handler.cls
+             method = getattr(cls, getattr(handler, 'method'))
+ 
+             print(command)
+             print('=' * len(command))
+             print('')
+             print('File: %s' % inspect.getsourcefile(method))
+             print('Class: %s' % cls.__name__)
+             print('Method: %s' % handler.method)
+             print('')
+ 
+     @Command('mach-completion', category='misc',
+              description='Prints a list of completion strings for the specified command.')
+     @CommandArgument('args', default=None, nargs=argparse.REMAINDER,
+                      help="Command to complete.")
+-    def completion(self, args):
+-        all_commands = sorted(self.command_keys)
++    def run_completion(self, args):
+         if not args:
+-            print("\n".join(all_commands))
++            print("\n".join(self.commands))
+             return
+ 
+         is_help = 'help' in args
+         command = None
+         for i, arg in enumerate(args):
+-            if arg in all_commands:
++            if arg in self.commands:
+                 command = arg
+                 args = args[i+1:]
+                 break
+ 
+         # If no command is typed yet, just offer the commands.
+         if not command:
+-            print("\n".join(all_commands))
++            print("\n".join(self.commands))
+             return
+ 
+-        handler = self._mach_context.commands.command_handlers[command]
++        handler = self.command_handlers[command]
+         # If a subcommand was typed, update the handler.
+         for arg in args:
+             if arg in handler.subcommand_handlers:
+                 handler = handler.subcommand_handlers[arg]
+                 break
+ 
+         targets = sorted(handler.subcommand_handlers.keys())
+         if is_help:
+             print("\n".join(targets))
+             return
+ 
+         targets.append('help')
+-
+-        # The 'option_strings' are of the form [('-f', '--foo'), ('-b', '--bar'), ...].
+-        option_strings = [item[0] for item in handler.arguments]
+-        # Filter out positional arguments (we don't want to complete their metavar).
+-        option_strings = [opt for opt in option_strings if opt[0].startswith('-')]
+-        targets.extend(chain(*option_strings))
+-
+-        # If the command uses its own ArgumentParser, extract options from there as well.
+-        if handler.parser:
+-            targets.extend(chain(*[action.option_strings
+-                                   for action in handler.parser._actions]))
+-
++        targets.extend(self.get_handler_options(handler))
+         print("\n".join(targets))

+ 904 - 0
mozilla-release/patches/1519990-3-83a1.patch

@@ -0,0 +1,904 @@
+# HG changeset patch
+# User Andrew Halberstadt <ahal@pm.me>
+# Date 1602259410 0
+# Node ID 93a35f9c67398cb9c85aa4941ebf100a1925435a
+# Parent  7d077401f65c8fa378c3cb409370468996d1e0aa
+Bug 1519990 - [mach] Add ability to generate completion scripts via 'mach mach-completion <shell>', r=mhentges
+
+Supported shells are 'bash', 'zsh' and 'fish'. Here are installation
+instructions with various shells and contexts:
+
+### bash
+
+    $ mach mach-completion bash -f _mach
+    $ sudo mv _mach /etc/bash_completion.d
+
+### bash (homebrew)
+
+    $ mach mach-completion bash -f $(brew --prefix)/etc/bash_completion.d/mach.bash-completion
+
+### zsh
+
+    $ mkdir ~/.zfunc
+    $ mach mach-completion zsh -f ~/.zfunc/_mach
+
+then edit ~/.zshrc and add:
+
+    fpath += ~/.zfunc
+    autoload -U compinit && compinit
+
+### zsh (oh-my-zsh)
+
+    $ mkdir $ZSH/plugins/mach
+    $ mach mach-completion zsh -f $ZSH/plugins/mach/_mach
+
+then edit ~/.zshrc and add 'mach' to your enabled plugins:
+
+    plugins(mach ...)
+
+### zsh (prezto)
+
+    $ mach mach-completion zsh -f ~/.zprezto/modules/completion/external/src/_mach
+
+### fish
+
+    $ ./mach mach-completion fish -f ~/.config/fish/completions/mach.fish
+
+### fish (homebrew)
+
+    $ ./mach mach-completion fish -f (brew --prefix)/share/fish/vendor_completions.d/mach.fish
+
+Differential Revision: https://phabricator.services.mozilla.com/D90416
+
+diff --git a/python/mach/docs/usage.rst b/python/mach/docs/usage.rst
+--- a/python/mach/docs/usage.rst
++++ b/python/mach/docs/usage.rst
+@@ -36,56 +36,92 @@ following are valid:
+ .. code-block:: shell
+ 
+     $ ./mach help try
+     $ ./mach help try fuzzy
+     $ ./mach try -h
+     $ ./mach try fuzzy --help
+ 
+ 
+-Auto Completion
+----------------
++Tab Completion
++--------------
+ 
+-A `bash completion`_ script is bundled with mach, it can be used with either ``bash`` or ``zsh``.
++There are commands built-in to ``mach`` that can generate a fast tab completion
++script for various shells. Supported shells are currently ``bash``, ``zsh`` and
++``fish``. These generated scripts will slowly become out of date over time, so
++you may want to create a cron task to periodically re-generate them.
++
++See below for installation instructions:
+ 
+ Bash
+ ~~~~
+ 
+-Add the following to your ``~/.bashrc``, ``~/.bash_profile`` or equivalent:
++.. code-block:: shell
++
++    $ mach mach-completion bash -f _mach
++    $ sudo mv _mach /etc/bash_completion.d
++
++Bash (homebrew)
++~~~~~~~~~~~~~~~
+ 
+ .. code-block:: shell
+ 
+-    source <srcdir>/python/mach/bash-completion.sh
+-
+-.. tip::
+-
+-    Windows users using the default shell bundled with mozilla-build should source the completion
+-    script from ``~/.bash_profile`` (it may need to be created first).
++    $ mach mach-completion bash -f $(brew --prefix)/etc/bash_completion.d/mach.bash-completion
+ 
+ Zsh
+ ~~~
+ 
+-Add this to your ``~/.zshrc`` or equivalent:
++.. code-block:: shell
++
++    $ mkdir ~/.zfunc
++    $ mach mach-completion zsh -f ~/.zfunc/_mach
++
++then edit ~/.zshrc and add:
++
++.. code-block:: shell
++
++    fpath += ~/.zfunc
++    autoload -U compinit && compinit
++
++You can use any directory of your choosing.
++
++Zsh (oh-my-zsh)
++~~~~~~~~~~~~~~~
+ 
+ .. code-block:: shell
+ 
+-    autoload -U bashcompinit && bashcompinit
+-    source <srcdir>/python/mach/bash-completion.sh
++    $ mkdir $ZSH/plugins/mach
++    $ mach mach-completion zsh -f $ZSH/plugins/mach/_mach
++
++then edit ~/.zshrc and add 'mach' to your enabled plugins:
+ 
+-The ``compinit`` function also needs to be loaded, but if using a framework (like ``oh-my-zsh``),
+-this will often be done for you. So if you see ``command not found: compdef``, you'll need to modify
+-the above instructions to:
++.. code-block:: shell
++
++    plugins(mach ...)
++
++Zsh (prezto)
++~~~~~~~~~~~~
+ 
+ .. code-block:: shell
+ 
+-    autoload -U compinit && compinit
+-    autoload -U bashcompinit && bashcompinit
+-    source <srcdir>/python/mach/bash-completion.sh
++    $ mach mach-completion zsh -f ~/.zprezto/modules/completion/external/src/_mach
++
++Fish
++~~~~
++
++.. code-block:: shell
+ 
+-Don't forget to substitute ``<srcdir>`` with the path to your checkout.
++    $ ./mach mach-completion fish -f ~/.config/fish/completions/mach.fish
++
++Fish (homebrew)
++~~~~~~~~~~~~~~~
++
++.. code-block:: shell
++
++    $ ./mach mach-completion fish -f (brew --prefix)/share/fish/vendor_completions.d/mach.fish
+ 
+ 
+ User Settings
+ -------------
+ 
+ Some mach commands can read configuration from a ``machrc`` file. The default
+ location for this file is ``~/.mozbuild/machrc`` (you'll need to create it).
+ This can also be set to a different location by setting the ``MACHRC``
+diff --git a/python/mach/mach/commands/commandinfo.py b/python/mach/mach/commands/commandinfo.py
+--- a/python/mach/mach/commands/commandinfo.py
++++ b/python/mach/mach/commands/commandinfo.py
+@@ -1,56 +1,137 @@
+ # 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 argparse
++import os
++import re
++import subprocess
++import sys
+ from itertools import chain
+ 
++import attr
++
+ from mach.decorators import (
+     CommandProvider,
+     Command,
+     CommandArgument,
++    SubCommand,
+ )
+ from mozbuild.base import MachCommandBase
+ from mozbuild.util import memoize, memoized_property
+ 
++here = os.path.abspath(os.path.dirname(__file__))
++COMPLETION_TEMPLATES_DIR = os.path.join(here, "completion_templates")
++
++
++@attr.s
++class CommandInfo(object):
++    name = attr.ib(type=str)
++    description = attr.ib(type=str)
++    subcommands = attr.ib(type=list)
++    options = attr.ib(type=dict)
++    subcommand = attr.ib(type=str, default=None)
++
++
++def render_template(shell, context):
++    filename = "{}.template".format(shell)
++    with open(os.path.join(COMPLETION_TEMPLATES_DIR, filename)) as fh:
++        template = fh.read()
++    return template % context
++
+ 
+ @CommandProvider
+ class BuiltinCommands(MachCommandBase):
+ 
+-    @property
++    @memoized_property
+     def command_handlers(self):
+         """A dictionary of command handlers keyed by command name."""
+         return self._mach_context.commands.command_handlers
+ 
+     @memoized_property
+     def commands(self):
+         """A sorted list of all command names."""
+         return sorted(self.command_handlers)
+ 
++    def _get_parser_options(self, parser):
++        options = {}
++        for action in parser._actions:
++            # ignore positional args
++            if not action.option_strings:
++                continue
++
++            # ignore suppressed args
++            if action.help == argparse.SUPPRESS:
++                continue
++
++            options[tuple(action.option_strings)] = action.help or ""
++        return options
++
++    @memoized_property
++    def global_options(self):
++        """Return a dict of global options.
++
++        Of the form `{("-o", "--option"): "description"}`.
++        """
++        for group in self._mach_context.global_parser._action_groups:
++            if group.title == "Global Arguments":
++                return self._get_parser_options(group)
++
+     @memoize
+-    def get_handler_options(self, handler):
+-        """Given a command handler, return all available options."""
+-        targets = []
++    def _get_handler_options(self, handler):
++        """Return a dict of options for the given handler.
++
++        Of the form `{("-o", "--option"): "description"}`.
++        """
++        options = {}
++        for option_strings, val in handler.arguments:
++            # ignore positional args
++            if option_strings[0][0] != "-":
++                continue
+ 
+-        # The 'option_strings' are of the form [('-f', '--foo'), ('-b', '--bar'), ...].
+-        option_strings = [item[0] for item in handler.arguments]
+-        # Filter out positional arguments (we don't want to complete their metavar).
+-        option_strings = [opt for opt in option_strings if opt[0].startswith('-')]
+-        targets.extend(chain(*option_strings))
++            options[tuple(option_strings)] = val.get("help", "")
++
++        if handler._parser:
++            options.update(self._get_parser_options(handler.parser))
++
++        return options
++
++    def _get_handler_info(self, handler):
++        try:
++            options = self._get_handler_options(handler)
++        except (Exception, SystemExit):
++            # We don't want misbehaving commands to break tab completion,
++            # ignore any exceptions.
++            options = {}
+ 
+-        # If the command uses its own ArgumentParser, extract options from there as well.
+-        if handler.parser:
+-            targets.extend(chain(*[action.option_strings
+-                                   for action in handler.parser._actions]))
++        subcommands = []
++        for sub in sorted(handler.subcommand_handlers):
++            subcommands.append(self._get_handler_info(handler.subcommand_handlers[sub]))
+ 
+-        return targets
++        return CommandInfo(
++            name=handler.name,
++            description=handler.description or "",
++            options=options,
++            subcommands=subcommands,
++            subcommand=handler.subcommand,
++        )
++
++    @memoized_property
++    def commands_info(self):
++        """Return a list of CommandInfo objects for each command."""
++        commands_info = []
++        # Loop over self.commands rather than self.command_handlers.items() for
++        # alphabetical order.
++        for c in self.commands:
++            commands_info.append(self._get_handler_info(self.command_handlers[c]))
++        return commands_info
+ 
+     @Command('mach-commands', category='misc',
+              description='List all mach commands.')
+     def run_commands(self):
+         print("\n".join(self.commands))
+ 
+     @Command('mach-debug-commands', category='misc',
+              description='Show info about available mach commands.')
+@@ -104,10 +185,239 @@ class BuiltinCommands(MachCommandBase):
+                 break
+ 
+         targets = sorted(handler.subcommand_handlers.keys())
+         if is_help:
+             print("\n".join(targets))
+             return
+ 
+         targets.append('help')
+-        targets.extend(self.get_handler_options(handler))
++        targets.extend(chain(*self._get_handler_options(handler).keys()))
+         print("\n".join(targets))
++
++    def _zsh_describe(self, value, description=None):
++        value = '"' + value.replace(":", "\\:")
++        if description:
++            description = re.sub(
++                r'(["\'#&;`|*?~<>^()\[\]{}$\\\x0A\xFF])', r"\\\1", description
++            )
++            value += ":{}".format(subprocess.list2cmdline([description]).strip('"'))
++
++        value += '"'
++
++        return value
++
++    @SubCommand('mach-completion', 'bash',
++                description="Print mach completion script for bash shell")
++    @CommandArgument("-f", "--file", dest="outfile", default=None,
++                     help="File path to save completion script.")
++    def completion_bash(self, outfile):
++        commands_subcommands = []
++        case_options = []
++        case_subcommands = []
++        for i, cmd in enumerate(self.commands_info):
++            # Build case statement for options.
++            options = []
++            for opt_strs, description in cmd.options.items():
++                for opt in opt_strs:
++                    options.append(self._zsh_describe(opt, None).strip('"'))
++
++            if options:
++                case_options.append("\n".join([
++                    "            ({})".format(cmd.name),
++                    '            opts="${{opts}} {}"'.format(" ".join(options)),
++                    "            ;;",
++                    "",
++                ]))
++
++            # Build case statement for subcommand options.
++            for sub in cmd.subcommands:
++                options = []
++                for opt_strs, description in sub.options.items():
++                    for opt in opt_strs:
++                        options.append(self._zsh_describe(opt, None))
++
++                if options:
++                    case_options.append("\n".join([
++                        '            ("{} {}")'.format(sub.name, sub.subcommand),
++                        '            opts="${{opts}} {}"'.format(" ".join(options)),
++                        "            ;;",
++                        ""
++                    ]))
++
++            # Build case statement for subcommands.
++            subcommands = [
++                self._zsh_describe(s.subcommand, None) for s in cmd.subcommands
++            ]
++            if subcommands:
++                commands_subcommands.append('[{}]=" {} "'.format(
++                    cmd.name, " ".join([h.subcommand for h in cmd.subcommands]))
++                )
++
++                case_subcommands.append("\n".join([
++                    "            ({})".format(cmd.name),
++                    '            subs="${{subs}} {}"'.format(" ".join(subcommands)),
++                    "            ;;",
++                    "",
++                ]))
++
++        globalopts = [opt for opt_strs in self.global_options for opt in opt_strs]
++        context = {
++            "case_options": "\n".join(case_options),
++            "case_subcommands": "\n".join(case_subcommands),
++            "commands": " ".join(self.commands),
++            "commands_subcommands": " ".join(sorted(commands_subcommands)),
++            "globalopts": " ".join(sorted(globalopts)),
++        }
++
++        outfile = open(outfile, 'w') if outfile else sys.stdout
++        print(render_template("bash", context), file=outfile)
++
++    @SubCommand('mach-completion', 'zsh',
++                description="Print mach completion script for zsh shell")
++    @CommandArgument("-f", "--file", dest="outfile", default=None,
++                     help="File path to save completion script.")
++    def completion_zsh(self, outfile):
++        commands_descriptions = []
++        commands_subcommands = []
++        case_options = []
++        case_subcommands = []
++        for i, cmd in enumerate(self.commands_info):
++            commands_descriptions.append(
++                self._zsh_describe(cmd.name, cmd.description)
++            )
++
++            # Build case statement for options.
++            options = []
++            for opt_strs, description in cmd.options.items():
++                for opt in opt_strs:
++                    options.append(self._zsh_describe(opt, description))
++
++            if options:
++                case_options.append("\n".join([
++                    "            ({})".format(cmd.name),
++                    "            opts+=({})".format(" ".join(options)),
++                    "            ;;",
++                    ""
++                ]))
++
++            # Build case statement for subcommand options.
++            for sub in cmd.subcommands:
++                options = []
++                for opt_strs, description in sub.options.items():
++                    for opt in opt_strs:
++                        options.append(self._zsh_describe(opt, description))
++
++                if options:
++                    case_options.append("\n".join([
++                        "            ({} {})".format(sub.name, sub.subcommand),
++                        "            opts+=({})".format(" ".join(options)),
++                        "            ;;",
++                        ""
++                    ]))
++
++            # Build case statement for subcommands.
++            subcommands = [
++                self._zsh_describe(s.subcommand, s.description) for s in cmd.subcommands
++            ]
++            if subcommands:
++                commands_subcommands.append('[{}]=" {} "'.format(
++                    cmd.name, " ".join([h.subcommand for h in cmd.subcommands]))
++                )
++
++                case_subcommands.append("\n".join([
++                    "            ({})".format(cmd.name),
++                    "            subs+=({})".format(" ".join(subcommands)),
++                    "            ;;",
++                    ""
++                ]))
++
++        globalopts = []
++        for opt_strings, description in self.global_options.items():
++            for opt in opt_strings:
++                globalopts.append(self._zsh_describe(opt, description))
++
++        context = {
++            "case_options": "\n".join(case_options),
++            "case_subcommands": "\n".join(case_subcommands),
++            "commands": " ".join(sorted(commands_descriptions)),
++            "commands_subcommands": " ".join(sorted(commands_subcommands)),
++            "globalopts": " ".join(sorted(globalopts)),
++        }
++
++        outfile = open(outfile, 'w') if outfile else sys.stdout
++        print(render_template("zsh", context), file=outfile)
++
++    @SubCommand('mach-completion', 'fish',
++                description="Print mach completion script for fish shell")
++    @CommandArgument("-f", "--file", dest="outfile", default=None,
++                     help="File path to save completion script.")
++    def completion_fish(self, outfile):
++
++        def _append_opt_strs(comp, opt_strs):
++            for opt in opt_strs:
++                if opt.startswith('--'):
++                    comp += " -l {}".format(opt[2:])
++                elif opt.startswith('-'):
++                    comp += " -s {}".format(opt[1:])
++            return comp
++
++        globalopts = []
++        for opt_strs, description in self.global_options.items():
++            comp = (
++                "complete -c mach -n '__fish_mach_complete_no_command' "
++                "-d '{}'".format(description.replace("'", "\\'"))
++            )
++            comp = _append_opt_strs(comp, opt_strs)
++            globalopts.append(comp)
++
++        cmds = []
++        cmds_opts = []
++        for i, cmd in enumerate(self.commands_info):
++            cmds.append(
++                "complete -c mach -f -n '__fish_mach_complete_no_command' "
++                "-a {} -d '{}'".format(
++                    cmd.name,
++                    cmd.description.replace("'", "\\'"),
++                )
++            )
++
++            cmds_opts += ["# {}".format(cmd.name)]
++
++            subcommands = " ".join([s.subcommand for s in cmd.subcommands])
++            for opt_strs, description in cmd.options.items():
++                comp = (
++                    "complete -c mach -A -n '__fish_mach_complete_command {} {}' "
++                    "-d '{}'".format(cmd.name, subcommands, description.replace("'", "\\'"))
++                )
++                comp = _append_opt_strs(comp, opt_strs)
++                cmds_opts.append(comp)
++
++            for sub in cmd.subcommands:
++
++                for opt_strs, description in sub.options.items():
++                    comp = (
++                        "complete -c mach -A -n '__fish_mach_complete_subcommand {} {}' "
++                        "-d '{}'".format(sub.name, sub.subcommand, description.replace("'", "\\'"))
++                    )
++                    comp = _append_opt_strs(comp, opt_strs)
++                    cmds_opts.append(comp)
++
++                description = sub.description or ""
++                description = description.replace("'", "\\'")
++                comp = (
++                    "complete -c mach -A -n '__fish_mach_complete_command {} {}' "
++                    "-d '{}' -a {}".format(cmd.name, subcommands, description, sub.subcommand)
++                )
++                cmds_opts.append(comp)
++
++            if i < len(self.commands) - 1:
++                cmds_opts.append("")
++
++        context = {
++            "commands": " ".join(self.commands),
++            "command_completions": "\n".join(cmds),
++            "command_option_completions": "\n".join(cmds_opts),
++            "global_option_completions": "\n".join(globalopts),
++        }
++
++        outfile = open(outfile, 'w') if outfile else sys.stdout
++        print(render_template("fish", context), file=outfile)
+diff --git a/python/mach/mach/commands/completion_templates/bash.template b/python/mach/mach/commands/completion_templates/bash.template
+new file mode 100644
+--- /dev/null
++++ b/python/mach/mach/commands/completion_templates/bash.template
+@@ -0,0 +1,62 @@
++_mach_complete()
++{
++    local com coms comsubs cur opts script sub subs
++    COMPREPLY=()
++    declare -A comsubs=( %(commands_subcommands)s )
++
++    _get_comp_words_by_ref -n : cur words
++    # for an alias, get the real script behind it
++    if [[ $(type -t ${words[0]}) == "alias" ]]; then
++        script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\\1/")
++    else
++        script=${words[0]}
++    fi
++    # lookup for command and subcommand
++    for word in ${words[@]:1}; do
++        if [[ $word == -* ]]; then
++            continue
++        fi
++
++        if [[ -z $com ]]; then
++            com=$word
++        elif [[ "${comsubs[$com]}" == *" $word "* ]]; then
++            sub=$word
++            break
++        fi
++    done
++    # completing for an option
++    if [[ ${cur} == -* ]] ; then
++        if [[ -n $com ]]; then
++            if [[ -n $sub ]]; then
++                optkey="$com $sub"
++            else
++                optkey="$com"
++            fi
++            case $optkey in
++%(case_options)s
++            esac
++        else
++            # no command, complete global options
++            opts="%(globalopts)s"
++        fi
++        COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
++        __ltrim_colon_completions "$cur"
++        return 0;
++    # completing for a command
++    elif [[ $cur == $com ]]; then
++        coms="%(commands)s"
++        COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
++        __ltrim_colon_completions "$cur"
++        return 0
++    else
++        if [[ -z $sub ]]; then
++            case "$com" in
++%(case_subcommands)s
++            esac
++            COMPREPLY=($(compgen -W "${subs}" -- ${cur}))
++            __ltrim_colon_completions "$cur"
++        fi
++        return 0
++    fi
++}
++complete -o default -F _mach_complete mach
+diff --git a/python/mach/mach/commands/completion_templates/fish.template b/python/mach/mach/commands/completion_templates/fish.template
+new file mode 100644
+--- /dev/null
++++ b/python/mach/mach/commands/completion_templates/fish.template
+@@ -0,0 +1,64 @@
++function __fish_mach_complete_no_command
++    for i in (commandline -opc)
++        if contains -- $i %(commands)s
++            return 1
++        end
++    end
++    return 0
++end
++
++function __fish_mach_complete_command_matches
++    for i in (commandline -opc)
++        if contains -- $i %(commands)s
++            set com $i
++            break
++        end
++    end
++
++    if not set -q com
++        return 1
++    end
++
++    if test "$com" != "$argv"
++        return 1
++    end
++    return 0
++end
++
++function __fish_mach_complete_command
++    __fish_mach_complete_command_matches $argv[1]
++    if test $status -ne 0
++        return 1
++    end
++
++    # If a subcommand is already entered, don't complete, we should defer to
++    # '__fish_mach_complete_subcommand'.
++    for i in (commandline -opc)
++        if contains -- $i $argv[2..-1]
++            return 1
++        end
++    end
++    return 0
++end
++
++function __fish_mach_complete_subcommand
++    __fish_mach_complete_command_matches $argv[1]
++    if test $status -ne 0
++        return 1
++    end
++
++    # Command matches, now check for subcommand
++    for i in (commandline -opc)
++        if contains -- $i $argv[2]
++            return 0
++        end
++    end
++    return 1
++end
++
++# global options
++%(global_option_completions)s
++# commands
++%(command_completions)s
++# command options
++%(command_option_completions)s
+diff --git a/python/mach/mach/commands/completion_templates/zsh.template b/python/mach/mach/commands/completion_templates/zsh.template
+new file mode 100644
+--- /dev/null
++++ b/python/mach/mach/commands/completion_templates/zsh.template
+@@ -0,0 +1,62 @@
++#compdef mach
++_mach_complete()
++{
++    local com coms comsubs cur optkey opts state sub subs
++    cur=${words[${#words[@]}]}
++    typeset -A comsubs
++    comsubs=( %(commands_subcommands)s )
++
++    # lookup for command and subcommand
++    for word in ${words[@]:1}; do
++        if [[ $word == -* ]]; then
++            continue
++        fi
++
++        if [[ -z $com ]]; then
++            com=$word
++        elif [[ ${comsubs[$com]} == *" $word "* ]]; then
++            sub=$word
++            break
++        fi
++    done
++
++    # check for a subcommand
++    if [[ $cur == $com ]]; then
++        state="command"
++        coms=(%(commands)s)
++    elif [[ ${cur} == -* ]]; then
++        state="option"
++        if [[ -z $com ]]; then
++            # no command, use global options
++            opts=(%(globalopts)s)
++        fi
++    fi
++    case $state in
++        (command)
++            _describe 'command' coms
++        ;;
++        (option)
++            if [[ -n $sub ]]; then
++                optkey="$com $sub"
++            else
++                optkey="$com"
++            fi
++            case $optkey in
++%(case_options)s
++            esac
++            _describe 'option' opts
++        ;;
++        *)
++            if [[ -z $sub ]]; then
++                # if we're completing a command with subcommands, add them here
++                case "$com" in
++%(case_subcommands)s
++                esac
++                _describe 'subcommand' subs
++            fi
++            # also fallback to file completion
++            _arguments '*:file:_files'
++    esac
++}
++_mach_complete "$@"
++compdef _mach_complete mach
+diff --git a/python/mach/mach/main.py b/python/mach/mach/main.py
+--- a/python/mach/mach/main.py
++++ b/python/mach/mach/main.py
+@@ -384,16 +384,17 @@ To see more help for a specific command,
+         context = CommandContext(cwd=self.cwd,
+                                  settings=self.settings, log_manager=self.log_manager,
+                                  commands=Registrar)
+ 
+         if self.populate_context_handler:
+             context = ContextWrapper(context, self.populate_context_handler)
+ 
+         parser = self.get_argument_parser(context)
++        context.global_parser = parser
+ 
+         if not len(argv):
+             # We don't register the usage until here because if it is globally
+             # registered, argparse always prints it. This is not desired when
+             # running with --help.
+             parser.usage = Mach.USAGE
+             parser.print_usage()
+             return 0
+diff --git a/python/mach/mach/test/test_commands.py b/python/mach/mach/test/test_commands.py
+--- a/python/mach/mach/test/test_commands.py
++++ b/python/mach/mach/test/test_commands.py
+@@ -1,61 +1,84 @@
+ # 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, unicode_literals
++from __future__ import absolute_import, print_function, unicode_literals
+ 
+ import os
++import sys
+ 
++import pytest
+ from mozunit import main
+ 
+ from buildconfig import topsrcdir
+ import mach
+ from mach.test.common import TestBase
+ 
++ALL_COMMANDS = [
++    'cmd_bar',
++    'cmd_foo',
++    'cmd_foobar',
++    'mach-commands',
++    'mach-completion',
++    'mach-debug-commands',
++]
+ 
+-class TestCommands(TestBase):
+-    all_commands = [
+-        'cmd_bar',
+-        'cmd_foo',
+-        'cmd_foobar',
+-        'mach-commands',
+-        'mach-completion',
+-        'mach-debug-commands',
+-    ]
++
++@pytest.fixture
++def run_mach():
+ 
+-    def _run_mach(self, args):
++    tester = TestBase()
++
++    def inner(args):
+         mach_dir = os.path.dirname(mach.__file__)
+         providers = [
+             'commands.py',
+             os.path.join(mach_dir, 'commands', 'commandinfo.py'),
+         ]
+ 
+         def context_handler(key):
+             if key == 'topdir':
+                 return topsrcdir
+ 
+-        return TestBase._run_mach(self, args, providers,
+-                                  context_handler=context_handler)
++        return tester._run_mach(args, providers, context_handler=context_handler)
++
++    return inner
++
+ 
+-    def format(self, targets):
+-        return "\n".join(targets) + "\n"
++def format(targets):
++    return "\n".join(targets) + "\n"
++
+ 
+-    def test_mach_completion(self):
+-        result, stdout, stderr = self._run_mach(['mach-completion'])
+-        assert result == 0
+-        assert stdout == self.format(self.all_commands)
++def test_mach_completion(run_mach):
++    result, stdout, stderr = run_mach(['mach-completion'])
++    assert result == 0
++    assert stdout == format(ALL_COMMANDS)
+ 
+-        result, stdout, stderr = self._run_mach(['mach-completion', 'cmd_f'])
+-        assert result == 0
+-        # While it seems like this should return only commands that have
+-        # 'cmd_f' as a prefix, the completion script will handle this case
+-        # properly.
+-        assert stdout == self.format(self.all_commands)
++    result, stdout, stderr = run_mach(['mach-completion', 'cmd_f'])
++    assert result == 0
++    # While it seems like this should return only commands that have
++    # 'cmd_f' as a prefix, the completion script will handle this case
++    # properly.
++    assert stdout == format(ALL_COMMANDS)
++
++    result, stdout, stderr = run_mach(['mach-completion', 'cmd_foo'])
++    assert result == 0
++    assert stdout == format(['help', '--arg'])
++
+ 
+-        result, stdout, stderr = self._run_mach(['mach-completion', 'cmd_foo'])
+-        assert result == 0
+-        assert stdout == self.format(['help', '--arg'])
++@pytest.mark.parametrize("shell", ("bash", "fish", "zsh"))
++def test_generate_mach_completion_script(run_mach, shell):
++    rv, out, err = run_mach(["mach-completion", shell])
++    print(out)
++    print(err, file=sys.stderr)
++    assert rv == 0
++    assert err == ""
++
++    assert "cmd_foo" in out
++    assert "arg" in out
++    assert "cmd_foobar" in out
++    assert "cmd_bar" in out
+ 
+ 
+ if __name__ == '__main__':
+     main()

+ 1675 - 0
mozilla-release/patches/1520395-83a1.patch

@@ -0,0 +1,1675 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602130066 0
+# Node ID 6f0cd585ec0ad534c56fcdbdab1d3cce51faff8f
+# Parent  da58a370db707194c2a76240b0b4258b415ea58d
+Bug 1520395 - Remove the python configure distinction between option and js_option. r=firefox-build-system-reviewers,andi,rstewart
+
+Now that we don't recurse into the js python configure, we don't need to
+have a special treatment for the options that need to be passed down to
+that subconfigure, which is what js_option was for.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92727
+
+diff --git a/build/moz.configure/android-ndk.configure b/build/moz.configure/android-ndk.configure
+--- a/build/moz.configure/android-ndk.configure
++++ b/build/moz.configure/android-ndk.configure
+@@ -1,34 +1,34 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # vim: set filetype=python:
+ # 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/.
+ 
+ 
+-js_option('--with-android-ndk', nargs=1,
+-          help='location where the Android NDK can be found')
++option('--with-android-ndk', nargs=1,
++       help='location where the Android NDK can be found{|}')
+ 
+-js_option('--with-android-toolchain', nargs=1,
+-          help='location of the Android toolchain')
++option('--with-android-toolchain', nargs=1,
++       help='location of the Android toolchain')
+ 
+ 
+ @depends(target)
+ def min_android_version(target):
+     if target.cpu in ['aarch64', 'x86_64', 'mips64']:
+         # 64-bit support was added in API 21.
+         return '21'
+     return '9'
+ 
+ 
+-js_option('--with-android-version',
+-          nargs=1,
+-          help='android platform version{|}',
+-          default=min_android_version)
++option('--with-android-version',
++       nargs=1,
++       help='android platform version{|}',
++       default=min_android_version)
+ 
+ 
+ @depends('--with-android-version', min_android_version, '--help')
+ @imports(_from='__builtin__', _import='ValueError')
+ def android_version(value, min_version, _):
+     if not value:
+         # Someone has passed --without-android-version.
+         die('--with-android-version cannot be disabled.')
+@@ -190,19 +190,19 @@ set_config('ANDROID_TOOLCHAIN', android_
+ def android_toolchain_prefix_base(target):
+     if target.cpu == 'x86':
+         # Ideally, the --target should just have the right x86 variant
+         # in the first place.
+         return 'i686-linux-android'
+     return target.toolchain
+ 
+ 
+-js_option(env='STLPORT_CPPFLAGS',
+-          nargs=1,
+-          help='Options compiler should pass for standard C++ library')
++option(env='STLPORT_CPPFLAGS',
++       nargs=1,
++       help='Options compiler should pass for standard C++ library')
+ 
+ 
+ @depends('STLPORT_CPPFLAGS', ndk, '--help')
+ @imports(_from='os.path', _import='isdir')
+ def stlport_cppflags(value, ndk, _):
+     if value and len(value):
+         return value.split()
+     if not ndk:
+diff --git a/build/moz.configure/arm.configure b/build/moz.configure/arm.configure
+--- a/build/moz.configure/arm.configure
++++ b/build/moz.configure/arm.configure
+@@ -21,33 +21,33 @@ def arm_option_defaults(os, _):
+     )
+ 
+ 
+ # Note: '{...|}' in the help of all options with a non-constant default to
+ # make the lint happy. The first arm is always going to be used, because a
+ # default is always returned. The lint is fooled by this file being
+ # conditional. If it weren't conditional, the lint wouldn't ask for '{|}' to
+ # be there.
+-js_option('--with-arch', nargs=1,
+-          default=arm_option_defaults.arch,
+-          help='{Use specific CPU features (-march=type). Resets thumb, fpu, '
+-               'float-abi, etc. defaults when set|}')
++option('--with-arch', nargs=1,
++       default=arm_option_defaults.arch,
++       help='{Use specific CPU features (-march=type). Resets thumb, fpu, '
++            'float-abi, etc. defaults when set|}')
+ 
+ 
+ @depends('--with-arch')
+ def arch_option(value):
+     if value:
+         if value[0] != 'toolchain-default':
+             return ['-march={}'.format(value[0])]
+     return []
+ 
+ 
+-js_option('--with-thumb', choices=('yes', 'no', 'toolchain-default'),
+-          default=arm_option_defaults.thumb,
+-          nargs='?', help='{Use Thumb instruction set (-mthumb)|}')
++option('--with-thumb', choices=('yes', 'no', 'toolchain-default'),
++       default=arm_option_defaults.thumb,
++       nargs='?', help='{Use Thumb instruction set (-mthumb)|}')
+ 
+ 
+ def normalize_arm_option(value):
+     if value:
+         if len(value):
+             if value[0] == 'yes':
+                 return True
+             elif value[0] == 'no':
+@@ -62,60 +62,60 @@ def thumb_option(value):
+     value = normalize_arm_option(value)
+     if value is True:
+         return ['-mthumb']
+     if value is False:
+         return ['-marm']
+     return []
+ 
+ 
+-js_option('--with-thumb-interwork', choices=('yes', 'no', 'toolchain-default'),
+-          default='toolchain-default',
+-          nargs='?', help='Use Thumb/ARM instuctions interwork (-mthumb-interwork)')
++option('--with-thumb-interwork', choices=('yes', 'no', 'toolchain-default'),
++       default='toolchain-default',
++       nargs='?', help='Use Thumb/ARM instuctions interwork (-mthumb-interwork)')
+ 
+ 
+ @depends('--with-thumb-interwork')
+ def thumb_interwork_option(value):
+     value = normalize_arm_option(value)
+     if value is True:
+         return ['-mthumb-interwork']
+     if value is False:
+         return ['-mno-thumb-interwork']
+     return []
+ 
+ 
+-js_option('--with-fpu', nargs=1,
+-          default=arm_option_defaults.fpu,
+-          help='{Use specific FPU type (-mfpu=type)|}')
++option('--with-fpu', nargs=1,
++       default=arm_option_defaults.fpu,
++       help='{Use specific FPU type (-mfpu=type)|}')
+ 
+ 
+ @depends('--with-fpu')
+ def fpu_option(value):
+     if value:
+         if value[0] != 'toolchain-default':
+             return ['-mfpu={}'.format(value[0])]
+     return []
+ 
+ 
+-js_option('--with-float-abi', nargs=1,
+-          default=arm_option_defaults.float_abi,
+-          help='{Use specific arm float ABI (-mfloat-abi=type)|}')
++option('--with-float-abi', nargs=1,
++       default=arm_option_defaults.float_abi,
++       help='{Use specific arm float ABI (-mfloat-abi=type)|}')
+ 
+ 
+ @depends('--with-float-abi')
+ def float_abi_option(value):
+     if value:
+         if value[0] != 'toolchain-default':
+             return ['-mfloat-abi={}'.format(value[0])]
+     return []
+ 
+ 
+-js_option('--with-soft-float', choices=('yes', 'no', 'toolchain-default'),
+-          default='toolchain-default',
+-          nargs='?', help='Use soft float library (-msoft-float)')
++option('--with-soft-float', choices=('yes', 'no', 'toolchain-default'),
++       default='toolchain-default',
++       nargs='?', help='Use soft float library (-msoft-float)')
+ 
+ 
+ @depends('--with-soft-float')
+ def soft_float_option(value):
+     value = normalize_arm_option(value)
+     if value is True:
+         return ['-msoft-float']
+     if value is False:
+diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure
+--- a/build/moz.configure/bindgen.configure
++++ b/build/moz.configure/bindgen.configure
+@@ -57,17 +57,17 @@ def cbindgen(cbindgen_override, toolchai
+         `cargo install cbindgen`, ensure that `cbindgen` is on your PATH,
+         or point at an executable with `CBINDGEN`.
+         '''))
+     check_cbindgen_version(candidates[0], fatal=True)
+ 
+ set_config('CBINDGEN', cbindgen)
+ 
+ # Bindgen can use rustfmt to format Rust file, but it's not required.
+-js_option(env='RUSTFMT', nargs=1, help='Path to the rustfmt program')
++option(env='RUSTFMT', nargs=1, help='Path to the rustfmt program')
+ 
+ rustfmt = check_prog('RUSTFMT', ['rustfmt'], paths=toolchain_search_path,
+                      input='RUSTFMT', allow_missing=True)
+ 
+ 
+ # We support setting up the appropriate options for bindgen via setting
+ # LLVM_CONFIG or by providing explicit configure options.  The Windows
+ # installer of LLVM/Clang doesn't provide llvm-config, so we need both
+@@ -105,25 +105,25 @@ def llvm_config_paths(host):
+     mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
+                                         os.path.expanduser(os.path.join('~', '.mozbuild')))
+     bootstrap_llvm_config = os.path.join(mozbuild_state_dir, 'clang', 'bin', 'llvm-config')
+ 
+     llvm_config_progs.append(bootstrap_llvm_config)
+ 
+     return llvm_config_progs
+ 
+-js_option(env='LLVM_CONFIG', nargs=1, help='Path to llvm-config')
++option(env='LLVM_CONFIG', nargs=1, help='Path to llvm-config')
+ 
+ llvm_config = check_prog('LLVM_CONFIG', llvm_config_paths, input='LLVM_CONFIG',
+                          what='llvm-config', allow_missing=True)
+ 
+-js_option('--with-libclang-path', nargs=1,
+-          help='Absolute path to a directory containing Clang/LLVM libraries for bindgen (version 3.9.x or above)')
+-js_option('--with-clang-path', nargs=1,
+-          help='Absolute path to a Clang binary for bindgen (version 3.9.x or above)')
++option('--with-libclang-path', nargs=1,
++       help='Absolute path to a directory containing Clang/LLVM libraries for bindgen (version 3.9.x or above)')
++option('--with-clang-path', nargs=1,
++       help='Absolute path to a Clang binary for bindgen (version 3.9.x or above)')
+ 
+ def invoke_llvm_config(llvm_config, *options):
+     '''Invoke llvm_config with the given options and return the first line of
+     output.'''
+     lines = check_cmd_output(llvm_config, *options).splitlines()
+     return lines[0]
+ 
+ @imports(_from='textwrap', _import='dedent')
+@@ -353,19 +353,19 @@ def basic_bindgen_cflags(target, is_unix
+     # XXX We wouldn't have to do this if we were using the compiler from
+     # toolchain.configure, rather than just `check_compiler`.
+     if macos_sdk and target.os == 'OSX':
+         args += ['-isysroot', macos_sdk]
+ 
+     return args
+ 
+ 
+-js_option(env='BINDGEN_CFLAGS',
+-          nargs=1,
+-          help='Options bindgen should pass to the C/C++ parser')
++option(env='BINDGEN_CFLAGS',
++       nargs=1,
++       help='Options bindgen should pass to the C/C++ parser')
+ 
+ 
+ @depends(basic_bindgen_cflags, 'BINDGEN_CFLAGS')
+ @checking('bindgen cflags', lambda s: s if s else 'no')
+ def bindgen_cflags(base_flags, extra_flags):
+     flags = base_flags
+     if extra_flags and len(extra_flags):
+         flags += extra_flags[0].split()
+diff --git a/build/moz.configure/headers.configure b/build/moz.configure/headers.configure
+--- a/build/moz.configure/headers.configure
++++ b/build/moz.configure/headers.configure
+@@ -68,19 +68,19 @@ check_headers(
+     'byteswap.h',
+     when=non_msvc_compiler,
+ )
+ 
+ # TODO: Move these checks to file specific to --enable-project=js.
+ have_perf_event_h = check_header('linux/perf_event.h',
+                                  when=building_linux)
+ 
+-js_option('--with-linux-headers',
+-          help='location where the Linux kernel headers can be found',
+-          nargs=1)
++option('--with-linux-headers',
++       help='location where the Linux kernel headers can be found',
++       nargs=1)
+ 
+ passed_linux_header_flags = depends_if(
+     '--with-linux-headers')(lambda v: ['-I%s' % v[0]])
+ 
+ 
+ @depends(try_compile(includes=['asm/unistd.h'],
+                      body='return sizeof(__NR_perf_event_open);',
+                      flags=passed_linux_header_flags,
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -1048,34 +1048,16 @@ def build_project(include_project_config
+     return ret
+ 
+ 
+ set_config('MOZ_BUILD_APP', build_project)
+ set_define('MOZ_BUILD_APP', build_project)
+ add_old_configure_assignment('MOZ_BUILD_APP', build_project)
+ 
+ 
+-# This is temporary until js/src/configure and configure are merged.
+-# Use instead of option() in js/moz.configure and more generally, for
+-# options that are shared between configure and js/src/configure.
+-@dependable
+-def js_configure_args():
+-    return []
+-
+-@template
+-def js_option(*args, **kwargs):
+-    opt = option(*args, **kwargs)
+-
+-    @depends(js_configure_args, opt.option, build_project, when=kwargs.get('when'))
+-    def js_option(js_configure_args, value, build_project):
+-        if build_project != 'js':
+-            arg = value.format(opt.option)
+-            js_configure_args.append(arg)
+-
+-
+ # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
+ # The logic works like this:
+ # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
+ # - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
+ # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
+ @depends(check_build_environment, '--help')
+ @imports(_from='__builtin__', _import='open')
+ @imports('re')
+diff --git a/build/moz.configure/memory.configure b/build/moz.configure/memory.configure
+--- a/build/moz.configure/memory.configure
++++ b/build/moz.configure/memory.configure
+@@ -5,36 +5,36 @@
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ 
+ 
+ @depends(target)
+ def jemalloc_default(target):
+     return target.kernel in ('Darwin', 'Linux', 'WINNT')
+ 
+ 
+-js_option('--enable-jemalloc', env='MOZ_MEMORY', default=jemalloc_default,
+-          help='{Replace|Do not replace} memory allocator with jemalloc')
++option('--enable-jemalloc', env='MOZ_MEMORY', default=jemalloc_default,
++       help='{Replace|Do not replace} memory allocator with jemalloc')
+ 
+ 
+ set_config('MOZ_MEMORY', True, when='--enable-jemalloc')
+ set_define('MOZ_MEMORY', True, when='--enable-jemalloc')
+ add_old_configure_assignment('MOZ_MEMORY', True, when='--enable-jemalloc')
+ 
+ 
+ @depends(milestone, build_project)
+ def replace_malloc_default(milestone, build_project):
+     if build_project == 'memory':
+         return True
+     if milestone.is_nightly and build_project != 'js':
+         return True
+ 
+ 
+-js_option('--enable-replace-malloc', default=replace_malloc_default,
+-          when='--enable-jemalloc',
+-          help='{Enable|Disable} ability to dynamically replace the malloc implementation')
++option('--enable-replace-malloc', default=replace_malloc_default,
++       when='--enable-jemalloc',
++       help='{Enable|Disable} ability to dynamically replace the malloc implementation')
+ 
+ 
+ set_config('MOZ_REPLACE_MALLOC', True, when='--enable-replace-malloc')
+ set_define('MOZ_REPLACE_MALLOC', True, when='--enable-replace-malloc')
+ 
+ 
+ @depends(build_project, when='--enable-replace-malloc')
+ def replace_malloc_static(build_project):
+diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure
+--- a/build/moz.configure/nspr.configure
++++ b/build/moz.configure/nspr.configure
+@@ -1,25 +1,25 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # vim: set filetype=python:
+ # 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/.
+ 
+ # Top-level configure defaults to building NSPR from source. Standalone JS
+ # doesn't.
+-js_option('--enable-nspr-build', when=js_standalone,
+-          help='{Build|Do not build} NSPR from source tree')
++option('--enable-nspr-build', when=js_standalone,
++       help='{Build|Do not build} NSPR from source tree')
+ 
+ @depends('--enable-nspr-build', when=js_standalone)
+ def enable_nspr_build(enable):
+     if enable:
+         return enable
+ 
+-js_option('--with-system-nspr', help='Use system NSPR')
++option('--with-system-nspr', help='Use system NSPR')
+ 
+ @depends(enable_nspr_build, '--with-system-nspr', js_standalone)
+ def build_nspr(nspr_build, system_nspr, js_standalone):
+     if nspr_build is not None and nspr_build.origin != 'default':
+         if nspr_build and system_nspr:
+             die('Cannot use both --enable-nspr-build and --with-system-nspr')
+     if js_standalone:
+         return nspr_build
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -2,18 +2,18 @@
+ # vim: set filetype=python:
+ # 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/.
+ 
+ 
+ # Rust is required by `rust_compiler` below. We allow_missing here
+ # to propagate failures to the better error message there.
+-js_option(env='RUSTC', nargs=1, help='Path to the rust compiler')
+-js_option(env='CARGO', nargs=1, help='Path to the Cargo package manager')
++option(env='RUSTC', nargs=1, help='Path to the rust compiler')
++option(env='CARGO', nargs=1, help='Path to the Cargo package manager')
+ 
+ rustc = check_prog('_RUSTC', ['rustc'], what='rustc',
+                    paths=toolchain_search_path, input='RUSTC',
+                    allow_missing=True)
+ cargo = check_prog('_CARGO', ['cargo'], what='cargo',
+                    paths=toolchain_search_path, input='CARGO',
+                    allow_missing=True)
+ 
+@@ -421,17 +421,17 @@ def rust_target_env_name(triple):
+ # uppercase function in make, and we don't want to shell out just for
+ # converting a string to uppercase.
+ set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
+ 
+ # This is used for putting source info into symbol files.
+ set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
+ 
+ # Rustdoc is required by Rust tests below.
+-js_option(env='RUSTDOC', nargs=1, help='Path to the rustdoc program')
++option(env='RUSTDOC', nargs=1, help='Path to the rustdoc program')
+ 
+ rustdoc = check_prog('RUSTDOC', ['rustdoc'], paths=toolchain_search_path,
+                      input='RUSTDOC', allow_missing=True)
+ 
+ # This option is separate from --enable-tests because Rust tests are particularly
+ # expensive in terms of compile time (especially for code in libxul).
+ option('--enable-rust-tests',
+        help='Enable building of Rust tests, and build-time execution of them')
+@@ -441,18 +441,18 @@ option('--enable-rust-tests',
+ def rust_tests(enable_rust_tests, rustdoc):
+     if enable_rust_tests and not rustdoc:
+         die('--enable-rust-tests requires rustdoc')
+     return bool(enable_rust_tests)
+ 
+ 
+ set_config('MOZ_RUST_TESTS', rust_tests)
+ 
+-js_option(env='WIN64_LINK', nargs=1, help='Path to link.exe that targets win64')
+-js_option(env='WIN64_LIB', nargs=1, help='Paths to libraries for the win64 linker')
++option(env='WIN64_LINK', nargs=1, help='Path to link.exe that targets win64')
++option(env='WIN64_LIB', nargs=1, help='Paths to libraries for the win64 linker')
+ 
+ set_config('WIN64_LINK', depends('WIN64_LINK')(lambda x: x))
+ set_config('WIN64_LIB', depends('WIN64_LIB')(lambda x: x))
+ 
+ 
+ @depends(target, rustc_info, c_compiler, 'WIN64_LINK', 'WIN64_LIB')
+ def win64_cargo_linker(target, rustc_info, compiler_info, link, lib):
+     # When we're building a 32-bit Windows build with a 64-bit rustc, we
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
+--- a/build/moz.configure/toolchain.configure
++++ b/build/moz.configure/toolchain.configure
+@@ -2,43 +2,44 @@
+ # vim: set filetype=python:
+ # 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/.
+ 
+ imply_option('--enable-release', mozilla_official)
+ imply_option('--enable-release', depends_if('MOZ_AUTOMATION')(lambda x: True))
+ 
+-js_option('--enable-release',
+-          help='{Build|Do not build} with more conservative, release '
+-               'engineering-oriented options.{ This may slow down builds.|}')
++option('--enable-release',
++       default=milestone.is_release_or_beta,
++       help='{Build|Do not build} with more conservative, release '
++            'engineering-oriented options.{ This may slow down builds.|}')
+ 
+ 
+ @depends('--enable-release')
+ def developer_options(value):
+     if not value:
+         return True
+ 
+ 
+ add_old_configure_assignment('DEVELOPER_OPTIONS', developer_options)
+ set_config('DEVELOPER_OPTIONS', developer_options)
+ 
+ # PGO
+ # ==============================================================
+-js_option(env='MOZ_PGO', help='Build with profile guided optimizations')
++option(env='MOZ_PGO', help='Build with profile guided optimizations')
+ 
+ set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
+ 
+ 
+ # Code optimization
+ # ==============================================================
+ 
+-js_option('--disable-optimize',
+-          nargs='?',
+-          help='Disable optimizations via compiler flags')
++option('--disable-optimize',
++       nargs='?',
++       help='Disable optimizations via compiler flags')
+ 
+ 
+ @depends('--enable-optimize', '--help')
+ def moz_optimize(option, _):
+     flags = None
+ 
+     if len(option):
+         val = '2'
+@@ -135,17 +136,17 @@ def host_is_osx(host):
+     if host.os == 'OSX':
+         return True
+ 
+ 
+ with only_when(host_is_osx | target_is_osx):
+     # MacOS SDK
+     # =========
+ 
+-    js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
++    option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
+            help='Location of platform SDK to use')
+ 
+     @depends('--with-macos-sdk', host)
+     @imports(_from='os.path', _import='isdir')
+     @imports(_from='biplist', _import='readPlist')
+     def macos_sdk(sdk, host):
+         sdk_min_version = Version('10.11')
+         sdk_max_version = Version('10.13')
+@@ -208,25 +209,21 @@ with only_when(target_is_osx):
+             return value
+         return '/System/Library/PrivateFrameworks'
+ 
+     set_config('MACOS_PRIVATE_FRAMEWORKS_DIR', macos_private_frameworks)
+ 
+ 
+ # Compiler wrappers
+ # ==============================================================
+-# Normally, we'd use js_option and automatically have those variables
+-# propagated to js/src, but things are complicated by possible additional
+-# wrappers in CC/CXX, and by other subconfigures that do not handle those
+-# options and do need CC/CXX altered.
+ option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
+        help='Enable compiling with wrappers such as distcc and ccache')
+ 
+-js_option('--with-ccache', env='CCACHE', nargs='?',
+-          help='Enable compiling with ccache')
++option('--with-ccache', env='CCACHE', nargs='?',
++       help='Enable compiling with ccache')
+ 
+ 
+ @depends_if('--with-ccache')
+ def ccache(value):
+     if len(value):
+         return value
+     # If --with-ccache was given without an explicit value, we default to
+     # 'ccache'.
+@@ -308,18 +305,18 @@ def hazard_analysis(value):
+         return True
+ 
+ 
+ set_config('MOZ_HAZARD', hazard_analysis)
+ 
+ 
+ # Cross-compilation related things.
+ # ==============================================================
+-js_option('--with-toolchain-prefix', env='TOOLCHAIN_PREFIX', nargs=1,
+-          help='Prefix for the target toolchain')
++option('--with-toolchain-prefix', env='TOOLCHAIN_PREFIX', nargs=1,
++       help='Prefix for the target toolchain')
+ 
+ 
+ @depends('--with-toolchain-prefix', target, cross_compiling)
+ def toolchain_prefix(value, target, cross_compiling):
+     if value:
+         return tuple(value)
+     if cross_compiling:
+         return ('%s-' % target.toolchain, '%s-' % target.alias)
+@@ -584,30 +581,30 @@ def get_vc_paths(topsrcdir):
+ 
+ 
+ @depends(host)
+ def host_is_windows(host):
+     if host.kernel == 'WINNT':
+         return True
+ 
+ 
+-js_option('--with-visual-studio-version', nargs=1,
+-          choices=('2017', '2019'), when=host_is_windows,
+-          help='Select a specific Visual Studio version to use')
++option('--with-visual-studio-version', nargs=1,
++       choices=('2017', '2019'), when=host_is_windows,
++       help='Select a specific Visual Studio version to use')
+ 
+ 
+ @depends('--with-visual-studio-version', when=host_is_windows)
+ def vs_major_version(value):
+     if value:
+         return {'2017': 15,
+                 '2019': 16}[value[0]]
+ 
+ 
+-js_option(env='VC_PATH', nargs=1, when=host_is_windows,
+-          help='Path to the Microsoft Visual C/C++ compiler')
++option(env='VC_PATH', nargs=1, when=host_is_windows,
++       help='Path to the Microsoft Visual C/C++ compiler')
+ 
+ 
+ @depends(vs_major_version, check_build_environment, 'VC_PATH',
+          '--with-visual-studio-version', when=host_is_windows)
+ @imports(_from='__builtin__', _import='sorted')
+ @imports(_from='operator', _import='itemgetter')
+ def vc_compiler_paths_for_version(vs_major_version, env, vc_path, vs_release_name):
+     if vc_path and vs_release_name:
+@@ -1259,19 +1256,19 @@ def default_debug_flags(compiler_info):
+ 
+ option(env='MOZ_DEBUG_FLAGS',
+        nargs=1,
+        help='Debug compiler flags')
+ 
+ imply_option('--enable-debug-symbols',
+              depends_if('--enable-debug')(lambda v: v))
+ 
+-js_option('--disable-debug-symbols',
+-          nargs='?',
+-          help='Disable debug symbols using the given compiler flags')
++option('--disable-debug-symbols',
++       nargs='?',
++       help='Disable debug symbols using the given compiler flags')
+ 
+ set_config('MOZ_DEBUG_SYMBOLS',
+            depends_if('--enable-debug-symbols')(lambda _: True))
+ 
+ 
+ @depends('MOZ_DEBUG_FLAGS', '--enable-debug-symbols', default_debug_flags)
+ def debug_flags(env_debug_flags, enable_debug_flags, default_debug_flags):
+     # If MOZ_DEBUG_FLAGS is set, and --enable-debug-symbols is set to a value,
+@@ -1505,20 +1502,20 @@ def is_windows(target, host):
+     return host.kernel == 'WINNT' and target.kernel == 'WINNT'
+ 
+ 
+ include('windows.configure', when=is_windows)
+ 
+ # LTO
+ # ==============================================================
+ 
+-js_option('--enable-lto',
+-          nargs='?',
+-          choices=('full', 'thin'),
+-          help='Enable LTO')
++option('--enable-lto',
++       nargs='?',
++       choices=('full', 'thin'),
++       help='Enable LTO')
+ 
+ 
+ @depends('--enable-lto', 'MOZ_PGO', c_compiler)
+ @imports('multiprocessing')
+ def lto(value, pgo, c_compiler):
+     cflags = []
+     ldflags = []
+     enabled = None
+@@ -1565,88 +1562,88 @@ set_define('MOZ_LTO', lto.enabled)
+ set_config('MOZ_LTO_CFLAGS', lto.cflags)
+ set_config('MOZ_LTO_LDFLAGS', lto.ldflags)
+ add_old_configure_assignment('MOZ_LTO_CFLAGS', lto.cflags)
+ add_old_configure_assignment('MOZ_LTO_LDFLAGS', lto.ldflags)
+ 
+ # ASAN
+ # ==============================================================
+ 
+-js_option('--enable-address-sanitizer', help='Enable Address Sanitizer')
++option('--enable-address-sanitizer', help='Enable Address Sanitizer')
+ 
+ 
+ @depends_if('--enable-address-sanitizer')
+ def asan(value):
+     return True
+ 
+ 
+ add_old_configure_assignment('MOZ_ASAN', asan)
+ 
+ # MSAN
+ # ==============================================================
+ 
+-js_option('--enable-memory-sanitizer', help='Enable Memory Sanitizer')
++option('--enable-memory-sanitizer', help='Enable Memory Sanitizer')
+ 
+ 
+ @depends(when='--enable-memory-sanitizer')
+ def msan():
+     return True
+ 
+ 
+ add_old_configure_assignment('MOZ_MSAN', msan)
+ 
+ # TSAN
+ # ==============================================================
+ 
+-js_option('--enable-thread-sanitizer', help='Enable Thread Sanitizer')
++option('--enable-thread-sanitizer', help='Enable Thread Sanitizer')
+ 
+ 
+ @depends(when='--enable-thread-sanitizer')
+ def tsan():
+     return True
+ 
+ 
+ add_old_configure_assignment('MOZ_TSAN', tsan)
+ 
+ # UBSAN
+ # ==============================================================
+ 
+-js_option('--enable-undefined-sanitizer',
+-          nargs='*',
+-          help='Enable UndefinedBehavior Sanitizer')
++option('--enable-undefined-sanitizer',
++       nargs='*',
++       help='Enable UndefinedBehavior Sanitizer')
+ 
+ @depends_if('--enable-undefined-sanitizer')
+ def ubsan(options):
+     default_checks = [
+         'bool',
+         'bounds',
+         'vla-bound',
+     ]
+ 
+     checks = options if len(options) else default_checks
+ 
+     return ','.join(checks)
+ 
+ add_old_configure_assignment('MOZ_UBSAN_CHECKS', ubsan)
+ 
+ 
+-js_option('--enable-signed-overflow-sanitizer',
+-          help='Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts)')
++option('--enable-signed-overflow-sanitizer',
++       help='Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts)')
+ 
+ 
+ @depends(when='--enable-signed-overflow-sanitizer')
+ def ub_signed_overflow_san():
+     return True
+ 
+ 
+ add_old_configure_assignment('MOZ_SIGNED_OVERFLOW_SANITIZE', ub_signed_overflow_san)
+ 
+ 
+-js_option('--enable-unsigned-overflow-sanitizer',
+-          help='Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts)')
++option('--enable-unsigned-overflow-sanitizer',
++       help='Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts)')
+ 
+ 
+ @depends(when='--enable-unsigned-overflow-sanitizer')
+ def ub_unsigned_overflow_san():
+     return True
+ 
+ 
+ add_old_configure_assignment('MOZ_UNSIGNED_OVERFLOW_SANITIZE', ub_unsigned_overflow_san)
+@@ -1731,19 +1728,19 @@ option(env='RUSTFLAGS',
+        nargs=1,
+        help='Rust compiler flags')
+ set_config('RUSTFLAGS', depends('RUSTFLAGS')(lambda flags: flags))
+ 
+ 
+ # Rust compiler flags
+ # ==============================================================
+ 
+-js_option(env='RUSTC_OPT_LEVEL',
+-          nargs=1,
+-          help='Rust compiler optimization level (-C opt-level=%s)')
++option(env='RUSTC_OPT_LEVEL',
++       nargs=1,
++       help='Rust compiler optimization level (-C opt-level=%s)')
+ 
+ # --enable-release kicks in full optimizations.
+ imply_option('RUSTC_OPT_LEVEL', '2', when='--enable-release')
+ 
+ 
+ @depends('RUSTC_OPT_LEVEL', moz_optimize)
+ def rustc_opt_level(opt_level_option, moz_optimize):
+     if opt_level_option:
+@@ -1853,19 +1850,20 @@ def is_linker_option_enabled(target):
+ 
+ option('--enable-gold',
+        env='MOZ_FORCE_GOLD',
+        help='Enable GNU Gold Linker when it is not already the default',
+        when=is_linker_option_enabled)
+ 
+ imply_option('--enable-linker', 'gold', when='--enable-gold')
+ 
+-js_option('--enable-linker', nargs=1,
+-          help='Select the linker {bfd, gold, ld64, lld, lld-*}',
+-          when=is_linker_option_enabled)
++option('--enable-linker', nargs=1,
++       help='Select the linker {bfd, gold, ld64, lld, lld-*}{|}',
++       default="bfd",
++       when=is_linker_option_enabled)
+ 
+ 
+ # No-op to enable depending on --enable-linker from default_elfhack in
+ # toolkit/moz.configure.
+ @depends('--enable-linker', when=is_linker_option_enabled)
+ def enable_linker(linker):
+     return linker
+ 
+@@ -2003,17 +2001,17 @@ def gcc_use_gnu_ld(select_linker, target
+ # GCC_USE_GNU_LD=1 means the linker is command line compatible with GNU ld.
+ set_config('GCC_USE_GNU_LD', gcc_use_gnu_ld)
+ add_old_configure_assignment('GCC_USE_GNU_LD', gcc_use_gnu_ld)
+ 
+ 
+ # Assembler detection
+ # ==============================================================
+ 
+-js_option(env='AS', nargs=1, help='Path to the assembler')
++option(env='AS', nargs=1, help='Path to the assembler')
+ 
+ @depends(target, c_compiler)
+ def as_info(target, c_compiler):
+     if c_compiler.type in ('msvc', 'clang-cl'):
+         ml = {
+             'x86': 'ml.exe',
+             'x86_64': 'ml64.exe',
+             'aarch64': 'armasm64.exe',
+@@ -2105,24 +2103,24 @@ def as_outoption(as_info, target):
+     return '-o '
+ 
+ 
+ set_config('ASOUTOPTION', as_outoption)
+ 
+ # clang plugin handling
+ # ==============================================================
+ 
+-js_option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN',
+-          help="Enable building with the mozilla clang plugin")
++option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN',
++       help="Enable building with the Clang plugin (gecko specific static analyzers)")
+ 
+ add_old_configure_assignment('ENABLE_CLANG_PLUGIN',
+                              depends_if('--enable-clang-plugin')(lambda _: True))
+ 
+-js_option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
+-          help="Enable building with the mozsearch indexer plugin")
++option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
++       help="Enable building with the mozsearch indexer plugin")
+ 
+ add_old_configure_assignment('ENABLE_MOZSEARCH_PLUGIN',
+                              depends_if('--enable-mozsearch-plugin')(lambda _: True))
+ 
+ # nasm detection
+ # ==============================================================
+ nasm = check_prog('NASM', ['nasm'], allow_missing=True, paths=toolchain_search_path)
+ 
+@@ -2190,33 +2188,33 @@ set_config('HAVE_NASM', have_nasm)
+ set_config('HAVE_YASM', have_yasm)
+ # Until the YASM variable is not necessary in old-configure.
+ add_old_configure_assignment('YASM', have_yasm)
+ 
+ 
+ # Code Coverage
+ # ==============================================================
+ 
+-js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+-          help='Enable code coverage')
++option('--enable-coverage', env='MOZ_CODE_COVERAGE',
++       help='Enable code coverage')
+ 
+ @depends('--enable-coverage')
+ def code_coverage(value):
+     if value:
+         return True
+ 
+ 
+ set_config('MOZ_CODE_COVERAGE', code_coverage)
+ set_define('MOZ_CODE_COVERAGE', code_coverage)
+ 
+ # Libstdc++ compatibility hacks
+ # ==============================================================
+ #
+-js_option('--enable-stdcxx-compat', env='MOZ_STDCXX_COMPAT',
+-          help='Enable compatibility with older libstdc++')
++option('--enable-stdcxx-compat', env='MOZ_STDCXX_COMPAT',
++       help='Enable compatibility with older libstdc++')
+ 
+ 
+ @template
+ def libstdcxx_version(var, compiler, host_or_target):
+     @depends(compiler, host_or_target, when='--enable-stdcxx-compat')
+     @imports(_from='mozbuild.configure.libstdcxx', _import='find_version')
+     def version(compiler, host_or_target):
+         if host_or_target.os == 'Android':
+@@ -2342,17 +2340,17 @@ def ar_config(link, toolchain_prefix):
+ 
+ ar = check_prog('AR', ar_config.names, paths=toolchain_search_path)
+ 
+ add_old_configure_assignment('AR', ar)
+ 
+ set_config('AR_FLAGS', ar_config.flags)
+ 
+ 
+-js_option('--enable-cpp-rtti', help='Enable C++ RTTI')
++option('--enable-cpp-rtti', help='Enable C++ RTTI')
+ 
+ add_old_configure_assignment('_MOZ_USE_RTTI', '1', when='--enable-cpp-rtti')
+ 
+ # Frame pointers
+ # ==============================================================
+ @depends(c_compiler, target)
+ def frame_pointer_flags(compiler, target):
+     if compiler.type in ('msvc', 'clang-cl'):
+@@ -2369,18 +2367,18 @@ def frame_pointer_flags(compiler, target
+ @depends(moz_optimize.optimize, moz_debug, target,
+          '--enable-memory-sanitizer', '--enable-address-sanitizer',
+          '--enable-undefined-sanitizer')
+ def frame_pointer_default(optimize, debug, target, msan, asan, ubsan):
+     return bool(not optimize or debug or msan or asan or ubsan or \
+         (target.os == 'WINNT' and target.cpu in ('x86', 'aarch64')))
+ 
+ 
+-js_option('--enable-frame-pointers', default=frame_pointer_default,
+-          help='{Enable|Disable} frame pointers')
++option('--enable-frame-pointers', default=frame_pointer_default,
++       help='{Enable|Disable} frame pointers')
+ 
+ 
+ @depends('--enable-frame-pointers', frame_pointer_flags)
+ def frame_pointer_flags(enable, flags):
+     if enable:
+         return flags.enable
+     return flags.disable
+ 
+diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure
+--- a/build/moz.configure/warnings.configure
++++ b/build/moz.configure/warnings.configure
+@@ -1,17 +1,17 @@
+ # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+ # vim: set filetype=python:
+ # 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/.
+ 
+-js_option('--enable-warnings-as-errors', env='MOZ_ENABLE_WARNINGS_AS_ERRORS',
+-          default=depends('MOZ_AUTOMATION')(lambda x: bool(x)),
+-          help='{Enable|Disable} treating warnings as errors')
++option('--enable-warnings-as-errors', env='MOZ_ENABLE_WARNINGS_AS_ERRORS',
++       default=depends('MOZ_AUTOMATION')(lambda x: bool(x)),
++       help='{Enable|Disable} treating warnings as errors')
+ 
+ add_old_configure_assignment(
+     'MOZ_ENABLE_WARNINGS_AS_ERRORS',
+     depends('--enable-warnings-as-errors')(lambda x: bool(x)))
+ 
+ 
+ @depends('--enable-warnings-as-errors')
+ def rust_warning_flags(warnings_as_errors):
+diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure
+--- a/build/moz.configure/windows.configure
++++ b/build/moz.configure/windows.configure
+@@ -343,17 +343,17 @@ def dia_sdk_subdir(host_or_target, subdi
+         # args.
+         old_target = (old_target,) if old_target else ()
+         return os.path.join(dia_sdk_dir, subdir, *old_target)
+ 
+     return dia_sdk_subdir
+ 
+ 
+ # XXX: remove after bug 1523201
+-js_option(env='WIN_DIA_SDK_BIN_DIR', nargs=1, help='Path to the DIA DLLs')
++option(env='WIN_DIA_SDK_BIN_DIR', nargs=1, help='Path to the DIA DLLs')
+ 
+ 
+ @depends('WIN_DIA_SDK_BIN_DIR', dia_sdk_subdir(host, 'bin'))
+ @imports('os')
+ def dia_sdk_bin_dir(from_env, guessed):
+     if from_env:
+         if not os.path.isdir(from_env[0]):
+             die('Invalid Windows DIA SDK directory: {}'.format(from_env))
+@@ -489,22 +489,22 @@ def linker_progs_for(host_or_target):
+     def linker_progs(compiler):
+         if compiler.type == 'msvc':
+             return ('link', 'lld-link')
+         if compiler.type == 'clang-cl':
+             return ('lld-link', 'link')
+     return linker_progs
+ 
+ 
+-js_option(env='LINKER', nargs=1, help='Path to the linker')
++option(env='LINKER', nargs=1, help='Path to the linker')
+ 
+ link = check_prog('LINKER', linker_progs_for(target), input='LINKER',
+                   paths=toolchain_search_path)
+ 
+-js_option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
++option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
+ 
+ host_link = check_prog('HOST_LINKER', linker_progs_for(host),
+                        input='HOST_LINKER',
+                        paths=host_toolchain_search_path)
+ 
+ add_old_configure_assignment('LINKER', link)
+ 
+ 
+diff --git a/js/ffi.configure b/js/ffi.configure
+--- a/js/ffi.configure
++++ b/js/ffi.configure
+@@ -7,18 +7,18 @@
+ @depends(target)
+ def force_system_ffi(target):
+     # Pre-emptively move to system ffi for non-tier one platforms.
+     if target.cpu not in ('x86', 'x86_64', 'arm', 'aarch64'):
+         return True
+ 
+ imply_option('--with-system-ffi', force_system_ffi, "target")
+ 
+-js_option('--with-system-ffi',
+-          help='Use system libffi (located with pkgconfig)')
++option('--with-system-ffi',
++       help='Use system libffi (located with pkgconfig)')
+ 
+ use_system_ffi = depends_if('--with-system-ffi')(lambda _: True)
+ 
+ system_ffi = pkg_check_modules('MOZ_FFI', 'libffi > 3.0.9',
+                                when=use_system_ffi)
+ 
+ building_ffi = depends(system_ffi)(lambda v: v is None)
+ 
+diff --git a/js/moz.configure b/js/moz.configure
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -1,27 +1,24 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # vim: set filetype=python:
+ # 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/.
+ 
+-# /!\ Use js_option() instead of option() in this file. /!\
+-# =========================================================
+-
+ @depends(build_project)
+ def js_standalone(build_project):
+     if build_project == 'js':
+         return True
+ 
+ # Branding
+ # ==============================================================
+-js_option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
+-          help='Used for e.g. the binary program file name. If not set, '
+-          'defaults to a lowercase form of MOZ_APP_BASENAME.')
++option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
++       help='Used for e.g. the binary program file name. If not set, '
++       'defaults to a lowercase form of MOZ_APP_BASENAME.')
+ 
+ @depends('--with-app-name', js_standalone, moz_app_basename)
+ def moz_app_name(value, js_standalone, moz_app_basename):
+     if value:
+         return value[0]
+     if js_standalone:
+         return 'js'
+     return moz_app_basename.lower()
+@@ -33,39 +30,39 @@ include('../build/moz.configure/nspr.con
+ include('../build/moz.configure/rust.configure',
+         when='--enable-compile-environment')
+ include('../build/moz.configure/bindgen.configure',
+         when='--enable-compile-environment')
+ 
+ set_config('JS_STANDALONE', js_standalone)
+ set_define('JS_STANDALONE', js_standalone)
+ add_old_configure_assignment('JS_STANDALONE', js_standalone)
+-js_option('--enable-js-shell', default=js_standalone,
+-          help='{Build|Do not build} the JS shell')
++option('--enable-js-shell', default=js_standalone,
++       help='{Build|Do not build} the JS shell')
+ 
+ @depends('--enable-js-shell')
+ def js_disable_shell(value):
+     if not value:
+         return True
+ 
+ set_config('JS_DISABLE_SHELL', js_disable_shell)
+ 
+ set_define('JS_64BIT', depends(target)(lambda t: t.bitness == 64 or None))
+ 
+ set_define('JS_PUNBOX64', depends(target)(lambda t: t.bitness == 64 or None))
+ set_define('JS_NUNBOX32', depends(target)(lambda t: t.bitness == 32 or None))
+ 
+ 
+ # SpiderMonkey as a shared library, and how its symbols are exported
+ # ==================================================================
+-js_option('--disable-shared-js', when=js_standalone,
+-          help='{Create|Do not create} a shared library')
++option('--disable-shared-js', when=js_standalone,
++       help='{Create|Do not create} a shared library')
+ 
+-js_option('--disable-export-js', when=js_standalone,
+-          help='{Mark|Do not mark} JS symbols as DLL exported/visible')
++option('--disable-export-js', when=js_standalone,
++       help='{Mark|Do not mark} JS symbols as DLL exported/visible')
+ 
+ @depends('--disable-shared-js', '--disable-export-js', when=js_standalone)
+ def shared_js(shared_js, export_js):
+     if shared_js:
+         if not export_js:
+             die('Must export JS symbols when building a shared library.')
+         return True
+ 
+@@ -97,32 +94,32 @@ set_define('MOZ_STATIC_JS', static_js)
+ # JIT support
+ # =======================================================
+ @depends(target)
+ def jit_default(target):
+     if target.cpu in ('x86', 'x86_64', 'arm', 'aarch64', 'mips32', 'mips64'):
+         return True
+     return False
+ 
+-js_option('--enable-jit',
+-          default=jit_default,
+-          help='{Enable|Disable} use of the JITs')
++option('--enable-jit',
++       default=jit_default,
++       help='{Enable|Disable} use of the JITs')
+ 
+ @deprecated_option('--enable-ion')
+ def report_deprecated(value):
+     if value:
+         die('--enable-ion is deprecated, use --enable-jit instead')
+     else:
+         die('--disable-ion is deprecated, use --disable-jit instead')
+ 
+ # JIT code simulator for cross compiles
+ # =======================================================
+-js_option('--enable-simulator', choices=('arm', 'arm64', 'mips32', 'mips64'),
+-          nargs=1,
+-          help='Enable a JIT code simulator for the specified architecture')
++option('--enable-simulator', choices=('arm', 'arm64', 'mips32', 'mips64'),
++       nargs=1,
++       help='Enable a JIT code simulator for the specified architecture')
+ 
+ @depends('--enable-jit', '--enable-simulator', target)
+ def simulator(jit_enabled, simulator_enabled, target):
+     if not jit_enabled or not simulator_enabled:
+         return
+ 
+     sim_cpu = simulator_enabled[0]
+ 
+@@ -204,50 +201,50 @@ def jit_disasm_arm64(jit_enabled, simula
+     if target.cpu == 'aarch64' and debug:
+         return True
+ 
+ set_config('JS_DISASM_ARM64', jit_disasm_arm64)
+ set_define('JS_DISASM_ARM64', jit_disasm_arm64)
+ 
+ # Profiling
+ # =======================================================
+-js_option('--enable-instruments', env='MOZ_INSTRUMENTS',
+-          help='Enable instruments remote profiling')
++option('--enable-instruments', env='MOZ_INSTRUMENTS',
++       help='Enable instruments remote profiling')
+ 
+ @depends('--enable-instruments', target)
+ def instruments(value, target):
+     if value and target.os != 'OSX':
+         die('--enable-instruments cannot be used when targeting %s',
+             target.os)
+     if value:
+         return True
+ 
+ set_config('MOZ_INSTRUMENTS', instruments)
+ set_define('MOZ_INSTRUMENTS', instruments)
+ add_old_configure_assignment('MOZ_INSTRUMENTS', instruments)
+ imply_option('--enable-profiling', instruments, reason='--enable-instruments')
+ 
+-js_option('--enable-callgrind', env='MOZ_CALLGRIND',
+-          help='Enable callgrind profiling')
++option('--enable-callgrind', env='MOZ_CALLGRIND',
++       help='Enable callgrind profiling')
+ 
+ @depends('--enable-callgrind')
+ def callgrind(value):
+     if value:
+         return True
+ 
+ set_define('MOZ_CALLGRIND', callgrind)
+ imply_option('--enable-profiling', callgrind)
+ 
+ @depends(milestone)
+ def enable_profiling(milestone):
+     return milestone.is_nightly
+ 
+-js_option('--enable-profiling', env='MOZ_PROFILING', default=enable_profiling,
+-          help='{Set|Do not set} compile flags necessary for using sampling '
+-                'profilers (e.g. shark, perf)')
++option('--enable-profiling', env='MOZ_PROFILING', default=enable_profiling,
++       help='{Set|Do not set} compile flags necessary for using sampling '
++             'profilers (e.g. shark, perf)')
+ 
+ @depends('--enable-profiling')
+ def profiling(value):
+     if value:
+         return True
+ 
+ add_old_configure_assignment('MOZ_PROFILING', profiling)
+ 
+@@ -264,120 +261,120 @@ def imply_vtune(value, target):
+     if value and ok_cpu and ok_kernel:
+         return True
+ 
+ set_config('MOZ_PROFILING', profiling)
+ set_define('MOZ_PROFILING', profiling)
+ imply_option('--enable-vtune', imply_vtune, reason='--enable-profiling')
+ 
+ 
+-js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
++option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
+ 
+ @depends('--enable-vtune')
+ def vtune(value):
+     if value:
+         return True
+ 
+ set_config('MOZ_VTUNE', vtune)
+ set_define('MOZ_VTUNE', vtune)
+ 
+ 
+-js_option('--enable-gc-trace', env='JS_GC_TRACE',
+-          help='Enable tracing of allocation and finalization')
++option('--enable-gc-trace', env='JS_GC_TRACE',
++       help='Enable tracing of allocation and finalization')
+ 
+ @depends('--enable-gc-trace')
+ def gc_trace(value):
+     if value:
+         return True
+ 
+ set_define('JS_GC_TRACE', gc_trace)
+ 
+ 
+-js_option('--enable-gczeal',
+-          default=depends(when=moz_debug)(lambda: True),
+-          help='{Enable|Disable} zealous GCing')
++option('--enable-gczeal',
++       default=depends(when=moz_debug)(lambda: True),
++       help='{Enable|Disable} zealous GCing')
+ 
+ set_define('JS_GC_ZEAL',
+            depends_if('--enable-gczeal')(lambda _: True))
+ 
+ 
+ # Use a smaller chunk size for GC chunks
+ # ========================================================
+ # Use large (1MB) chunks by default.  This option can be used to give
+ # smaller (currently 256K) chunks.
+-js_option('--enable-small-chunk-size',
+-          help='Allocate memory for JS GC things in smaller chunks')
++option('--enable-small-chunk-size',
++       help='Allocate memory for JS GC things in smaller chunks')
+ 
+ set_define('JS_GC_SMALL_CHUNK_SIZE',
+            depends(when='--enable-small-chunk-size')(lambda: True))
+ 
+ 
+ # Trace logging.
+ # =======================================================
+-js_option('--enable-trace-logging',
+-          default=depends(when=moz_debug)(lambda: True),
+-          help='{Enable|Disable} trace logging')
++option('--enable-trace-logging',
++       default=depends(when=moz_debug)(lambda: True),
++       help='{Enable|Disable} trace logging')
+ 
+ set_config('ENABLE_TRACE_LOGGING',
+            depends_if('--enable-trace-logging')(lambda x: True))
+ set_define('JS_TRACE_LOGGING',
+            depends_if('--enable-trace-logging')(lambda x: True))
+ 
+ 
+ # Enable breakpoint for artificial OOMs
+ # =======================================================
+-js_option('--enable-oom-breakpoint',
+-          help='Enable a breakpoint function for artificial OOMs')
++option('--enable-oom-breakpoint',
++       help='Enable a breakpoint function for artificial OOMs')
+ 
+ set_define('JS_OOM_BREAKPOINT',
+            depends_if('--enable-oom-breakpoint')(lambda _: True))
+ 
+ 
+-js_option('--enable-perf', env='JS_ION_PERF',
+-          help='Enable Linux perf integration')
++option('--enable-perf', env='JS_ION_PERF',
++       help='Enable Linux perf integration')
+ 
+ @depends('--enable-perf')
+ def ion_perf(value):
+     if value:
+         return True
+ 
+ set_define('JS_ION_PERF', ion_perf)
+ 
+ 
+-js_option('--enable-jitspew',
+-          default=depends(when=moz_debug)(lambda: True),
+-          help='{Enable|Disable} the Jit spew and IONFLAGS environment '
+-               'variable')
++option('--enable-jitspew',
++       default=depends(when=moz_debug)(lambda: True),
++       help='{Enable|Disable} the Jit spew and IONFLAGS environment '
++            'variable')
+ 
+ set_define('JS_JITSPEW',
+            depends_if('--enable-jitspew')(lambda _: True))
+ set_config('JS_JITSPEW',
+            depends_if('--enable-jitspew')(lambda _: True))
+ 
+ 
+-js_option('--enable-more-deterministic', env='JS_MORE_DETERMINISTIC',
+-          help='Enable changes that make the shell more deterministic')
++option('--enable-more-deterministic', env='JS_MORE_DETERMINISTIC',
++       help='Enable changes that make the shell more deterministic')
+ 
+ @depends('--enable-more-deterministic')
+ def more_deterministic(value):
+     if value:
+         return True
+ 
+ set_define('JS_MORE_DETERMINISTIC', more_deterministic)
+ 
+ 
+ # CTypes
+ # =======================================================
+ @depends(js_standalone)
+ def ctypes_default(js_standalone):
+     return not js_standalone
+ 
+-js_option('--enable-ctypes',
+-          default=ctypes_default,
+-          help='{Enable|Disable} js-ctypes')
++option('--enable-ctypes',
++       default=ctypes_default,
++       help='{Enable|Disable} js-ctypes')
+ 
+ build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
+ 
+ set_config('BUILD_CTYPES', build_ctypes)
+ set_define('BUILD_CTYPES', build_ctypes)
+ 
+ set_config('JS_HAS_CTYPES', build_ctypes)
+ set_define('JS_HAS_CTYPES', build_ctypes)
+@@ -387,17 +384,17 @@ def ctypes_and_compile_environment(ctype
+     return ctypes and compile_environment
+ 
+ include('ffi.configure', when=ctypes_and_compile_environment)
+ 
+ 
+ # Support various fuzzing options
+ # ==============================================================
+ with only_when('--enable-compile-environment'):
+-    js_option('--enable-fuzzing', help='Enable fuzzing support')
++    option('--enable-fuzzing', help='Enable fuzzing support')
+ 
+     @depends('--enable-fuzzing')
+     def enable_fuzzing(value):
+         if value:
+             return True
+ 
+     @depends(try_compile(body='__AFL_COMPILER;',
+                          check_msg='for AFL compiler',
+@@ -428,51 +425,51 @@ with only_when('--enable-compile-environ
+     add_old_configure_assignment('LIBFUZZER', enable_libfuzzer)
+ 
+     set_config('FUZZING_INTERFACES', enable_fuzzing_interfaces)
+     set_define('FUZZING_INTERFACES', enable_fuzzing_interfaces)
+     add_old_configure_assignment('FUZZING_INTERFACES', enable_fuzzing_interfaces)
+ 
+ # Enable pipeline operator
+ # ===================================================
+-js_option('--enable-pipeline-operator', default=False, help='Enable pipeline operator')
++option('--enable-pipeline-operator', default=False, help='Enable pipeline operator')
+ 
+ @depends('--enable-pipeline-operator')
+ def enable_pipeline_operator(value):
+     if value:
+         return True
+ 
+ set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
+ set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
+ 
+ 
+ # Initial support for new regexp engine
+ # ==================================================
+ 
+-js_option('--enable-new-regexp', default=False, help='Enable new regexp engine')
++option('--enable-new-regexp', default=False, help='Enable new regexp engine'
+ 
+ @depends('--enable-new-regexp')
+ def enable_new_regexp(value):
+     if value:
+         return True
+ 
+ set_config('ENABLE_NEW_REGEXP', enable_new_regexp)
+ set_define('ENABLE_NEW_REGEXP', enable_new_regexp)
+ 
+ 
+ # ECMAScript Internationalization API Support (uses ICU)
+ # ======================================================
+-js_option('--with-system-icu', help='Use system ICU')
++option('--with-system-icu', help='Use system ICU')
+ 
+ system_icu = pkg_check_modules('MOZ_ICU', 'icu-i18n >= 67.1', when='--with-system-icu')
+ 
+ set_config('MOZ_SYSTEM_ICU', True, when=system_icu)
+ set_define('MOZ_SYSTEM_ICU', True, when=system_icu)
+ 
+-js_option('--without-intl-api', help='Disable ECMAScript Internationalization API')
++option('--without-intl-api', help='Disable ECMAScript Internationalization API')
+ 
+ @depends('--with-intl-api', js_standalone)
+ def check_intl_api(enabled, js_standalone):
+     if not enabled and not js_standalone:
+         die('--without-intl-api is not supported')
+ 
+ set_config('JS_HAS_INTL_API', True, when='--with-intl-api')
+ set_define('JS_HAS_INTL_API', True, when='--with-intl-api')
+@@ -509,27 +506,27 @@ def can_build_data_file(yasm, gnu_as, ta
+         return
+     if not yasm and not gnu_as:
+         die('Building ICU requires either yasm or a GNU assembler. If you do not have '
+             'either of those available for this platform you must use --without-intl-api')
+ 
+ 
+ # Options for generating the shell as a script
+ # ============================================
+-js_option('--with-qemu-exe', nargs=1, help='Use path as an arm emulator on host platforms')
++option('--with-qemu-exe', nargs=1, help='Use path as an arm emulator on host platforms')
+ set_config('QEMU_EXE', depends_if('--with-qemu-exe')(lambda x: x))
+ 
+-js_option('--with-cross-lib', nargs=1, default=depends(target.alias)(lambda x: '/usr/%s' % x),
+-          help='Use dir as the location for arm libraries')
++option('--with-cross-lib', nargs=1, default=depends(target.alias)(lambda x: '/usr/%s' % x),
++       help='Use dir as the location for arm libraries')
+ set_config('CROSS_LIB', depends_if('--with-cross-lib')(lambda x: x))
+ 
+ # Enable static checking using sixgill
+ # ====================================
+ 
+-js_option('--with-sixgill', nargs=1, help='Enable static checking of code using sixgill')
++option('--with-sixgill', nargs=1, help='Enable static checking of code using sixgill')
+ 
+ @depends_if('--with-sixgill')
+ @imports('os')
+ def sixgill(value):
+     for f in ('bin/xdbfind', 'gcc/xgill.so', 'scripts/wrap_gcc/g++'):
+         if not os.path.exists(os.path.join(value[0], f)):
+             die('The sixgill plugin and binaries are not at the specified path')
+     return value[0]
+@@ -538,18 +535,18 @@ set_config('SIXGILL_PATH', sixgill)
+ 
+ 
+ # Support for readline
+ # =====================================================
+ @depends('--enable-js-shell', target_is_windows, compile_environment)
+ def editline(js_shell, is_windows, compile_environment):
+     return js_shell and not is_windows and compile_environment
+ 
+-js_option('--enable-readline', help='Link js shell to system readline library',
+-          when=editline)
++option('--enable-readline', help='Link js shell to system readline library',
++       when=editline)
+ 
+ has_readline = check_symbol('readline', flags=['-lreadline'], when='--enable-readline',
+                             onerror=lambda: die('No system readline library found'))
+ 
+ set_config('EDITLINE_LIBS', ['-lreadline'], when=has_readline)
+ 
+ @depends('--enable-readline', editline, when=editline)
+ def bundled_editline(readline, editline):
+diff --git a/moz.configure b/moz.configure
+--- a/moz.configure
++++ b/moz.configure
+@@ -45,29 +45,29 @@ option('--disable-compile-environment',
+ @depends('--disable-compile-environment')
+ def compile_environment(compile_env):
+     if compile_env:
+         return True
+ 
+ set_config('COMPILE_ENVIRONMENT', compile_environment)
+ add_old_configure_assignment('COMPILE_ENVIRONMENT', compile_environment)
+ 
+-js_option('--disable-tests',
+-          help='Do not build test libraries & programs')
++option('--disable-tests',
++       help='Do not build test libraries & programs')
+ 
+ @depends('--disable-tests')
+ def enable_tests(value):
+     if value:
+         return True
+ 
+ set_config('ENABLE_TESTS', enable_tests)
+ set_define('ENABLE_TESTS', enable_tests)
+ 
+-js_option(env='MOZILLA_OFFICIAL',
+-          help='Build an official release')
++option(env='MOZILLA_OFFICIAL',
++       help='Build an official release')
+ 
+ @depends('MOZILLA_OFFICIAL')
+ def mozilla_official(official):
+     if official:
+         return True
+ 
+ set_config('MOZILLA_OFFICIAL', mozilla_official)
+ set_define('MOZILLA_OFFICIAL', mozilla_official)
+@@ -89,36 +89,37 @@ def linux_gtest_defines(target, enable_t
+ 
+ set_define('GTEST_OS_LINUX_ANDROID',
+            linux_gtest_defines.os_linux_android)
+ set_define('GTEST_USE_OWN_TR1_TUPLE',
+            linux_gtest_defines.use_own_tr1_tuple)
+ set_define('GTEST_HAS_CLONE',
+            linux_gtest_defines.has_clone)
+ 
+-js_option('--enable-debug',
+-          nargs='?',
+-          help='Enable building with developer debug info '
+-               '(using the given compiler flags).')
++option('--enable-debug',
++       nargs='?',
++       help='Enable building with developer debug info '
++            '(using the given compiler flags).')
+ 
+ @depends('--enable-debug')
+ def moz_debug(debug):
+     if debug:
+         return bool(debug)
+ 
+ set_config('MOZ_DEBUG', moz_debug)
+ set_define('MOZ_DEBUG', moz_debug)
+ # Override any value MOZ_DEBUG may have from the environment when passing it
+ # down to old-configure.
+ add_old_configure_assignment('MOZ_DEBUG',
+                              depends('--enable-debug')(lambda x: bool(x)))
+ 
+-js_option('--enable-rust-debug',
+-          help='{Build|Do not build} Rust code with debug assertions turned '
+-               'on.')
++option('--enable-rust-debug',
++       default=depends(when='--enable-debug')(lambda: True),
++       help='{Build|Do not build} Rust code with debug assertions turned '
++            'on.')
+ 
+ @depends('--enable-rust-debug', '--enable-debug')
+ def debug_rust(value, debug):
+     if value.origin == 'default':
+         return bool(debug) or None
+     elif bool(value):
+         return True
+ 
+@@ -138,18 +139,18 @@ include('build/moz.configure/memory.conf
+ include('build/moz.configure/headers.configure',
+         when='--enable-compile-environment')
+ include('build/moz.configure/warnings.configure',
+         when='--enable-compile-environment')
+ include('build/moz.configure/flags.configure',
+         when='--enable-compile-environment')
+ # rust.configure is included by js/moz.configure.
+ 
+-js_option('--enable-valgrind',
+-          help='Enable Valgrind integration hooks')
++option('--enable-valgrind',
++       help='Enable Valgrind integration hooks')
+ 
+ valgrind_h = check_header('valgrind/valgrind.h', when='--enable-valgrind')
+ 
+ @depends('--enable-valgrind', valgrind_h)
+ def check_valgrind(valgrind, valgrind_h):
+     if valgrind:
+         if not valgrind_h:
+             die('--enable-valgrind specified but Valgrind is not installed')
+@@ -585,60 +586,60 @@ def nsis_flags(host):
+         return '-nocd'
+     return ''
+ 
+ set_config('MAKENSISU_FLAGS', nsis_flags)
+ 
+ check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
+ 
+ 
+-js_option('--enable-dtrace', help='Build with dtrace support')
++option('--enable-dtrace', help='Build with dtrace support')
+ 
+ dtrace = check_header('sys/sdt.h', when='--enable-dtrace',
+                       onerror=lambda: die('dtrace enabled but sys/sdt.h not found'))
+ 
+ set_config('HAVE_DTRACE', True, when=dtrace)
+ set_define('INCLUDE_MOZILLA_DTRACE', True, when=dtrace)
+ add_old_configure_assignment('enable_dtrace', 'yes', when=dtrace)
+ 
+ 
+-js_option('--disable-icf', help='Disable Identical Code Folding')
++option('--disable-icf', help='Disable Identical Code Folding')
+ 
+ add_old_configure_assignment(
+     'MOZ_DISABLE_ICF', '1', when=depends('--enable-icf')(lambda x: not x))
+ 
+ 
+-js_option('--enable-strip', when=compile_environment,
+-          help='Enable stripping of libs & executables')
++option('--enable-strip', when=compile_environment,
++       help='Enable stripping of libs & executables')
+ 
+ # This should be handled as a `when` once bug 1617793 is fixed.
+ @depends('--enable-strip', c_compiler, when=compile_environment)
+ def enable_strip(strip, c_compiler):
+     if strip and c_compiler.type != 'clang-cl':
+         return True
+ 
+ set_config('ENABLE_STRIP', enable_strip)
+ 
+-js_option('--disable-install-strip', when=compile_environment,
+-          help='Enable stripping of libs & executables when packaging')
++option('--disable-install-strip', when=compile_environment,
++       help='Enable stripping of libs & executables when packaging')
+ 
+ # This should be handled as a `when` once bug 1617793 is fixed.
+ @depends('--enable-install-strip', c_compiler, when=compile_environment)
+ def enable_install_strip(strip, c_compiler):
+     if strip and c_compiler.type != 'clang-cl':
+         return True
+ 
+ set_config('PKG_STRIP', enable_install_strip)
+ 
+ 
+ @depends('--enable-strip', '--enable-install-strip', when=compile_environment)
+ def strip(strip, install_strip):
+     return strip or install_strip
+ 
+-js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
++option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
+ 
+ @depends('STRIP_FLAGS', profiling, target, when=strip)
+ def strip_flags(flags, profiling, target):
+     if flags:
+         return flags[0].split()
+     if profiling:
+         # Only strip debug info and symbols when profiling is enabled, keeping
+         # local symbols.

+ 290 - 0
mozilla-release/patches/1564097-72a1.patch

@@ -0,0 +1,290 @@
+# HG changeset patch
+# User Makoto Kato <m_kato@ga2.so-net.ne.jp>
+# Date 1573645705 0
+# Node ID f01d761796534e46b655e27a634d65ffa5934be9
+# Parent  fbd5965331ad30b954696ab39418eb5bc67cc662
+Bug 1564097 - Set HOST_LINKER when host OS is Windows too. r=glandium
+
+When running Cargo on Windows, `HOST_LINKER` is required by
+`cargo-host-linker.bat`. So we should use windows.configure to set HOST_LINKER
+when host OS is Windows and target OS isn't Windows.
+
+Differential Revision: https://phabricator.services.mozilla.com/D37241
+
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
+--- a/build/moz.configure/toolchain.configure
++++ b/build/moz.configure/toolchain.configure
+@@ -1451,22 +1451,22 @@ def preprocess_option(compiler):
+     else:
+         return '-P -Fi'
+ 
+ 
+ set_config('PREPROCESS_OPTION', preprocess_option)
+ 
+ 
+ # We only want to include windows.configure when we are compiling on
+-# Windows, for Windows.
++# Windows, or for Windows.
+ 
+ 
+ @depends(target, host)
+ def is_windows(target, host):
+-    return host.kernel == 'WINNT' and target.kernel == 'WINNT'
++    return host.kernel == 'WINNT' or target.kernel == 'WINNT'
+ 
+ 
+ include('windows.configure', when=is_windows)
+ 
+ # LTO
+ # ==============================================================
+ 
+ option('--enable-lto',
+@@ -2216,22 +2216,23 @@ set_config('MKCSHLIB', make_shared_libra
+ @depends(c_compiler, toolchain_prefix, when=target_is_windows)
+ def rc_names(c_compiler, toolchain_prefix):
+     if c_compiler.type in ('gcc', 'clang'):
+         return tuple('%s%s' % (p, 'windres')
+                      for p in ('',) + (toolchain_prefix or ()))
+     return ('rc.exe',)
+ 
+ 
+-check_prog('RC', rc_names, paths=sdk_bin_path)
+-
+-
+-@depends(link, toolchain_prefix)
+-def ar_config(link, toolchain_prefix):
+-    if link:  # if LINKER is set, it's either for lld-link or link
++check_prog('RC', rc_names, paths=sdk_bin_path, when=target_is_windows)
++
++
++@depends(link, toolchain_prefix, c_compiler)
++def ar_config(link, toolchain_prefix, c_compiler):
++    if c_compiler.type in ('msvc', 'clang-cl') and link:
++        # if LINKER is set, it's either for lld-link or link
+         if 'lld-link' in link:
+             return namespace(
+                 names=('llvm-lib',),
+                 flags=('-llvmlibthin', '-out:$@'),
+             )
+         else:
+             return namespace(
+                 names=('lib',),
+diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure
+--- a/build/moz.configure/windows.configure
++++ b/build/moz.configure/windows.configure
+@@ -20,20 +20,21 @@ def valid_windows_version(value):
+             return version
+     except ValueError:
+         pass
+ 
+     die('Invalid value for --with-windows-version (%s)', value[0])
+ 
+ 
+ option(env='WINDOWSSDKDIR', nargs=1,
+-       help='Directory containing the Windows SDK')
++       help='Directory containing the Windows SDK',
++       when=host_is_windows)
+ 
+ 
+-@depends('WINDOWSSDKDIR', host)
++@depends('WINDOWSSDKDIR', host, when=host_is_windows)
+ def windows_sdk_dir(value, host):
+     if value:
+         return value
+     if host.kernel != 'WINNT':
+         return ()
+ 
+     return set(x[1] for x in get_registry_values(
+         r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots'
+@@ -89,17 +90,18 @@ def get_sdk_dirs(sdk, subdir):
+ 
+ 
+ @imports(_from='mozbuild.shellutil', _import='quote')
+ def valid_windows_sdk_dir_result(value):
+     if value:
+         return '0x%04x in %s' % (value.version, quote(value.path))
+ 
+ 
+-@depends(c_compiler, windows_sdk_dir, valid_windows_version, 'WINDOWSSDKDIR')
++@depends(c_compiler, windows_sdk_dir, valid_windows_version, 'WINDOWSSDKDIR',
++         when=host_is_windows)
+ @checking('for Windows SDK', valid_windows_sdk_dir_result)
+ @imports(_from='__builtin__', _import='sorted')
+ @imports(_from='__builtin__', _import='Exception')
+ @imports(_from='textwrap', _import='dedent')
+ def valid_windows_sdk_dir(compiler, windows_sdk_dir, target_version,
+                           windows_sdk_dir_env):
+     if windows_sdk_dir_env:
+         windows_sdk_dir_env = windows_sdk_dir_env[0]
+@@ -158,17 +160,17 @@ def valid_windows_sdk_dir(compiler, wind
+ 
+ 
+ @imports(_from='mozbuild.shellutil', _import='quote')
+ def valid_ucrt_sdk_dir_result(value):
+     if value:
+         return '%s in %s' % (value.version, quote(value.path))
+ 
+ 
+-@depends(windows_sdk_dir, 'WINDOWSSDKDIR')
++@depends(windows_sdk_dir, 'WINDOWSSDKDIR', when=host_is_windows)
+ @checking('for Universal CRT SDK', valid_ucrt_sdk_dir_result)
+ @imports('os')
+ @imports(_from='__builtin__', _import='sorted')
+ @imports(_import='mozpack.path', _as='mozpath')
+ def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env):
+     if windows_sdk_dir_env:
+         windows_sdk_dir_env = windows_sdk_dir_env[0]
+     sdks = {}
+@@ -231,20 +233,22 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, 
+     return namespace(
+         path=sdk.path,
+         include=sdk.include,
+         lib=sdk.lib,
+         version=version,
+     )
+ 
+ 
+-@depends(c_compiler, toolchain_search_path)
++@depends(c_compiler, host_c_compiler, toolchain_search_path)
+ @imports('os')
+-def vc_path(c_compiler, toolchain_search_path):
+-    if c_compiler.type not in ('msvc', 'clang-cl'):
++def vc_path(c_compiler, host_c_compiler, toolchain_search_path):
++    # Wrt Bug 1564097: Under Windows it currently is always msvc or clang-cl
++    # for both host and compiler. No need to check the host.
++    if c_compiler.type != 'msvc' and c_compiler.type != 'clang-cl':
+         return
+ 
+     vc_program = c_compiler.compiler
+ 
+     # In clang-cl builds, we use the headers and libraries from an MSVC installation.
+     if c_compiler.type == 'clang-cl':
+         vc_program = find_program('cl.exe', paths=toolchain_search_path)
+         if not vc_program:
+@@ -273,16 +277,18 @@ def dia_sdk_dir(vc_path, c_compiler, dia
+     if dia_sdk_path:
+         path = os.path.normpath(dia_sdk_path[0])
+ 
+     elif vc_path:
+         # This would be easier if we had the installationPath that
+         # get_vc_paths works with, since 'DIA SDK' is relative to that.
+         path = os.path.normpath(os.path.join(
+             vc_path, r'..\..\..\..\DIA SDK'))
++    else:
++        return
+ 
+     if os.path.exists(os.path.join(path, 'include', 'dia2.h')):
+         return path
+ 
+ 
+ @depends(vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
+ @imports('os')
+ def include_path(vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
+@@ -404,38 +410,42 @@ def lib_path_for(host_or_target):
+         ))
+         if dia_sdk_lib_dir:
+             libs.append(dia_sdk_lib_dir)
+         return libs
+ 
+     return lib_path
+ 
+ 
+-@depends(lib_path_for(target))
++@depends_if(lib_path_for(target))
+ @imports('os')
+ def lib_path(libs):
+     # Set in the environment for old-configure
+     libs = os.pathsep.join(libs)
+     os.environ['LIB'] = libs
+     return libs
+ 
+ 
+ set_config('LIB', lib_path)
+ 
+ 
+-@depends(lib_path_for(host))
++@depends_if(lib_path_for(host))
+ @imports(_from='mozbuild.shellutil', _import='quote')
+ def host_linker_libpaths(libs):
+     return ['-LIBPATH:%s' % quote(l) for l in libs]
+ 
+ 
+ set_config('HOST_LINKER_LIBPATHS', host_linker_libpaths)
+ 
+ 
+-option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool')
++# The when is technically wrong and should be removed and the code that
++# @depends on the option will need to be adapted when actual support for
++# clang-cl cross-builds emerge.
++option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool',
++       when=host_is_windows)
+ 
+ 
+ @depends(valid_windows_sdk_dir, valid_ucrt_sdk_dir)
+ @imports(_from='os', _import='environ')
+ @imports('platform')
+ def sdk_bin_path(valid_windows_sdk_dir, valid_ucrt_sdk_dir):
+     if not valid_windows_sdk_dir:
+         return
+@@ -454,22 +464,22 @@ def sdk_bin_path(valid_windows_sdk_dir, 
+     ]
+     if vc_host == 'x64':
+         result.append(
+             os.path.join(valid_windows_sdk_dir.path, versioned_bin, 'x86'))
+     return result
+ 
+ 
+ mt = check_prog('MT', ('mt.exe',), input='MT',
+-                paths=sdk_bin_path)
++                paths=sdk_bin_path, when=host_is_windows)
+ 
+ 
+ # Check that MT is not something unexpected like "magnetic tape manipulation
+ # utility".
+-@depends(mt)
++@depends_if(mt)
+ @checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
+ def valid_mt(path):
+     out = check_cmd_output(path, onerror=lambda: '').splitlines()
+     out = '\n'.join(l for l in out
+                     if 'Microsoft (R) Manifest Tool' in l)
+     if out:
+         return path
+     raise FatalCheckError('%s is not Microsoft Manifest Tool')
+@@ -489,31 +499,31 @@ def linker_progs_for(host_or_target):
+     def linker_progs(compiler):
+         if compiler.type == 'msvc':
+             return ('link', 'lld-link')
+         if compiler.type == 'clang-cl':
+             return ('lld-link', 'link')
+     return linker_progs
+ 
+ 
+-option(env='LINKER', nargs=1, help='Path to the linker')
++option(env='LINKER', nargs=1, when=target_is_windows, help='Path to the linker')
+ 
+ link = check_prog('LINKER', linker_progs_for(target), input='LINKER',
+-                  paths=toolchain_search_path)
++                  when=target_is_windows, paths=toolchain_search_path)
+ 
+-option(env='HOST_LINKER', nargs=1, help='Path to the host linker')
++option(env='HOST_LINKER', nargs=1, when=host_is_windows, help='Path to the host linker')
+ 
+ host_link = check_prog('HOST_LINKER', linker_progs_for(host),
+                        input='HOST_LINKER',
+-                       paths=host_toolchain_search_path)
++                       when=host_is_windows, paths=host_toolchain_search_path)
+ 
+ add_old_configure_assignment('LINKER', link)
+ 
+ 
+-check_prog('MAKECAB', ('makecab.exe',))
++check_prog('MAKECAB', ('makecab.exe',), when=host_is_windows)
+ 
+ 
+ @depends(c_compiler, using_sccache)
+ def need_showincludes_prefix(info, using_sccache):
+     # sccache does its own -showIncludes prefix checking.
+     # clang-cl uses a gcc-style dependency scheme, see toolchain.configure.
+     if info.type == 'msvc' and not using_sccache:
+         return True

+ 241 - 0
mozilla-release/patches/1640578-78a1.patch

@@ -0,0 +1,241 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1590543727 0
+# Node ID fae8aeba1a70e489961d0f82b0be2af231957332
+# Parent  e39cbe38ed79dedb78ca7a940fdb6b96203b8128
+Bug 1640578 - Remove --disable-install-strip from mac mozconfigs. r=froydnj
+
+The need for --disable-install-strip in the mac mozconfigs comes from a
+discrepancy in how stripping is handled between platforms. On Windows,
+there is no stripping. On non-Mac unix, `strip` removes local symbols as
+well as debug info and debug symbols. On Mac, it actually removes too
+much, and one has to pass flags to remove both local symbols (`-x`) and
+debug symbols (`-S`). Debug info is already in a separate file
+(`.dSYM`).
+
+For profiling reasons, we do ship e.g. nightlies with local symbols but
+not debug info or symbols (or at least that's the intent). On Windows,
+again, nothing to do. On non-Mac unix, we pass `--strip-debug` to
+`strip` so that it keeps local symbols. That's where the discrepancy
+comes in for Mac: the build system doesn't handle this at all, so the
+mozconfigs contain --disable-install-strip to avoid stripping.
+
+The build system should be doing what it's expected to be doing from the
+start, without mozconfigs opting into anything.
+
+AFAIK, we only really need the local symbols, so we can `strip -S` on
+Mac when profiling is enabled, rather than `strip -x -S`. This also
+significantly reduces the size of the installer for nightlies.
+
+And while we're here, move the logic out of old-configure and into
+python configure.
+
+Differential Revision: https://phabricator.services.mozilla.com/D76789
+
+diff --git a/browser/config/mozconfigs/macosx64/devedition b/browser/config/mozconfigs/macosx64/devedition
+--- a/browser/config/mozconfigs/macosx64/devedition
++++ b/browser/config/mozconfigs/macosx64/devedition
+@@ -1,14 +1,13 @@
+ . "$topsrcdir/browser/config/mozconfigs/macosx64/common-opt"
+ 
+ # Add-on signing is not required for DevEdition
+ MOZ_REQUIRE_SIGNING=0
+ 
+-ac_add_options --disable-install-strip
+ ac_add_options --enable-verify-mar
+ 
+ ac_add_options --enable-lto
+ 
+ ac_add_options --enable-instruments
+ 
+ # Cross-compiled builds fail when dtrace is enabled
+ if test `uname -s` != Linux; then
+diff --git a/browser/config/mozconfigs/macosx64/nightly b/browser/config/mozconfigs/macosx64/nightly
+--- a/browser/config/mozconfigs/macosx64/nightly
++++ b/browser/config/mozconfigs/macosx64/nightly
+@@ -1,11 +1,10 @@
+ . "$topsrcdir/browser/config/mozconfigs/macosx64/common-opt"
+ 
+-ac_add_options --disable-install-strip
+ ac_add_options --enable-verify-mar
+ ac_add_options --enable-instruments
+ ac_add_options --enable-dmd
+ 
+ # Cross-compiled builds fail when dtrace is enabled
+ if test `uname -s` != Linux; then
+   ac_add_options --enable-dtrace
+ fi
+diff --git a/browser/config/mozconfigs/whitelist b/browser/config/mozconfigs/whitelist
+--- a/browser/config/mozconfigs/whitelist
++++ b/browser/config/mozconfigs/whitelist
+@@ -9,17 +9,16 @@ all_platforms = ['win64', 'win64-aarch64
+ 
+ for platform in all_platforms:
+     whitelist['nightly'][platform] = [
+         'ac_add_options --enable-dmd',
+         'ac_add_options --with-branding=browser/branding/nightly',
+     ]
+ 
+ whitelist['nightly']['macosx64'] += [
+-    'ac_add_options --disable-install-strip',
+     'ac_add_options --enable-instruments',
+     'ac_add_options --enable-dtrace',
+     'if test `uname -s` != Linux; then',
+     'fi',
+ ]
+ 
+ whitelist['nightly']['win64'] += [
+     '. "$topsrcdir/browser/config/mozconfigs/win64/common-win64"',
+diff --git a/moz.configure b/moz.configure
+--- a/moz.configure
++++ b/moz.configure
+@@ -235,16 +235,20 @@ set_config('RUST_LIB_PREFIX', library_na
+ set_config('RUST_LIB_SUFFIX', library_name_info.rust_lib.suffix)
+ set_config('OBJ_SUFFIX', library_name_info.obj.suffix)
+ # Lots of compilation tests depend on this variable being present.
+ add_old_configure_assignment('OBJ_SUFFIX', library_name_info.obj.suffix)
+ set_define('MOZ_DLL_PREFIX', depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s))
+ set_config('IMPORT_LIB_SUFFIX', library_name_info.import_lib.suffix)
+ set_define('MOZ_DLL_SUFFIX', depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s))
+ 
++# Make `profiling` available to this file even when js/moz.configure
++# doesn't end up included.
++profiling = dependable(False)
++
+ include(include_project_configure)
+ 
+ @depends('--help')
+ @imports(_from='mozbuild.backend', _import='backends')
+ def build_backends_choices(_):
+     return tuple(backends)
+ 
+ 
+@@ -615,16 +619,41 @@ js_option('--disable-install-strip', whe
+ # `when=may_strip`, but we also need to test when may_strip is False.
+ @depends(depends('--enable-install-strip', when=may_strip)(lambda x: x), may_strip)
+ def pkg_skip_strip(install_strip, may_strip):
+     return not install_strip or not may_strip
+ 
+ set_config('PKG_SKIP_STRIP', True, when=pkg_skip_strip)
+ 
+ 
++@depends('--enable-strip', '--enable-install-strip', when=may_strip)
++def strip(strip, install_strip):
++    return strip or install_strip
++
++js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
++
++@depends('STRIP_FLAGS', profiling, target, when=strip)
++def strip_flags(flags, profiling, target):
++    if flags:
++        return flags[0].split()
++    if profiling:
++        # Only strip debug info and symbols when profiling is enabled, keeping
++        # local symbols.
++        if target.kernel == 'Darwin':
++            return ['-S']
++        else:
++            return ['--strip-debug']
++    # Otherwise strip everything we can, which happens without flags on non-Darwin.
++    # On Darwin, it tries to strip things it can't, so we need to limit its scope.
++    elif target.kernel == 'Darwin':
++        return ['-x', '-S']
++
++set_config('STRIP_FLAGS', strip_flags)
++
++
+ # Please do not add configure checks from here on.
+ 
+ # Fallthrough to autoconf-based configure
+ include('build/moz.configure/old.configure')
+ 
+ # JS Subconfigure.
+ include('js/sub.configure', when=compile_environment & toolkit)
+ 
+diff --git a/old-configure.in b/old-configure.in
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -485,25 +485,16 @@ fi
+ 
+ if test "$GNU_CXX"; then
+     # FIXME: Let us build with strict aliasing. bug 414641.
+     CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
+ 
+     _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
+ fi
+ 
+-# For profiling builds keep the symbol information
+-if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
+-    case "$OS_TARGET" in
+-    Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
+-        STRIP_FLAGS="--strip-debug"
+-        ;;
+-    esac
+-fi
+-
+ dnl ========================================================
+ dnl = Enable DMD
+ dnl ========================================================
+ 
+ if test "$MOZ_DMD"; then
+     if test "${CPU_ARCH}" = "arm"; then
+         CFLAGS="$CFLAGS -funwind-tables"
+         CXXFLAGS="$CXXFLAGS -funwind-tables"
+@@ -571,17 +562,16 @@ dnl ====================================
+ dnl System overrides of the defaults for target
+ dnl ========================================================
+ 
+ case "$target" in
+ *-darwin*)
+     MOZ_OPTIMIZE_FLAGS="-O3"
+     CXXFLAGS="$CXXFLAGS -stdlib=libc++"
+     DSO_LDOPTS=''
+-    STRIP_FLAGS="$STRIP_FLAGS -x -S"
+     # The ExceptionHandling framework is needed for Objective-C exception
+     # logging code in nsObjCExceptions.h. Currently we only use that in debug
+     # builds.
+     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
+ 
+     dnl DTrace and -dead_strip don't interact well. See bug 403132.
+     dnl ===================================================================
+     if test "x$enable_dtrace" = "xyes"; then
+@@ -2864,17 +2854,16 @@ AC_SUBST(MOZ_CRASHREPORTER)
+ AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
+ AC_SUBST(MOZ_STUB_INSTALLER)
+ AC_SUBST(MOZ_ENABLE_SIGNMAR)
+ AC_SUBST(MOZ_UPDATER)
+ 
+ AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
+ AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
+ AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
+-AC_SUBST(STRIP_FLAGS)
+ AC_SUBST(INCREMENTAL_LINKER)
+ 
+ AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
+ 
+ AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
+ AC_SUBST(MOZ_LINKER_EXTRACT)
+ 
+ if test -n "$MOZ_BINARY_EXTENSIONS"; then
+diff --git a/python/mozbuild/mozpack/executables.py b/python/mozbuild/mozpack/executables.py
+--- a/python/mozbuild/mozpack/executables.py
++++ b/python/mozbuild/mozpack/executables.py
+@@ -90,17 +90,17 @@ def may_strip(path):
+ 
+ 
+ def strip(path):
+     '''
+     Execute the STRIP command with STRIP_FLAGS on the given path.
+     '''
+     from buildconfig import substs
+     strip = substs['STRIP']
+-    flags = substs['STRIP_FLAGS'].split() if 'STRIP_FLAGS' in substs else []
++    flags = substs.get('STRIP_FLAGS', [])
+     cmd = [strip] + flags + [path]
+     if subprocess.call(cmd) != 0:
+         errors.fatal('Error executing ' + ' '.join(cmd))
+ 
+ 
+ def may_elfhack(path):
+     '''
+     Return whether elfhack() should be called

+ 8 - 9
mozilla-release/patches/1641775-78a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1590772287 0
 # Date 1590772287 0
 # Node ID 4ba16619f4cb6955ea1f99ec53301ee820839f3a
 # Node ID 4ba16619f4cb6955ea1f99ec53301ee820839f3a
-# Parent  fcfd598474c0f17f179c88929476ed5a72d58383
+# Parent  9572f82a14d01b7c74973bf7e20d5a7be392f99e
 Bug 1641775 - Move --with-system-nspr to python configure. r=firefox-build-system-reviewers,rstewart
 Bug 1641775 - Move --with-system-nspr to python configure. r=firefox-build-system-reviewers,rstewart
 
 
 Versions of NSPR >= 4.10 come with a pkg-config file. We currently
 Versions of NSPR >= 4.10 come with a pkg-config file. We currently
@@ -662,18 +662,18 @@ diff --git a/js/sub.configure b/js/sub.configure
 diff --git a/moz.configure b/moz.configure
 diff --git a/moz.configure b/moz.configure
 --- a/moz.configure
 --- a/moz.configure
 +++ b/moz.configure
 +++ b/moz.configure
-@@ -235,16 +235,19 @@ set_config('RUST_LIB_PREFIX', library_na
- set_config('RUST_LIB_SUFFIX', library_name_info.rust_lib.suffix)
- set_config('OBJ_SUFFIX', library_name_info.obj.suffix)
- # Lots of compilation tests depend on this variable being present.
+@@ -238,16 +238,18 @@ set_config('OBJ_SUFFIX', library_name_in
  add_old_configure_assignment('OBJ_SUFFIX', library_name_info.obj.suffix)
  add_old_configure_assignment('OBJ_SUFFIX', library_name_info.obj.suffix)
  set_define('MOZ_DLL_PREFIX', depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s))
  set_define('MOZ_DLL_PREFIX', depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s))
  set_config('IMPORT_LIB_SUFFIX', library_name_info.import_lib.suffix)
  set_config('IMPORT_LIB_SUFFIX', library_name_info.import_lib.suffix)
  set_define('MOZ_DLL_SUFFIX', depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s))
  set_define('MOZ_DLL_SUFFIX', depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s))
  
  
+ # Make `profiling` available to this file even when js/moz.configure
+ # doesn't end up included.
+ profiling = dependable(False)
 +# Same for fold_libs
 +# Same for fold_libs
 +fold_libs = dependable(False)
 +fold_libs = dependable(False)
-+
+ 
  include(include_project_configure)
  include(include_project_configure)
  
  
  @depends('--help')
  @depends('--help')
@@ -681,7 +681,6 @@ diff --git a/moz.configure b/moz.configure
  def build_backends_choices(_):
  def build_backends_choices(_):
      return tuple(backends)
      return tuple(backends)
  
  
- 
 diff --git a/old-configure.in b/old-configure.in
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
 +++ b/old-configure.in
@@ -704,7 +703,7 @@ diff --git a/old-configure.in b/old-configure.in
  # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
  # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
  # The macro won't be used when compiling with earlier versions anyway.
  # The macro won't be used when compiling with earlier versions anyway.
  GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
  GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
-@@ -1495,18 +1493,16 @@ dnl are defined in build/autoconf/altopt
+@@ -1485,18 +1483,16 @@ dnl are defined in build/autoconf/altopt
  
  
  dnl ========================================================
  dnl ========================================================
  dnl =
  dnl =
@@ -723,7 +722,7 @@ diff --git a/old-configure.in b/old-configure.in
                            Use system libevent [installed at prefix PFX]],
                            Use system libevent [installed at prefix PFX]],
      LIBEVENT_DIR=$withval)
      LIBEVENT_DIR=$withval)
  
  
-@@ -3101,18 +3097,16 @@ HOST_CXXFLAGS=`echo \
+@@ -3090,18 +3086,16 @@ HOST_CXXFLAGS=`echo \
      $HOST_CXXFLAGS`
      $HOST_CXXFLAGS`
  
  
  AC_SUBST(MOZ_SYSTEM_PNG)
  AC_SUBST(MOZ_SYSTEM_PNG)

+ 47 - 0
mozilla-release/patches/1642893-79a1.patch

@@ -0,0 +1,47 @@
+# HG changeset patch
+# User Jan de Mooij <jdemooij@mozilla.com>
+# Date 1591343557 0
+# Node ID 3d365d5659eedb1aa172f1617384d8f4aecf1f64
+# Parent  fc5b0662ede74f36bbc1a25fc68b8e813112026c
+Bug 1642893 - Don't build NSPR by default for standalone JS builds. r=glandium
+
+For standalone JS builds there are three possibilities: no-NSPR (the default),
+build NSPR, or use system NSPR.
+
+This patch makes no-NSPR the default again when not overridden by --enable-nspr-build
+or --with-system-nspr. This was likely regressed by bug 1641775.
+
+Differential Revision: https://phabricator.services.mozilla.com/D78001
+
+diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure
+--- a/build/moz.configure/nspr.configure
++++ b/build/moz.configure/nspr.configure
+@@ -11,23 +11,23 @@ js_option('--enable-nspr-build', when=bu
+ 
+ @depends('--enable-nspr-build', when=building_js)
+ def enable_nspr_build(enable):
+     if enable:
+         return enable
+ 
+ js_option('--with-system-nspr', help='Use system NSPR')
+ 
+-@depends(enable_nspr_build, '--with-system-nspr')
+-def build_nspr(nspr_build, system_nspr):
++@depends(enable_nspr_build, '--with-system-nspr', 'JS_STANDALONE')
++def build_nspr(nspr_build, system_nspr, js_standalone):
+     if nspr_build is not None and nspr_build.origin != 'default':
+         if nspr_build and system_nspr:
+             die('Cannot use both --enable-nspr-build and --with-system-nspr')
+-        if not nspr_build and not system_nspr:
+-            die('Cannot use --disable-nspr-build without --with-system-nspr')
++    if js_standalone:
++        return nspr_build
+     return not system_nspr
+ 
+ set_config('MOZ_BUILD_NSPR', True, when=build_nspr)
+ set_config('MOZ_SYSTEM_NSPR', True, when='--with-system-nspr')
+ 
+ @depends(build_nspr, '--with-system-nspr', building_js)
+ def js_without_nspr(build_nspr, system_nspr, building_js):
+     if building_js:
+

+ 140 - 0
mozilla-release/patches/1651680-1-81a1.patch

@@ -0,0 +1,140 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1597113857 0
+# Node ID aafba1319774615785cb7b5443af3599eca30772
+# Parent  8699afdb0f5a28cb4268a67c5cb92a1cec16b615
+Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander
+
+Differential Revision: https://phabricator.services.mozilla.com/D86648
+
+diff --git a/moz.configure b/moz.configure
+--- a/moz.configure
++++ b/moz.configure
+@@ -612,23 +612,17 @@ def may_strip(compile_environment, targe
+ 
+ js_option('--enable-strip', when=may_strip, help='Enable stripping of libs & executables')
+ 
+ set_config('ENABLE_STRIP', True, when='--enable-strip')
+ 
+ js_option('--disable-install-strip', when=may_strip,
+           help='Enable stripping of libs & executables when packaging')
+ 
+-# The nested depends is because depending on --enable-install-strip needs the
+-# `when=may_strip`, but we also need to test when may_strip is False.
+-@depends(depends('--enable-install-strip', when=may_strip)(lambda x: x), may_strip)
+-def pkg_skip_strip(install_strip, may_strip):
+-    return not install_strip or not may_strip
+-
+-set_config('PKG_SKIP_STRIP', True, when=pkg_skip_strip)
++set_config('PKG_STRIP', True, when='--enable-install-strip')
+ 
+ 
+ @depends('--enable-strip', '--enable-install-strip', when=may_strip)
+ def strip(strip, install_strip):
+     return strip or install_strip
+ 
+ js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
+ 
+diff --git a/python/mozbuild/mozpack/executables.py b/python/mozbuild/mozpack/executables.py
+--- a/python/mozbuild/mozpack/executables.py
++++ b/python/mozbuild/mozpack/executables.py
+@@ -81,17 +81,17 @@ def is_executable(path):
+     return get_type(path) != UNKNOWN
+ 
+ 
+ def may_strip(path):
+     '''
+     Return whether strip() should be called
+     '''
+     from buildconfig import substs
+-    return not substs.get('PKG_SKIP_STRIP')
++    return bool(substs.get('PKG_STRIP'))
+ 
+ 
+ def strip(path):
+     '''
+     Execute the STRIP command with STRIP_FLAGS on the given path.
+     '''
+     from buildconfig import substs
+     strip = substs['STRIP']
+diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk
+--- a/testing/testsuite-targets.mk
++++ b/testing/testsuite-targets.mk
+@@ -194,17 +194,17 @@ stage-mach: make-stage-dir
+ 
+ stage-mochitest: make-stage-dir ;
+ 
+ stage-jstests: make-stage-dir
+ 	$(MAKE) -C $(DEPTH)/js/src/tests stage-package
+ 
+ ifdef OBJCOPY
+ ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
+-ifndef PKG_SKIP_STRIP
++ifdef PKG_STRIP
+ STRIP_COMPILED_TESTS := 1
+ endif
+ endif
+ endif
+ 
+ stage-gtest: make-stage-dir
+ 	$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin/gtest
+ ifdef STRIP_COMPILED_TESTS
+diff --git a/toolkit/mozapps/installer/l10n-repack.py b/toolkit/mozapps/installer/l10n-repack.py
+--- a/toolkit/mozapps/installer/l10n-repack.py
++++ b/toolkit/mozapps/installer/l10n-repack.py
+@@ -45,16 +45,16 @@ def main():
+     parser.add_argument('--non-resource', nargs='+', metavar='PATTERN',
+                         default=[],
+                         help='Extra files not to be considered as resources')
+     parser.add_argument('--ignorelist', nargs='+', default=[],
+                         help='List of ignore patterns.')
+     args = parser.parse_args()
+ 
+     buildconfig.substs['USE_ELF_HACK'] = False
+-    buildconfig.substs['PKG_SKIP_STRIP'] = True
++    buildconfig.substs['PKG_STRIP'] = False
+     l10n.repack(args.build, args.l10n, extra_l10n=dict(args.extra_l10n),
+                 non_resources=args.non_resource, non_chrome=NON_CHROME,
+                 ignorelist=args.ignorelist)
+ 
+ 
+ if __name__ == "__main__":
+     main()
+diff --git a/toolkit/mozapps/installer/strip.py b/toolkit/mozapps/installer/strip.py
+--- a/toolkit/mozapps/installer/strip.py
++++ b/toolkit/mozapps/installer/strip.py
+@@ -9,15 +9,15 @@ Strip all files that can be stripped in 
+ import sys
+ from mozpack.files import FileFinder
+ from mozpack.copier import FileCopier
+ 
+ def strip(dir):
+     copier = FileCopier()
+     # The FileFinder will give use ExecutableFile instances for files
+     # that can be stripped, and copying ExecutableFiles defaults to
+-    # stripping them unless buildconfig.substs['PKG_SKIP_STRIP'] is set.
++    # stripping them when buildconfig.substs['PKG_STRIP'] is set.
+     for p, f in FileFinder(dir, find_executables=True):
+         copier.add(p, f)
+     copier.copy(dir)
+ 
+ if __name__ == '__main__':
+     strip(sys.argv[1])
+diff --git a/toolkit/mozapps/installer/unpack.py b/toolkit/mozapps/installer/unpack.py
+--- a/toolkit/mozapps/installer/unpack.py
++++ b/toolkit/mozapps/installer/unpack.py
+@@ -13,13 +13,13 @@ def main():
+     parser = argparse.ArgumentParser(
+         description='Unpack a Gecko-based application')
+     parser.add_argument('directory', help='Location of the application')
+     parser.add_argument('--omnijar', help='Name of the omnijar')
+ 
+     options = parser.parse_args(sys.argv[1:])
+ 
+     buildconfig.substs['USE_ELF_HACK'] = False
+-    buildconfig.substs['PKG_SKIP_STRIP'] = True
++    buildconfig.substs['PKG_STRIP'] = False
+     unpack(options.directory, options.omnijar)
+ 
+ if __name__ == "__main__":
+     main()

+ 61 - 0
mozilla-release/patches/1651680-2-81a1.patch

@@ -0,0 +1,61 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1597114414 0
+# Node ID 0ecdc8f7b354a80ffcae1b5100f0ade9aac9f0f0
+# Parent  92d419ee2de80e832230e68f16a76cbd60c41aab
+Bug 1651680 - Support --enable-strip/--enable-install-strip on mingw. r=nalexander
+
+Differential Revision: https://phabricator.services.mozilla.com/D86649
+
+diff --git a/moz.configure b/moz.configure
+--- a/moz.configure
++++ b/moz.configure
+@@ -601,31 +601,40 @@ add_old_configure_assignment('enable_dtr
+ 
+ 
+ js_option('--disable-icf', help='Disable Identical Code Folding')
+ 
+ add_old_configure_assignment(
+     'MOZ_DISABLE_ICF', '1', when=depends('--enable-icf')(lambda x: not x))
+ 
+ 
+-@depends(compile_environment, target)
+-def may_strip(compile_environment, target):
+-    return compile_environment and target.kernel != 'WINNT'
++js_option('--enable-strip', when=compile_environment,
++          help='Enable stripping of libs & executables')
+ 
+-js_option('--enable-strip', when=may_strip, help='Enable stripping of libs & executables')
++# This should be handled as a `when` once bug 1617793 is fixed.
++@depends('--enable-strip', c_compiler, when=compile_environment)
++def enable_strip(strip, c_compiler):
++    if strip and c_compiler.type != 'clang-cl':
++        return True
+ 
+-set_config('ENABLE_STRIP', True, when='--enable-strip')
++set_config('ENABLE_STRIP', enable_strip)
+ 
+-js_option('--disable-install-strip', when=may_strip,
++js_option('--disable-install-strip', when=compile_environment,
+           help='Enable stripping of libs & executables when packaging')
+ 
+-set_config('PKG_STRIP', True, when='--enable-install-strip')
++# This should be handled as a `when` once bug 1617793 is fixed.
++@depends('--enable-install-strip', c_compiler, when=compile_environment)
++def enable_install_strip(strip, c_compiler):
++    if strip and c_compiler.type != 'clang-cl':
++        return True
++
++set_config('PKG_STRIP', enable_install_strip)
+ 
+ 
+-@depends('--enable-strip', '--enable-install-strip', when=may_strip)
++@depends('--enable-strip', '--enable-install-strip', when=compile_environment)
+ def strip(strip, install_strip):
+     return strip or install_strip
+ 
+ js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
+ 
+ @depends('STRIP_FLAGS', profiling, target, when=strip)
+ def strip_flags(flags, profiling, target):
+     if flags:

+ 373 - 0
mozilla-release/patches/1657954-81a1.patch

@@ -0,0 +1,373 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1597161532 0
+# Node ID 3a2dea9d4ff28c6a76a379c69a497fab49b48fa3
+# Parent  db03e01465544a13a668ed0793895d90893332d7
+Bug 1657954 - Move various branding options from `old-configure` r=geckoview-reviewers,mhentges,nalexander,snorp
+
+Differential Revision: https://phabricator.services.mozilla.com/D86391
+
+diff --git a/browser/confvars.sh b/browser/confvars.sh
+--- a/browser/confvars.sh
++++ b/browser/confvars.sh
+@@ -1,14 +1,13 @@
+ #! /bin/sh
+ # 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/.
+ 
+-MOZ_APP_BASENAME=Firefox
+ MOZ_APP_VENDOR=Mozilla
+ MOZ_UPDATER=1
+ 
+ if test "$OS_ARCH" = "WINNT"; then
+   if ! test "$HAVE_64BIT_BUILD"; then
+     if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
+             "$MOZ_UPDATE_CHANNEL" = "aurora" -o \
+             "$MOZ_UPDATE_CHANNEL" = "beta" -o \
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -1181,12 +1181,30 @@ def project_flag(env=None, set_for_old_c
+     set_config(env, option_implementation)
+     if set_as_define:
+         set_define(env, option_implementation)
+     if set_for_old_configure:
+         add_old_configure_assignment(env, option_implementation)
+ 
+ # milestone.is_nightly corresponds to cases NIGHTLY_BUILD is set.
+ 
+-
+ @depends(milestone)
+ def enabled_in_nightly(milestone):
+     return milestone.is_nightly
++
++# Branding
++# ==============================================================
++option('--with-app-basename', env='MOZ_APP_BASENAME', nargs=1,
++       help='Typically stays consistent for multiple branded versions of a '
++       'given application (e.g. Aurora and Firefox both use "Firefox"), but '
++       'may vary for full rebrandings (e.g. Iceweasel). Used for '
++       'application.ini\'s "Name" field, which controls profile location in '
++       'the absence of a "Profile" field (see below), and various system '
++       'integration hooks (Unix remoting, Windows MessageWindow name, etc.')
++
++@depends('--with-app-basename')
++def moz_app_basename(value):
++    if value:
++        return value[0]
++    return 'Firefox'
++
++set_config('MOZ_APP_BASENAME', moz_app_basename,
++           when=depends(build_project)(lambda p: p != 'js'))
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -237,18 +237,16 @@ def old_configure_options(*options):
+     '--enable-xul',
+     '--enable-zipwriter',
+     '--includedir',
+     '--libdir',
+     '--prefix',
+     '--with-android-distribution-directory',
+     '--with-android-max-sdk',
+     '--with-android-min-sdk',
+-    '--with-app-basename',
+-    '--with-app-name',
+     '--with-branding',
+     '--with-debug-label',
+     '--with-distribution-id',
+     '--with-jitreport-granularity',
+     '--with-macbundlename-prefix',
+     '--with-nss-exec-prefix',
+     '--with-nss-prefix',
+     '--with-system-libevent',
+diff --git a/js/moz.configure b/js/moz.configure
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -13,16 +13,32 @@ def building_js(build_project):
+ 
+ # Exception to the rule above: JS_STANDALONE is a special option that doesn't
+ # want the js_option treatment. When we're done merging js/src/configure and
+ # top-level configure, it can go away, although the JS_STANDALONE config
+ # will still need to be set depending on building_js above.
+ option(env='JS_STANDALONE', default=building_js,
+        help='Reserved for internal use')
+ 
++# Branding
++# ==============================================================
++js_option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
++          help='Used for e.g. the binary program file name. If not set, '
++          'defaults to a lowercase form of MOZ_APP_BASENAME.')
++
++@depends('--with-app-name', 'JS_STANDALONE', moz_app_basename)
++def moz_app_name(value, js_standalone, moz_app_basename):
++    if value:
++        return value[0]
++    if js_standalone:
++        return 'js'
++    return moz_app_basename.lower()
++
++set_config('MOZ_APP_NAME', moz_app_name)
++
+ include('../build/moz.configure/nspr.configure',
+         when='--enable-compile-environment')
+ include('../build/moz.configure/rust.configure',
+         when='--enable-compile-environment')
+ include('../build/moz.configure/bindgen.configure',
+         when='--enable-compile-environment')
+ 
+ @depends('JS_STANDALONE')
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -1450,17 +1450,16 @@ AC_SUBST_LIST(WARNINGS_CFLAGS)
+ AC_SUBST(LIBICONV)
+ 
+ AC_SUBST(INCREMENTAL_LINKER)
+ 
+ AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
+ 
+ AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
+ 
+-AC_SUBST(MOZ_APP_NAME)
+ AC_SUBST(MOZ_APP_DISPLAYNAME)
+ AC_SUBST(MOZ_APP_VERSION)
+ 
+ AC_SUBST(MOZ_PKG_SPECIAL)
+ 
+ dnl Echo the CFLAGS to remove extra whitespace.
+ CFLAGS=`echo \
+ 	$_COMPILATION_CFLAGS \
+@@ -1556,17 +1555,16 @@ dnl ====================================
+ dnl JavaScript shell
+ dnl ========================================================
+ 
+ MOZ_CHECK_ALLOCATOR
+ 
+ AC_SUBST(ac_configure_args)
+ 
+ if test -n "$JS_STANDALONE"; then
+-MOZ_APP_NAME="mozjs"
+ MOZ_APP_VERSION="$MOZILLA_SYMBOLVERSION"
+ JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION"
+ else
+ JS_LIBRARY_NAME="mozjs"
+ fi
+ JS_CONFIG_LIBS="$NSPR_LIBS $LIBS"
+ if test -n "$GNU_CC"; then
+ JS_CONFIG_MOZ_JS_LIBS='-L${libdir} -l${JS_LIBRARY_NAME}'
+diff --git a/js/sub.configure b/js/sub.configure
+--- a/js/sub.configure
++++ b/js/sub.configure
+@@ -70,20 +70,19 @@ def js_subconfigure(host, target, build_
+ 
+     # Variables that were explicitly exported from old-configure, and those
+     # explicitly set in the environment when invoking old-configure, were
+     # automatically inherited from subconfigure. We assume the relevant ones
+     # have a corresponding AC_SUBST in old-configure, making them available
+     # in `substs`.
+     for var in (
+         'MOZ_SYSTEM_ZLIB', 'MOZ_ZLIB_CFLAGS', 'MOZ_ZLIB_LIBS',
+-        'MOZ_APP_NAME', 'MOZ_APP_REMOTINGNAME', 'MOZ_DEV_EDITION',
+-        'STLPORT_LIBS', 'DIST', 'MOZ_LINKER', 'ZLIB_IN_MOZGLUE', 'RANLIB',
+-        'AR', 'CPP', 'CC', 'CXX', 'CPPFLAGS', 'CFLAGS', 'CXXFLAGS',
+-        'LDFLAGS', 'HOST_CC', 'HOST_CXX', 'HOST_CPPFLAGS',
++        'MOZ_DEV_EDITION', 'STLPORT_LIBS', 'DIST', 'MOZ_LINKER',
++        'ZLIB_IN_MOZGLUE', 'RANLIB', 'AR', 'CPP', 'CC', 'CXX', 'CPPFLAGS',
++        'CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'HOST_CC', 'HOST_CXX', 'HOST_CPPFLAGS',
+         'HOST_CXXFLAGS', 'HOST_LDFLAGS'
+     ):
+         if var not in from_assignment and var in substs:
+             value = substs[var]
+         elif var in assignments:
+             value = assignments[var]
+         elif mozconfig and var in mozconfig and \
+                 not mozconfig[var][1].startswith('removed'):
+diff --git a/old-configure.in b/old-configure.in
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -82,17 +82,16 @@ case "$target" in
+     AC_DEFINE(ANDROID)
+     ;;
+ *-linux*)
+     AC_PATH_PROG(OBJCOPY,objcopy)
+     ;;
+ esac
+ 
+ AC_SUBST(ANDROID_SOURCE)
+-AC_SUBST(ANDROID_PACKAGE_NAME)
+ AC_SUBST(OBJCOPY)
+ 
+ dnl ========================================================
+ dnl Checks for compilers.
+ dnl ========================================================
+ 
+ if test "$COMPILE_ENVIRONMENT"; then
+ 
+@@ -1695,35 +1694,16 @@ fi
+ if test "$BUILDING_RELEASE"; then
+   # Override value in defines.sh, if any
+   EARLY_BETA_OR_EARLIER=
+ elif test "$EARLY_BETA_OR_EARLIER"; then
+   AC_DEFINE(EARLY_BETA_OR_EARLIER)
+ fi
+ AC_SUBST(EARLY_BETA_OR_EARLIER)
+ 
+-# Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
+-MOZ_ARG_WITH_STRING(app-name,
+-[--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
+-WITH_APP_NAME=$withval,
+-)
+-
+-if test -n "$WITH_APP_NAME" ; then
+-    MOZ_APP_NAME="$WITH_APP_NAME"
+-fi
+-
+-MOZ_ARG_WITH_STRING(app-basename,
+-[--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
+-WITH_APP_BASENAME=$withval,
+-)
+-
+-if test -n "$WITH_APP_BASENAME" ; then
+-    MOZ_APP_BASENAME="$WITH_APP_BASENAME"
+-fi
+-
+ dnl ========================================================
+ dnl Ensure Android SDK and build-tools versions depending on
+ dnl mobile target.
+ dnl ========================================================
+ 
+ case "$MOZ_BUILD_APP" in
+ mobile/android)
+     MOZ_ANDROID_SDK
+@@ -2929,67 +2909,32 @@ MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_
+ AC_SUBST(MOZ_CHILD_PROCESS_NAME)
+ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
+ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
+ 
+ # The following variables are available to branding and application
+ # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
+ # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
+ # impacts profile location and user-visible fields.
+-# - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
+-# versions of a given application (e.g. Aurora and Firefox both use
+-# "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
+-# for application.ini's "Name" field, which controls profile location in
+-# the absence of a "Profile" field (see below), and various system
+-# integration hooks (Unix remoting, Windows MessageWindow name, etc.)
+ # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
+ # Mac Bundle name, Updater, Installer), it is typically used for nightly
+ # builds (e.g. Aurora for Firefox).
+ # - MOZ_APP_VERSION: Defines the application version number.
+ # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
+ # in the "About" window. If not set, defaults to MOZ_APP_VERSION.
+-# - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
+-# defaults to a lowercase form of MOZ_APP_BASENAME.
+-# - MOZ_APP_REMOTINGNAME: Used for the internal program name, which affects
+-# profile name and remoting. If not set, defaults to MOZ_APP_NAME.
+ # - MOZ_APP_PROFILE: When set, used for application.ini's
+ # "Profile" field, which controls profile location.
+ # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
+ # crash reporter server url.
+ # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
+ 
+-if test -z "$MOZ_APP_NAME"; then
+-   MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
+-fi
+-
+-if test -z "$MOZ_APP_REMOTINGNAME"; then
+-   MOZ_APP_REMOTINGNAME=$MOZ_APP_NAME
+-fi
+-
+ if test -z "$MOZ_APP_VERSION_DISPLAY"; then
+    MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
+ fi
+ 
+-if test -z "$ANDROID_PACKAGE_NAME" ; then
+-   # When we got rid of the Aurora channel we decided to replace the old
+-   # Nightly ANDROID_PACKAGE_NAME with Aurora. To make sure this is inherited
+-   # by all mozilla-central based branches we make this the new "default"
+-   # for Fennec. Non mozilla-central based branches set ANDROID_PACKAGE_NAME
+-   # in their mozconfig, so they will never get this. If there are ever
+-   # non-Fennec builds for Android, they will fall into the else block
+-   # and use their own default name.
+-   # https://bugzilla.mozilla.org/show_bug.cgi?id=1357808 has additional
+-   # background on this.
+-   if test "$MOZ_APP_NAME" = "fennec"; then
+-      ANDROID_PACKAGE_NAME="org.mozilla.fennec_aurora"
+-   else
+-      ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
+-   fi
+-fi
+-
+ # For extensions and langpacks, we require a max version that is compatible
+ # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
+ # 24.0a1 and 24.0a2 aren't affected
+ # 24.0 becomes 24.*
+ # 24.1.1 becomes 24.*
+ IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
+ if test -z "$IS_ALPHA"; then
+   changequote(,)
+@@ -2998,20 +2943,17 @@ if test -z "$IS_ALPHA"; then
+   else
+     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
+   fi
+   changequote([,])
+ else
+   MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
+ fi
+ 
+-AC_SUBST(MOZ_APP_NAME)
+-AC_SUBST(MOZ_APP_REMOTINGNAME)
+ AC_SUBST(MOZ_APP_DISPLAYNAME)
+-AC_SUBST(MOZ_APP_BASENAME)
+ AC_SUBST(MOZ_APP_VENDOR)
+ AC_SUBST(MOZ_APP_PROFILE)
+ AC_SUBST(MOZ_APP_ID)
+ AC_SUBST(MAR_CHANNEL_ID)
+ AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
+ AC_SUBST(MOZ_PROFILE_MIGRATOR)
+ AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
+ AC_SUBST(MOZ_APP_UA_NAME)
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -1639,8 +1639,36 @@ with only_when(compile_environment & tar
+ 
+ # Alternative Crashreporter setting
+ option("--with-crashreporter-url", env="MOZ_CRASHREPORTER_URL",
+        default="https://crash-reports.mozilla.com/", nargs=1,
+        help="Set an alternative crashreporter url")
+ 
+ set_config("MOZ_CRASHREPORTER_URL",
+            depends("--with-crashreporter-url")(lambda x: x[0].rstrip("/")))
++
++
++# Branding
++# ==============================================================
++option(env='MOZ_APP_REMOTINGNAME', nargs=1,
++       help='Used for the internal program name, which affects profile name '
++       'and remoting. If not set, defaults to MOZ_APP_NAME.')
++
++@depends('MOZ_APP_REMOTINGNAME', moz_app_name)
++def moz_app_remotingname(value, moz_app_name):
++    if value:
++        return value[0]
++    return moz_app_name
++
++set_config('MOZ_APP_REMOTINGNAME', moz_app_remotingname)
++
++option(env='ANDROID_PACKAGE_NAME', nargs=1,
++       help='Name of the Android package (default org.mozilla.$MOZ_APP_NAME)')
++
++@depends('ANDROID_PACKAGE_NAME', moz_app_name)
++def android_package_name(value, moz_app_name):
++    if value:
++        return value[0]
++    if moz_app_name == 'fennec':
++        return 'org.mozilla.fennec_aurora'
++    return 'org.mozilla.%s' % moz_app_name
++
++set_config('ANDROID_PACKAGE_NAME', android_package_name)
+\ No newline at end of file

+ 411 - 0
mozilla-release/patches/1658976-1-82a1.patch

@@ -0,0 +1,411 @@
+# HG changeset patch
+# User Mitchell Hentges <mhentges@mozilla.com>
+# Date 1598629740 0
+# Node ID fcc9554c76fe7af17878aad0e376153f8fd22c49
+# Parent  fc7784dd2cc33c85f2f558489dee77828b31d171
+Bug 1658976: If usable Rust toolchain can't be found, print useful error r=froydnj
+
+Previously, we would optimistically attempt to use a Rust toolchain that
+matches the current C toolchain, and would throw an error if an
+attempted compile with that Rust toolchain failed.
+
+Instead, if we fail to detect a usable Rust toolchain, we now helpfully
+inform users of their two options: change C toolchain, or install
+matching Rust toolchain.
+
+Differential Revision: https://phabricator.services.mozilla.com/D88084
+
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -202,213 +202,215 @@ def rust_supported_targets(rustc):
+                 info = split_triplet(retry)
+             except ValueError:
+                 continue
+         key = (info.cpu, info.endianness, info.os)
+         data.setdefault(key, []).append(namespace(rust_target=t, target=info))
+     return data
+ 
+ 
+-@template
+-def rust_triple_alias(host_or_target, host_or_target_c_compiler):
+-    """Template defining the alias used for rustc's --target flag.
+-    `host_or_target` is either `host` or `target` (the @depends functions
+-    from init.configure).
+-    """
+-    assert host_or_target in {host, target}
+-
+-    host_or_target_str = {host: 'host', target: 'target'}[host_or_target]
+-
+-    @depends(rustc, host_or_target, host_or_target_c_compiler,
+-             rust_supported_targets, arm_target, when=rust_compiler)
+-    @checking('for rust %s triplet' % host_or_target_str)
+-    @imports('os')
+-    @imports(_from='mozbuild.configure.util', _import='LineIO')
+-    @imports(_from='mozbuild.shellutil', _import='quote')
+-    @imports(_from='six', _import='ensure_binary')
+-    @imports(_from='tempfile', _import='mkstemp')
+-    @imports(_from='textwrap', _import='dedent')
+-    def rust_target(rustc, host_or_target, compiler_info,
+-                    rust_supported_targets, arm_target):
+-        # Rust's --target options are similar to, but not exactly the same
+-        # as, the autoconf-derived targets we use.  An example would be that
+-        # Rust uses distinct target triples for targetting the GNU C++ ABI
+-        # and the MSVC C++ ABI on Win32, whereas autoconf has a single
+-        # triple and relies on the user to ensure that everything is
+-        # compiled for the appropriate ABI.  We need to perform appropriate
+-        # munging to get the correct option to rustc.
+-        # We correlate the autoconf-derived targets with the list of targets
+-        # rustc gives us with --print target-list.
+-        candidates = rust_supported_targets.get(
+-            (host_or_target.cpu, host_or_target.endianness, host_or_target.os), [])
+-
+-        def find_candidate(candidates):
+-            if len(candidates) == 1:
+-                return candidates[0].rust_target
+-            elif not candidates:
+-                return None
++def detect_rustc_target(host_or_target, compiler_info, arm_target, rust_supported_targets):
++    # Rust's --target options are similar to, but not exactly the same
++    # as, the autoconf-derived targets we use.  An example would be that
++    # Rust uses distinct target triples for targetting the GNU C++ ABI
++    # and the MSVC C++ ABI on Win32, whereas autoconf has a single
++    # triple and relies on the user to ensure that everything is
++    # compiled for the appropriate ABI.  We need to perform appropriate
++    # munging to get the correct option to rustc.
++    # We correlate the autoconf-derived targets with the list of targets
++    # rustc gives us with --print target-list.
++    candidates = rust_supported_targets.get(
++        (host_or_target.cpu, host_or_target.endianness, host_or_target.os), [])
+ 
+-            # We have multiple candidates. There are two cases where we can try to
+-            # narrow further down using extra information from the build system.
+-            # - For windows targets, correlate with the C compiler type
+-            if host_or_target.kernel == 'WINNT':
+-                if compiler_info.type in ('gcc', 'clang'):
+-                    suffix = 'windows-gnu'
+-                else:
+-                    suffix = 'windows-msvc'
+-                narrowed = [c for c in candidates if c.rust_target.endswith('-{}'.format(suffix))]
+-                if len(narrowed) == 1:
+-                    return narrowed[0].rust_target
+-                elif narrowed:
+-                    candidates = narrowed
+-
+-                vendor_aliases = {'pc': ('w64', 'windows')}
+-                narrowed = [c for c in candidates
+-                            if host_or_target.vendor in vendor_aliases.get(c.target.vendor, ())]
+-
+-                if len(narrowed) == 1:
+-                    return narrowed[0].rust_target
++    def find_candidate(candidates):
++        if len(candidates) == 1:
++            return candidates[0].rust_target
++        elif not candidates:
++            return None
+ 
+-            # - For arm targets, correlate with arm_target
+-            #   we could be more thorough with the supported rust targets, but they
+-            #   don't support OSes that are supported to build Gecko anyways.
+-            #   Also, sadly, the only interface to check the rust target cpu features
+-            #   is --print target-spec-json, and it's unstable, so we have to rely on
+-            #   our own knowledge of what each arm target means.
+-            if host_or_target.cpu == 'arm' and host_or_target.endianness == 'little':
+-                prefixes = []
+-                if arm_target.arm_arch >= 7:
+-                    if arm_target.thumb2 and arm_target.fpu == 'neon':
+-                        prefixes.append('thumbv7neon')
+-                    if arm_target.thumb2:
+-                        prefixes.append('thumbv7a')
+-                    prefixes.append('armv7')
+-                if arm_target.arm_arch >= 6:
+-                    prefixes.append('armv6')
+-                    if host_or_target.os != 'Android':
+-                        # arm-* rust targets are armv6... except arm-linux-androideabi
+-                        prefixes.append('arm')
+-                if arm_target.arm_arch >= 5:
+-                    prefixes.append('armv5te')
+-                    if host_or_target.os == 'Android':
+-                        # arm-* rust targets are armv6... except arm-linux-androideabi
+-                        prefixes.append('arm')
+-                if arm_target.arm_arch >= 4:
+-                    prefixes.append('armv4t')
+-                # rust freebsd targets are the only ones that don't have a 'hf' suffix
+-                # for hard-float. Technically, that means if the float abi ever is not
+-                # hard-float, this will pick a wrong target, but since rust only
+-                # supports hard-float, let's assume that means freebsd only support
+-                # hard-float.
+-                if arm_target.float_abi == 'hard' and host_or_target.os != 'FreeBSD':
+-                    suffix = 'hf'
+-                else:
+-                    suffix = ''
+-                for p in prefixes:
+-                    for c in candidates:
+-                        if c.rust_target.startswith('{}-'.format(p)) and \
+-                                c.rust_target.endswith(suffix):
+-                            return c.rust_target
+-
+-            # See if we can narrow down on the exact alias
+-            narrowed = [c for c in candidates if c.target.alias == host_or_target.alias]
++        # We have multiple candidates. There are two cases where we can try to
++        # narrow further down using extra information from the build system.
++        # - For windows targets, correlate with the C compiler type
++        if host_or_target.kernel == 'WINNT':
++            if compiler_info.type in ('gcc', 'clang'):
++                suffix = 'windows-gnu'
++            else:
++                suffix = 'windows-msvc'
++            narrowed = [c for c in candidates if c.rust_target.endswith('-{}'.format(suffix))]
+             if len(narrowed) == 1:
+                 return narrowed[0].rust_target
+             elif narrowed:
+                 candidates = narrowed
+ 
+-            # See if we can narrow down with the raw OS
+-            narrowed = [c for c in candidates if c.target.raw_os == host_or_target.raw_os]
+-            if len(narrowed) == 1:
+-                return narrowed[0].rust_target
+-            elif narrowed:
+-                candidates = narrowed
++            vendor_aliases = {'pc': ('w64', 'windows')}
++            narrowed = [c for c in candidates
++                        if host_or_target.vendor in vendor_aliases.get(c.target.vendor, ())]
+ 
+-            # See if we can narrow down with the raw OS and raw CPU
+-            narrowed = [
+-                c for c in candidates
+-                if c.target.raw_os == host_or_target.raw_os and
+-                   c.target.raw_cpu == host_or_target.raw_cpu
+-            ]
+-            if len(narrowed) == 1:
+-                return narrowed[0].rust_target
+-
+-            # Finally, see if the vendor can be used to disambiguate.
+-            narrowed = [
+-                c for c in candidates
+-                if c.target.vendor == host_or_target.vendor
+-            ]
+             if len(narrowed) == 1:
+                 return narrowed[0].rust_target
+ 
+-            return None
+-
+-        rustc_target = find_candidate(candidates)
+-
+-        if rustc_target is None:
+-            die("Don't know how to translate {} for rustc".format(
+-                host_or_target.alias))
+-
+-        # Check to see whether our rustc has a reasonably functional stdlib
+-        # for our chosen target.
+-        target_arg = '--target=' + rustc_target
+-        in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs', text=True)
+-        out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
+-        os.close(out_fd)
+-        try:
+-            source = 'pub extern fn hello() { println!("Hello world"); }'
+-            log.debug('Creating `%s` with content:', in_path)
+-            with LineIO(lambda l: log.debug('| %s', l)) as out:
+-                out.write(source)
+-
+-            os.write(in_fd, ensure_binary(source))
+-            os.close(in_fd)
++        # - For arm targets, correlate with arm_target
++        #   we could be more thorough with the supported rust targets, but they
++        #   don't support OSes that are supported to build Gecko anyways.
++        #   Also, sadly, the only interface to check the rust target cpu features
++        #   is --print target-spec-json, and it's unstable, so we have to rely on
++        #   our own knowledge of what each arm target means.
++        if host_or_target.cpu == 'arm' and host_or_target.endianness == 'little':
++            prefixes = []
++            if arm_target.arm_arch >= 7:
++                if arm_target.thumb2 and arm_target.fpu == 'neon':
++                    prefixes.append('thumbv7neon')
++                if arm_target.thumb2:
++                    prefixes.append('thumbv7a')
++                prefixes.append('armv7')
++            if arm_target.arm_arch >= 6:
++                prefixes.append('armv6')
++                if host_or_target.os != 'Android':
++                    # arm-* rust targets are armv6... except arm-linux-androideabi
++                    prefixes.append('arm')
++            if arm_target.arm_arch >= 5:
++                prefixes.append('armv5te')
++                if host_or_target.os == 'Android':
++                    # arm-* rust targets are armv6... except arm-linux-androideabi
++                    prefixes.append('arm')
++            if arm_target.arm_arch >= 4:
++                prefixes.append('armv4t')
++            # rust freebsd targets are the only ones that don't have a 'hf' suffix
++            # for hard-float. Technically, that means if the float abi ever is not
++            # hard-float, this will pick a wrong target, but since rust only
++            # supports hard-float, let's assume that means freebsd only support
++            # hard-float.
++            if arm_target.float_abi == 'hard' and host_or_target.os != 'FreeBSD':
++                suffix = 'hf'
++            else:
++                suffix = ''
++            for p in prefixes:
++                for c in candidates:
++                    if c.rust_target.startswith('{}-'.format(p)) and \
++                            c.rust_target.endswith(suffix):
++                        return c.rust_target
+ 
+-            cmd = [
+-                rustc,
+-                '--crate-type', 'staticlib',
+-                target_arg,
+-                '-o', out_path,
+-                in_path,
+-            ]
++        # See if we can narrow down on the exact alias
++        narrowed = [c for c in candidates if c.target.alias == host_or_target.alias]
++        if len(narrowed) == 1:
++            return narrowed[0].rust_target
++        elif narrowed:
++            candidates = narrowed
+ 
+-            def failed():
+-                die(dedent('''\
+-                Cannot compile for {} with {}
+-                The target may be unsupported, or you may not have
+-                a rust std library for that target installed. Try:
++        # See if we can narrow down with the raw OS
++        narrowed = [c for c in candidates if c.target.raw_os == host_or_target.raw_os]
++        if len(narrowed) == 1:
++            return narrowed[0].rust_target
++        elif narrowed:
++            candidates = narrowed
+ 
+-                  rustup target add {}
+-                '''.format(host_or_target.alias, rustc, rustc_target)))
+-            check_cmd_output(*cmd, onerror=failed)
+-            if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
+-                failed()
+-        finally:
+-            os.remove(in_path)
+-            os.remove(out_path)
++        # See if we can narrow down with the raw OS and raw CPU
++        narrowed = [
++            c for c in candidates
++            if c.target.raw_os == host_or_target.raw_os and
++               c.target.raw_cpu == host_or_target.raw_cpu
++        ]
++        if len(narrowed) == 1:
++            return narrowed[0].rust_target
+ 
+-        # This target is usable.
+-        return rustc_target
++        # Finally, see if the vendor can be used to disambiguate.
++        narrowed = [
++            c for c in candidates
++            if c.target.vendor == host_or_target.vendor
++        ]
++        if len(narrowed) == 1:
++            return narrowed[0].rust_target
+ 
+-    return rust_target
++        return None
++
++    rustc_target = find_candidate(candidates)
++
++    if rustc_target is None:
++        die("Don't know how to translate {} for rustc".format(
++            host_or_target.alias))
++
++    return rustc_target
+ 
+ 
+-rust_target_triple = rust_triple_alias(target, c_compiler)
+-rust_host_triple = rust_triple_alias(host, host_c_compiler)
++@imports('os')
++@imports(_from='six', _import='ensure_binary')
++@imports(_from='tempfile', _import='mkstemp')
++@imports(_from='textwrap', _import='dedent')
++@imports(_from='mozbuild.configure.util', _import='LineIO')
++def assert_rust_compile(host_or_target, rustc_target, rustc):
++    # Check to see whether our rustc has a reasonably functional stdlib
++    # for our chosen target.
++    target_arg = '--target=' + rustc_target
++    in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs', text=True)
++    out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
++    os.close(out_fd)
++    try:
++        source = 'pub extern fn hello() { println!("Hello world"); }'
++        log.debug('Creating `%s` with content:', in_path)
++        with LineIO(lambda l: log.debug('| %s', l)) as out:
++            out.write(source)
++
++        os.write(in_fd, ensure_binary(source))
++        os.close(in_fd)
++
++        cmd = [
++            rustc,
++            '--crate-type', 'staticlib',
++            target_arg,
++            '-o', out_path,
++            in_path,
++        ]
++
++        def failed():
++            die(dedent('''\
++            Cannot compile for {} with {}
++            The target may be unsupported, or you may not have
++            a rust std library for that target installed. Try:
++
++              rustup target add {}
++            '''.format(host_or_target.alias, rustc, rustc_target)))
++        check_cmd_output(*cmd, onerror=failed)
++        if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
++            failed()
++    finally:
++        os.remove(in_path)
++        os.remove(out_path)
+ 
+ 
+-@depends(host, rust_host_triple, rustc_info.host)
+-def validate_rust_host_triple(host, rust_host, rustc_host):
+-    if rust_host != rustc_host:
+-        if host.alias == rust_host:
++@depends(rustc, host, host_c_compiler, rustc_info.host, rust_supported_targets,
++         arm_target, when=rust_compiler)
++@checking('for rust host triplet')
++@imports(_from='textwrap', _import='dedent')
++def rust_host_triple(rustc, host, compiler_info, rustc_host, rust_supported_targets,
++                     arm_target):
++    rustc_target = detect_rustc_target(host, compiler_info, arm_target,
++                                       rust_supported_targets)
++    if rustc_target != rustc_host:
++        if host.alias == rustc_target:
+             configure_host = host.alias
+         else:
+-            configure_host = '{}/{}'.format(host.alias, rust_host)
+-        die("The rust compiler host ({}) is not suitable for the configure host ({})."
+-            .format(rustc_host, configure_host))
++            configure_host = '{}/{}'.format(host.alias, rustc_target)
++        die(dedent('''\
++        The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
++
++        You can solve this by:
++        * Set your configure host to match the rust compiler host by editing your
++        mozconfig and adding "ac_add_options --host={rustc}".
++        * Or, install the rust toolchain for {configure}, if supported, by running
++        "rustup default stable-{rustc_target}"
++        '''.format(rustc=rustc_host, configure=configure_host, rustc_target=rustc_target)))
++    assert_rust_compile(host, rustc_target, rustc)
++    return rustc_target
++
++@depends(rustc, target, c_compiler, rust_supported_targets, arm_target, when=rust_compiler)
++@checking('for rust target triplet')
++def rust_target_triple(rustc, target, compiler_info, rust_supported_targets, arm_target):
++    rustc_target = detect_rustc_target(target, compiler_info, arm_target, rust_supported_targets)
++    assert_rust_compile(target, rustc_target, rustc)
++    return rustc_target
+ 
+ 
+ set_config('RUST_TARGET', rust_target_triple)
+ set_config('RUST_HOST_TARGET', rust_host_triple)
+ 
+ 
+ @depends(rust_target_triple)
+ def rust_target_env_name(triple):

+ 43 - 0
mozilla-release/patches/1658976-2-82a1.patch

@@ -0,0 +1,43 @@
+# HG changeset patch
+# User Mitchell Hentges <mhentges@mozilla.com>
+# Date 1598629743 0
+# Node ID 80beec7aca1fd47df5e376feecbf2e616a18c37e
+# Parent  b874561f6ef9a3c124ec486c3e4e7fa3275ea1dc
+Bug 1658976: Configure more-accurately detects host triplet r=froydnj
+
+config.guess infers information about the compiler using environment
+variables, such as CC. However, we use such environment variables to
+configure the tooling for the target.
+
+Differential Revision: https://phabricator.services.mozilla.com/D88085
+
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -807,17 +807,25 @@ def real_host(value, shell):
+         if arch == 'AMD64':
+             return split_triplet('x86_64-pc-mingw32')
+         elif arch == 'x86':
+             return split_triplet('i686-pc-mingw32')
+ 
+     if not value:
+         config_guess = os.path.join(os.path.dirname(__file__), '..',
+                                     'autoconf', 'config.guess')
+-        host = check_cmd_output(shell, config_guess).strip()
++
++        # Ensure that config.guess is determining the host triplet, not the target
++        # triplet
++        env = os.environ.copy()
++        env.pop('CC_FOR_BUILD', None)
++        env.pop('HOST_CC', None)
++        env.pop('CC', None)
++
++        host = check_cmd_output(shell, config_guess, env=env).strip()
+         try:
+             return split_triplet(host)
+         except ValueError:
+             pass
+     else:
+         host = value[0]
+ 
+     host = config_sub(shell, host)

+ 88 - 0
mozilla-release/patches/1661790-82a1.patch

@@ -0,0 +1,88 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1598894027 0
+# Node ID 2c928095568736985b097cc0af9a14575d3aa1b0
+# Parent  18f954db1706f01be0e3e6cad0a73e8bfe3143b0
+Bug 1661790 - Allow configuring the name of the `virtualenv` used for builds r=nalexander
+
+We don't anticipate end users will actually care to do this, but it's useful especially for unit tests. For example, after bug 1659539, Python `configure` tests will run in a new, non-`init_py3` `virtualenv`, and we'll want to target that `virtualenv` for `configure` rather than having it create a new `virtualenv` for no reason.
+
+Differential Revision: https://phabricator.services.mozilla.com/D88661
+
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -231,30 +231,34 @@ def help_shell(help, shell):
+ shell = help_shell | shell
+ 
+ 
+ # Python 3
+ # ========
+ 
+ option(env='PYTHON3', nargs=1, help='Python 3 interpreter (3.6 or later)')
+ 
++option(env='VIRTUALENV_NAME', nargs=1, default='init_py3',
++       help='Name of the in-objdir virtualenv')
+ 
+-@depends('PYTHON3', check_build_environment, mozconfig, '--help')
++
++@depends('PYTHON3', 'VIRTUALENV_NAME', check_build_environment, mozconfig,
++         '--help')
+ @imports(_from='__builtin__', _import='Exception')
+ @imports('os')
+ @imports('sys')
+ @imports('subprocess')
+ @imports('distutils.sysconfig')
+ @imports(_from='mozbuild.configure.util', _import='LineIO')
+ @imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
+ @imports(_from='mozbuild.virtualenv', _import='verify_python_version')
+ @imports(_from='mozbuild.pythonutil', _import='find_python3_executable')
+ @imports(_from='mozbuild.pythonutil', _import='python_executable_version')
+ @imports(_from='six', _import='ensure_text')
+-def virtualenv_python3(env_python, build_env, mozconfig, help):
++def virtualenv_python3(env_python, virtualenv_name, build_env, mozconfig, help):
+     # Avoid re-executing python when running configure --help.
+     if help:
+         return
+ 
+     # NOTE: We cannot assume the Python we are calling this code with is the
+     # Python we want to set up a virtualenv for.
+     #
+     # We also cannot assume that the Python the caller is configuring meets our
+@@ -262,16 +266,17 @@ def virtualenv_python3(env_python, build
+     #
+     # Because of this the code is written to re-execute itself with the correct
+     # interpreter if required.
+ 
+     log.debug("python3: running with pid %r" % os.getpid())
+     log.debug("python3: sys.executable: %r" % sys.executable)
+ 
+     python = env_python[0] if env_python else None
++    virtualenv_name = virtualenv_name[0]
+ 
+     # Did our python come from mozconfig? Overrides environment setting.
+     # Ideally we'd rely on the mozconfig injection from mozconfig_options,
+     # but we'd rather avoid the verbosity when we need to reexecute with
+     # a different python.
+     if mozconfig['path']:
+         if 'PYTHON3' in mozconfig['env']['added']:
+             python = mozconfig['env']['added']['PYTHON3']
+@@ -297,17 +302,17 @@ def virtualenv_python3(env_python, build
+     topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir
+     if topobjdir.endswith('/js/src'):
+         topobjdir = topobjdir[:-7]
+ 
+     virtualenvs_root = os.path.join(topobjdir, '_virtualenvs')
+     with LineIO(lambda l: log.info(l), 'replace') as out:
+         manager = VirtualenvManager(
+             topsrcdir,
+-            os.path.join(virtualenvs_root, 'init_py3'), out,
++            os.path.join(virtualenvs_root, virtualenv_name), out,
+             os.path.join(topsrcdir, 'build', 'build_virtualenv_packages.txt'))
+ 
+     # If we're not in the virtualenv, we need to update the path to include some
+     # necessary modules for find_program.
+     try:
+         import mozfile
+     except ImportError:
+         sys.path.insert(

+ 126 - 0
mozilla-release/patches/1664077-1-82a1.patch

@@ -0,0 +1,126 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1600181587 0
+# Node ID 61d0dcad173ead0b570b47ce9242458b9bcd72bf
+# Parent  99788ef5e8546cdca3ea42438b7bd111c7e0bd4f
+Bug 1664077 - Move statvfs-related defines from nsLocalFileUnix.h to .cpp. r=sg
+
+They are not needed anywhere else than the .cpp, and can cause problems
+from the additional includes they pull.
+
+Differential Revision: https://phabricator.services.mozilla.com/D90205
+
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
+@@ -67,16 +67,53 @@ static nsresult MacErrorMapper(OSErr inE
+ #include "nsIMIMEService.h"
+ #include <linux/magic.h>
+ #endif
+ 
+ #include "nsNativeCharsetUtils.h"
+ #include "nsTraceRefcnt.h"
+ #include "nsHashKeys.h"
+ 
++/**
++ *  we need these for statfs()
++ */
++#ifdef HAVE_SYS_STATVFS_H
++#  if defined(__osf__) && defined(__DECCXX)
++extern "C" int statvfs(const char*, struct statvfs*);
++#  endif
++#  include <sys/statvfs.h>
++#endif
++
++#ifdef HAVE_SYS_STATFS_H
++#  include <sys/statfs.h>
++#endif
++
++#ifdef HAVE_SYS_VFS_H
++#  include <sys/vfs.h>
++#endif
++
++#ifdef HAVE_SYS_MOUNT_H
++#  include <sys/param.h>
++#  include <sys/mount.h>
++#endif
++
++#if defined(HAVE_STATVFS64) && (!defined(LINUX) && !defined(__osf__))
++#  define STATFS statvfs64
++#  define F_BSIZE f_frsize
++#elif defined(HAVE_STATVFS) && (!defined(LINUX) && !defined(__osf__))
++#  define STATFS statvfs
++#  define F_BSIZE f_frsize
++#elif defined(HAVE_STATFS64)
++#  define STATFS statfs64
++#  define F_BSIZE f_bsize
++#elif defined(HAVE_STATFS)
++#  define STATFS statfs
++#  define F_BSIZE f_bsize
++#endif
++
+ using namespace mozilla;
+ 
+ #define ENSURE_STAT_CACHE()                     \
+     do {                                        \
+         if (!FillStatCache())                   \
+              return NSRESULT_FOR_ERRNO();       \
+     } while(0)
+ 
+diff --git a/xpcom/io/nsLocalFileUnix.h b/xpcom/io/nsLocalFileUnix.h
+--- a/xpcom/io/nsLocalFileUnix.h
++++ b/xpcom/io/nsLocalFileUnix.h
+@@ -20,53 +20,16 @@
+ #include "nsReadableUtils.h"
+ #include "nsIHashable.h"
+ #include "nsIClassInfoImpl.h"
+ #include "mozilla/Attributes.h"
+ #ifdef MOZ_WIDGET_COCOA
+ #include "nsILocalFileMac.h"
+ #endif
+ 
+-/**
+- *  we need these for statfs()
+- */
+-#ifdef HAVE_SYS_STATVFS_H
+-  #if defined(__osf__) && defined(__DECCXX)
+-    extern "C" int statvfs(const char *, struct statvfs *);
+-  #endif
+-  #include <sys/statvfs.h>
+-#endif
+-
+-#ifdef HAVE_SYS_STATFS_H
+-  #include <sys/statfs.h>
+-#endif
+-
+-#ifdef HAVE_SYS_VFS_H
+-  #include <sys/vfs.h>
+-#endif
+-
+-#ifdef HAVE_SYS_MOUNT_H
+-  #include <sys/param.h>
+-  #include <sys/mount.h>
+-#endif
+-
+-#if defined(HAVE_STATVFS64) && (!defined(LINUX) && !defined(__osf__))
+-  #define STATFS statvfs64
+-  #define F_BSIZE f_frsize
+-#elif defined(HAVE_STATVFS) && (!defined(LINUX) && !defined(__osf__))
+-  #define STATFS statvfs
+-  #define F_BSIZE f_frsize
+-#elif defined(HAVE_STATFS64)
+-  #define STATFS statfs64
+-  #define F_BSIZE f_bsize
+-#elif defined(HAVE_STATFS)
+-  #define STATFS statfs
+-  #define F_BSIZE f_bsize
+-#endif
+-
+ // stat64 and lstat64 are deprecated on OS X. Normal stat and lstat are
+ // 64-bit by default on OS X 10.6+.
+ #if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
+   #if defined (AIX)
+     #if defined STAT
+       #undef STAT
+     #endif
+   #endif

+ 670 - 0
mozilla-release/patches/1664077-2-82a1.patch

@@ -0,0 +1,670 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1600179914 0
+# Node ID 09dd05b4d15c369dcebf44e952f9ed0003f71265
+# Parent  4dee22ac83b4c11910c7a2be4563aaedb580dd42
+Bug 1664077 - Remove _NON_GLOBAL_ACDEFINES. r=firefox-build-system-reviewers,mhentges,rstewart
+
+I think they're remnants from the past that we don't really need anymore.
+And they're making things more complicated for some pending work of mine.
+
+Differential Revision: https://phabricator.services.mozilla.com/D89687
+
+diff --git a/build/autoconf/config.status.m4 b/build/autoconf/config.status.m4
+--- a/build/autoconf/config.status.m4
++++ b/build/autoconf/config.status.m4
+@@ -144,29 +144,16 @@ dnl Add in the output from the subconfig
+ for ac_subst_arg in $_subconfigure_ac_subst_args; do
+   variable='$'$ac_subst_arg
+   echo "    (''' $ac_subst_arg ''', r''' `eval echo $variable` ''')," >> $CONFIG_STATUS
+ done
+ 
+ cat >> $CONFIG_STATUS <<\EOF
+ ]
+ 
+-dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
+-non_global_defines = [
+-EOF
+-
+-if test -n "$_NON_GLOBAL_ACDEFINES"; then
+-  for var in $_NON_GLOBAL_ACDEFINES; do
+-    echo "    '$var'," >> $CONFIG_STATUS
+-  done
+-fi
+-
+-cat >> $CONFIG_STATUS <<EOF
+-]
+-
+ flags = [
+ undivert(MOZ_DIVERSION_ARGS)dnl
+ ]
+ EOF
+ 
+ changequote([, ])
+ ])
+ 
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -378,19 +378,16 @@ def set_old_configure_define(name, value
+ @imports(_from='six', _import='iteritems')
+ def post_old_configure(raw_config):
+     for k, v in raw_config['substs']:
+         set_old_configure_config(k, v)
+ 
+     for k, v in iteritems(dict(raw_config['defines'])):
+         set_old_configure_define(k, v)
+ 
+-    set_old_configure_config('non_global_defines',
+-                             raw_config['non_global_defines'])
+-
+ 
+ # Assuming no other option is declared after this function, handle the
+ # env options that were injected by mozconfig_options by creating dummy
+ # Option instances and having the sandbox's CommandLineHelper handle
+ # them. We only do so for options that haven't been declared so far,
+ # which should be a proxy for the options that old-configure handles
+ # and that we don't know anything about.
+ @depends('--help')
+diff --git a/configure.py b/configure.py
+--- a/configure.py
++++ b/configure.py
+@@ -86,23 +86,21 @@ def config_status(config):
+         # Serialize types that look like lists and tuples as lists.
+         if not isinstance(v, (bytes, six.text_type, dict)) and isinstance(v, Iterable):
+             return list(v)
+         return v
+ 
+     sanitized_config = {}
+     sanitized_config['substs'] = {
+         k: sanitize_config(v) for k, v in six.iteritems(config)
+-        if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR',
+-                     'CONFIG_STATUS_DEPS')
++        if k not in ('DEFINES', 'TOPSRCDIR', 'TOPOBJDIR', 'CONFIG_STATUS_DEPS')
+     }
+     sanitized_config['defines'] = {
+         k: sanitize_config(v) for k, v in six.iteritems(config['DEFINES'])
+     }
+-    sanitized_config['non_global_defines'] = config['non_global_defines']
+     sanitized_config['topsrcdir'] = config['TOPSRCDIR']
+     sanitized_config['topobjdir'] = config['TOPOBJDIR']
+     sanitized_config['mozconfig'] = config.get('MOZCONFIG')
+ 
+     if not check_unicode(sanitized_config):
+         print("Configuration should be all unicode.", file=sys.stderr)
+         print("Please file a bug for the above.", file=sys.stderr)
+         sys.exit(1)
+@@ -116,17 +114,17 @@ def config_status(config):
+             #!%(python)s
+             # coding=utf-8
+             from __future__ import unicode_literals
+         ''') % {'python': config['PYTHON3']})
+         for k, v in six.iteritems(sanitized_config):
+             fh.write('%s = ' % k)
+             write_indented_repr(fh, v)
+         fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
+-                 "'non_global_defines', 'substs', 'mozconfig']")
++                 "'substs', 'mozconfig']")
+ 
+         if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
+             fh.write(textwrap.dedent('''
+                 if __name__ == '__main__':
+                     from mozbuild.util import patch_main
+                     patch_main()
+                     from mozbuild.config_status import config_status
+                     args = dict([(name, globals()[name]) for name in __all__])
+diff --git a/old-configure.in b/old-configure.in
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -2764,17 +2764,16 @@ MOZ_ARG_DISABLE_BOOL(necko-wifi,
+     NECKO_WIFI=,
+     NECKO_WIFI=1)
+ 
+ if test "$NECKO_WIFI"; then
+   if test -z "$MOZ_ENABLE_DBUS" -a -n "$NECKO_WIFI_DBUS"; then
+     AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
+   fi
+   AC_DEFINE(NECKO_WIFI)
+-  _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
+ fi
+ AC_SUBST(NECKO_WIFI)
+ AC_SUBST(NECKO_WIFI_DBUS)
+ 
+ dnl ========================================================
+ dnl =
+ dnl = Maintainer debug option (no --enable equivalent)
+ dnl =
+@@ -3122,28 +3121,14 @@ fi
+ AC_SUBST(A11Y_LOG)
+ if test -n "$A11Y_LOG"; then
+     AC_DEFINE(A11Y_LOG)
+ fi
+ 
+ dnl Spit out some output
+ dnl ========================================================
+ 
+-dnl The following defines are used by xpcom
+-_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
+-CPP_THROW_NEW
+-HAVE_GETPAGESIZE
+-HAVE_STATVFS64
+-HAVE_STATVFS
+-HAVE_STATFS64
+-HAVE_STATFS
+-HAVE_SYS_STATVFS_H
+-HAVE_SYS_STATFS_H
+-HAVE_SYS_VFS_H
+-HAVE_SYS_MOUNT_H
+-"
+-
+ # Avoid using obsolete NSPR features
+ AC_DEFINE(NO_NSPR_10_SUPPORT)
+ 
+ MOZ_CREATE_CONFIG_STATUS()
+ 
+ rm -fr confdefs* $ac_clean_files
+diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py
+--- a/python/mozbuild/mozbuild/backend/configenvironment.py
++++ b/python/mozbuild/mozbuild/backend/configenvironment.py
+@@ -31,17 +31,16 @@ class BuildConfig(object):
+     """Represents the output of configure."""
+ 
+     _CODE_CACHE = {}
+ 
+     def __init__(self):
+         self.topsrcdir = None
+         self.topobjdir = None
+         self.defines = {}
+-        self.non_global_defines = []
+         self.substs = {}
+         self.files = []
+         self.mozconfig = None
+ 
+     @classmethod
+     def from_config_status(cls, path):
+         """Create an instance from a config.status file."""
+         code_cache = cls._CODE_CACHE
+@@ -90,22 +89,20 @@ class ConfigEnvironment(object):
+     There are two types of files: config files and config headers,
+     each treated through a different member function.
+ 
+     Creating a ConfigEnvironment requires a few arguments:
+       - topsrcdir and topobjdir are, respectively, the top source and
+         the top object directory.
+       - defines is a dict filled from AC_DEFINE and AC_DEFINE_UNQUOTED in
+         autoconf.
+-      - non_global_defines are a list of names appearing in defines above
+-        that are not meant to be exported in ACDEFINES (see below)
+       - substs is a dict filled from AC_SUBST in autoconf.
+ 
+     ConfigEnvironment automatically defines one additional substs variable
+-    from all the defines not appearing in non_global_defines:
++    from all the defines:
+       - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
+         preprocessor command lines. The order in which defines were given
+         when creating the ConfigEnvironment is preserved.
+     and two other additional subst variables from all the other substs:
+       - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
+         order, for use in autoconf.mk. It includes ACDEFINES
+         Only substs with a VALUE are included, such that the resulting file
+         doesn't change when new empty substs are added.
+@@ -116,23 +113,22 @@ class ConfigEnvironment(object):
+ 
+     ConfigEnvironment expects a "top_srcdir" subst to be set with the top
+     source directory, in msys format on windows. It is used to derive a
+     "srcdir" subst when treating config files. It can either be an absolute
+     path or a path relative to the topobjdir.
+     """
+ 
+     def __init__(self, topsrcdir, topobjdir, defines=None,
+-                 non_global_defines=None, substs=None, source=None, mozconfig=None):
++                 substs=None, source=None, mozconfig=None):
+ 
+         if not source:
+             source = mozpath.join(topobjdir, 'config.status')
+         self.source = source
+         self.defines = ReadOnlyDict(defines or {})
+-        self.non_global_defines = non_global_defines or []
+         self.substs = dict(substs or {})
+         self.topsrcdir = mozpath.abspath(topsrcdir)
+         self.topobjdir = mozpath.abspath(topobjdir)
+         self.mozconfig = mozpath.abspath(mozconfig) if mozconfig else None
+         self.lib_prefix = self.substs.get('LIB_PREFIX', '')
+         self.rust_lib_prefix = self.substs.get('RUST_LIB_PREFIX', '')
+         if 'LIB_SUFFIX' in self.substs:
+             self.lib_suffix = '.%s' % self.substs['LIB_SUFFIX']
+@@ -145,18 +141,17 @@ class ConfigEnvironment(object):
+         if self.substs.get('IMPORT_LIB_SUFFIX'):
+             self.import_prefix = self.lib_prefix
+             self.import_suffix = '.%s' % self.substs['IMPORT_LIB_SUFFIX']
+         else:
+             self.import_prefix = self.dll_prefix
+             self.import_suffix = self.dll_suffix
+         self.bin_suffix = self.substs.get('BIN_SUFFIX', '')
+ 
+-        global_defines = [name for name in self.defines
+-                          if name not in self.non_global_defines]
++        global_defines = [name for name in self.defines]
+         self.substs["ACDEFINES"] = ' '.join(
+             [
+                 '-D%s=%s' % (name, shell_quote(self.defines[name]).replace('$', '$$'))
+                 for name in sorted(global_defines)
+             ]
+         )
+ 
+         def serialize(name, obj):
+@@ -193,26 +188,25 @@ class ConfigEnvironment(object):
+ 
+     @property
+     def is_artifact_build(self):
+         return self.substs.get('MOZ_ARTIFACT_BUILDS', False)
+ 
+     @memoized_property
+     def acdefines(self):
+         acdefines = dict((name, self.defines[name])
+-                         for name in self.defines
+-                         if name not in self.non_global_defines)
++                         for name in self.defines)
+         return ReadOnlyDict(acdefines)
+ 
+     @staticmethod
+     def from_config_status(path):
+         config = BuildConfig.from_config_status(path)
+ 
+         return ConfigEnvironment(config.topsrcdir, config.topobjdir,
+-                                 config.defines, config.non_global_defines, config.substs, path)
++                                 config.defines, config.substs, path)
+ 
+ 
+ class PartialConfigDict(object):
+     """Facilitates mapping the config.statusd defines & substs with dict-like access.
+ 
+     This allows a buildconfig client to use buildconfig.defines['FOO'] (and
+     similar for substs), where the value of FOO is delay-loaded until it is
+     needed.
+@@ -317,17 +311,17 @@ class PartialConfigEnvironment(object):
+     process to handle things like GENERATED_FILES, CONFIGURE_DEFINE_FILES, and
+     anything else that may need to access specific substs or defines.
+ 
+     Creating a PartialConfigEnvironment requires only the topobjdir, which is
+     needed to distinguish between the top-level environment and the js/src
+     environment.
+ 
+     The PartialConfigEnvironment automatically defines one additional subst variable
+-    from all the defines not appearing in non_global_defines:
++    from all the defines:
+       - ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
+         preprocessor command lines. The order in which defines were given
+         when creating the ConfigEnvironment is preserved.
+ 
+     and one additional define from all the defines as a dictionary:
+       - ALLDEFINES contains all of the global defines as a dictionary. This is
+       intended to be used instead of the defines structure from config.status so
+       that scripts can depend directly on its value.
+@@ -340,17 +334,16 @@ class PartialConfigEnvironment(object):
+         self.topobjdir = topobjdir
+ 
+     def write_vars(self, config):
+         substs = config['substs'].copy()
+         defines = config['defines'].copy()
+ 
+         global_defines = [
+             name for name in config['defines']
+-            if name not in config['non_global_defines']
+         ]
+         acdefines = ' '.join(['-D%s=%s' % (name,
+                                            shell_quote(config['defines'][name]).replace('$', '$$'))
+                               for name in sorted(global_defines)])
+         substs['ACDEFINES'] = acdefines
+ 
+         all_defines = OrderedDict()
+         for k in global_defines:
+diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py
+--- a/python/mozbuild/mozbuild/base.py
++++ b/python/mozbuild/mozbuild/base.py
+@@ -357,20 +357,16 @@ class MozbuildObject(ProcessExecutionMix
+ 
+         return self._config_environment
+ 
+     @property
+     def defines(self):
+         return self.config_environment.defines
+ 
+     @property
+-    def non_global_defines(self):
+-        return self.config_environment.non_global_defines
+-
+-    @property
+     def substs(self):
+         return self.config_environment.substs
+ 
+     @property
+     def distdir(self):
+         return os.path.join(self.topobjdir, 'dist')
+ 
+     @property
+diff --git a/python/mozbuild/mozbuild/config_status.py b/python/mozbuild/mozbuild/config_status.py
+--- a/python/mozbuild/mozbuild/config_status.py
++++ b/python/mozbuild/mozbuild/config_status.py
+@@ -56,19 +56,18 @@ You are building Firefox on Windows. You
+ files by running:
+ 
+    mach build-backend --backend=VisualStudio
+ 
+ ===============================
+ '''.strip()
+ 
+ 
+-def config_status(topobjdir='.', topsrcdir='.', defines=None,
+-                  non_global_defines=None, substs=None, source=None,
+-                  mozconfig=None, args=sys.argv[1:]):
++def config_status(topobjdir='.', topsrcdir='.', defines=None, substs=None,
++                  source=None, mozconfig=None, args=sys.argv[1:]):
+     '''Main function, providing config.status functionality.
+ 
+     Contrary to config.status, it doesn't use CONFIG_FILES or CONFIG_HEADERS
+     variables.
+ 
+     Without the -n option, this program acts as config.status and considers
+     the current directory as the top object directory, even when config.status
+     is in a different directory. It will, however, treat the directory
+@@ -108,18 +107,17 @@ def config_status(topobjdir='.', topsrcd
+     parser.add_argument('--dry-run', action='store_true',
+                         help='do everything except writing files out.')
+     options = parser.parse_args(args)
+ 
+     # Without -n, the current directory is meant to be the top object directory
+     if not options.not_topobjdir:
+         topobjdir = os.path.realpath('.')
+ 
+-    env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
+-                            non_global_defines=non_global_defines, substs=substs,
++    env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines, substs=substs,
+                             source=source, mozconfig=mozconfig)
+ 
+     with FileAvoidWrite(os.path.join(topobjdir, 'mozinfo.json')) as f:
+         write_mozinfo(f, env, os.environ)
+ 
+     cpu_start = process_time()
+     time_start = time.time()
+ 
+diff --git a/python/mozbuild/mozbuild/test/backend/common.py b/python/mozbuild/mozbuild/test/backend/common.py
+--- a/python/mozbuild/mozbuild/test/backend/common.py
++++ b/python/mozbuild/mozbuild/test/backend/common.py
+@@ -25,159 +25,141 @@ log_manager.add_terminal_logging()
+ 
+ 
+ test_data_path = mozpath.abspath(mozpath.dirname(__file__))
+ test_data_path = mozpath.join(test_data_path, 'data')
+ 
+ 
+ CONFIGS = defaultdict(lambda: {
+     'defines': {},
+-    'non_global_defines': [],
+     'substs': {'OS_TARGET': 'WINNT'},
+ }, {
+     'binary-components': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'LIB_PREFIX': 'lib',
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+             'COMPILE_ENVIRONMENT': '1',
+         },
+     },
+     'rust-library': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'RUST_TARGET': 'x86_64-unknown-linux-gnu',
+             'LIB_PREFIX': 'lib',
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+         },
+     },
+     'host-rust-library': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
+             'RUST_TARGET': 'armv7-linux-androideabi',
+             'LIB_PREFIX': 'lib',
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+         },
+     },
+     'host-rust-library-features': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
+             'RUST_TARGET': 'armv7-linux-androideabi',
+             'LIB_PREFIX': 'lib',
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+         },
+     },
+     'rust-library-features': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'RUST_TARGET': 'x86_64-unknown-linux-gnu',
+             'LIB_PREFIX': 'lib',
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+         },
+     },
+     'rust-programs': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'RUST_TARGET': 'i686-pc-windows-msvc',
+             'RUST_HOST_TARGET': 'i686-pc-windows-msvc',
+             'BIN_SUFFIX': '.exe',
+             'HOST_BIN_SUFFIX': '.exe',
+         },
+     },
+     'test-support-binaries-tracked': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'LIB_SUFFIX': 'dll',
+             'BIN_SUFFIX': '.exe',
+         },
+     },
+     'sources': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+         },
+     },
+     'stub0': {
+         'defines': {
+             'MOZ_TRUE_1': '1',
+             'MOZ_TRUE_2': '1',
+         },
+-        'non_global_defines': [
+-            'MOZ_NONGLOBAL_1',
+-            'MOZ_NONGLOBAL_2',
+-        ],
+         'substs': {
+             'MOZ_FOO': 'foo',
+             'MOZ_BAR': 'bar',
+         },
+     },
+     'substitute_config_files': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'MOZ_FOO': 'foo',
+             'MOZ_BAR': 'bar',
+         },
+     },
+     'test_config': {
+         'defines': {
+             'foo': 'baz qux',
+             'baz': 1,
+         },
+-        'non_global_defines': [],
+         'substs': {
+             'foo': 'bar baz',
+         },
+     },
+     'visual-studio': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'MOZ_APP_NAME': 'my_app',
+         },
+     },
+     'prog-lib-c-only': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'LIB_SUFFIX': '.a',
+             'BIN_SUFFIX': '',
+         },
+     },
+     'gn-processor': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'BUILD_BACKENDS': [
+                 'GnMozbuildWriter',
+                 'RecursiveMake',
+             ],
+             'COMPILE_ENVIRONMENT': '1',
+             'STL_FLAGS': [],
+             'RUST_TARGET': 'x86_64-unknown-linux-gnu',
+@@ -185,34 +167,31 @@ CONFIGS = defaultdict(lambda: {
+             'RUST_LIB_PREFIX': 'lib',
+             'LIB_SUFFIX': 'a',
+             'RUST_LIB_SUFFIX': 'a',
+             'OS_TARGET': 'Darwin',
+         },
+     },
+     'ipdl_sources': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'LIB_SUFFIX': '.a',
+             'BIN_SUFFIX': '',
+         },
+     },
+     'program-paths': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'COMPILE_ENVIRONMENT': '1',
+             'BIN_SUFFIX': '.prog',
+         },
+     },
+     'linkage': {
+         'defines': {},
+-        'non_global_defines': [],
+         'substs': {
+             'CC_TYPE': 'clang',
+             'COMPILE_ENVIRONMENT': '1',
+             'LIB_SUFFIX': 'a',
+             'BIN_SUFFIX': '.exe',
+             'DLL_SUFFIX': '.so',
+             'OBJ_SUFFIX': 'o',
+             'EXPAND_LIBS_LIST_STYLE': 'list',
+diff --git a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
+--- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
++++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
+@@ -32,22 +32,20 @@ class ConfigEnvironment(ConfigStatus.Con
+ 
+ class TestEnvironment(unittest.TestCase):
+     def test_auto_substs(self):
+         '''Test the automatically set values of ACDEFINES, ALLSUBSTS
+         and ALLEMPTYSUBSTS.
+         '''
+         env = ConfigEnvironment('.', '.',
+                                 defines={'foo': 'bar', 'baz': 'qux 42',
+-                                         'abc': "d'e'f", 'extra': 'foobar'},
+-                                non_global_defines=['extra', 'ignore'],
++                                         'abc': "d'e'f"},
+                                 substs={'FOO': 'bar', 'FOOBAR': '', 'ABC': 'def',
+                                         'bar': 'baz qux', 'zzz': '"abc def"',
+                                         'qux': ''})
+-        # non_global_defines should be filtered out in ACDEFINES.
+         # Original order of the defines need to be respected in ACDEFINES
+         self.assertEqual(env.substs['ACDEFINES'],
+                          """-Dabc='d'\\''e'\\''f' -Dbaz='qux 42' -Dfoo=bar""")
+         # Likewise for ALLSUBSTS, which also must contain ACDEFINES
+         self.assertEqual(env.substs['ALLSUBSTS'], '''ABC = def
+ ACDEFINES = -Dabc='d'\\''e'\\''f' -Dbaz='qux 42' -Dfoo=bar
+ FOO = bar
+ bar = baz qux
+diff --git a/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py b/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
+--- a/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
++++ b/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
+@@ -13,26 +13,22 @@ from shutil import rmtree
+ 
+ import mozpack.path as mozpath
+ from mozbuild.backend.configenvironment import PartialConfigEnvironment
+ 
+ config = {
+     'defines': {
+         'MOZ_FOO': '1',
+         'MOZ_BAR': '2',
+-        'MOZ_NON_GLOBAL': '3',
+     },
+     'substs': {
+         'MOZ_SUBST_1': '1',
+         'MOZ_SUBST_2': '2',
+         'CPP': 'cpp',
+     },
+-    'non_global_defines': [
+-        'MOZ_NON_GLOBAL',
+-    ],
+ }
+ 
+ 
+ class TestPartial(unittest.TestCase):
+     def setUp(self):
+         self._old_env = dict(os.environ)
+ 
+     def tearDown(self):
+diff --git a/python/mozbuild/mozbuild/test/test_base.py b/python/mozbuild/mozbuild/test/test_base.py
+--- a/python/mozbuild/mozbuild/test/test_base.py
++++ b/python/mozbuild/mozbuild/test/test_base.py
+@@ -299,20 +299,19 @@ class TestMozbuildObject(unittest.TestCa
+         try:
+             with open(os.path.join(d, 'config.status'), 'w') as fh:
+                 fh.write('# coding=utf-8\n')
+                 fh.write('from __future__ import unicode_literals\n')
+                 fh.write("topobjdir = '%s'\n" % mozpath.normsep(d))
+                 fh.write("topsrcdir = '%s'\n" % topsrcdir)
+                 fh.write("mozconfig = None\n")
+                 fh.write("defines = { 'FOO': 'foo' }\n")
+-                fh.write("non_global_defines = ['BAR']\n")
+                 fh.write("substs = { 'QUX': 'qux' }\n")
+                 fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
+-                         "'non_global_defines', 'substs', 'mozconfig']")
++                         "'substs', 'mozconfig']")
+ 
+             base = self.get_base(topobjdir=d)
+ 
+             ce = base.config_environment
+             self.assertIsInstance(ce, ConfigEnvironment)
+ 
+             self.assertEqual(base.defines, ce.defines)
+             self.assertEqual(base.substs, ce.substs)

+ 156 - 0
mozilla-release/patches/1664077-3-82a1.patch

@@ -0,0 +1,156 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1600181590 0
+# Node ID 5297fcec7cd75d397b4e61a10281cf39a12a735c
+# Parent  9bb9281e760b2b6cacbfc5f843bf60a617e66b23
+Bug 1664077 - Remove xpcom-private.h. r=sg
+
+It's not necessary anymore.
+
+Differential Revision: https://phabricator.services.mozilla.com/D90206
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -29,17 +29,17 @@ GARBAGE_DIRS += _javagen _profile static
+ # RUST*TARGET to GARBAGE_DIRS for those directories building Rust libraries.
+ # But the directories building Rust libraries don't actually have
+ # subdirectories to remove.  So we add to GARBAGE_DIRS once here, globally,
+ # for it to have the desired effect.
+ GARBAGE_DIRS += $(RUST_TARGET)
+ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
+    config/autoconf.mk \
+    mozilla-config.h \
+-   xpcom/xpcom-config.h xpcom/xpcom-private.h \
++   xpcom/xpcom-config.h \
+    .mozconfig.mk
+ 
+ ifndef MOZ_PROFILE_USE
+ $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
+ source-repo.h: $(MDDEPDIR)/source-repo.h.stub
+ buildid.h: $(MDDEPDIR)/buildid.h.stub
+ endif
+ 
+diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h
+--- a/xpcom/components/nsComponentManager.h
++++ b/xpcom/components/nsComponentManager.h
+@@ -4,17 +4,16 @@
+  * 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/. */
+ 
+ #ifndef nsComponentManager_h__
+ #define nsComponentManager_h__
+ 
+ #include "nsXPCOM.h"
+ 
+-#include "xpcom-private.h"
+ #include "nsIComponentManager.h"
+ #include "nsIComponentRegistrar.h"
+ #include "nsIMemoryReporter.h"
+ #include "nsIServiceManager.h"
+ #include "nsIFile.h"
+ #include "mozilla/ArenaAllocator.h"
+ #include "mozilla/Atomics.h"
+ #include "mozilla/MemoryReporting.h"
+diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp
++++ b/xpcom/io/nsLocalFileUnix.cpp
+@@ -28,17 +28,16 @@
+ #include <sys/mount.h>
+ #include <sys/quota.h>
+ #include <sys/sysmacros.h>
+ #ifndef BLOCK_SIZE
+ #define BLOCK_SIZE 1024 /* kernel block size */
+ #endif
+ #endif
+ 
+-#include "xpcom-private.h"
+ #include "nsDirectoryServiceDefs.h"
+ #include "nsCRT.h"
+ #include "nsCOMPtr.h"
+ #include "nsMemory.h"
+ #include "nsIFile.h"
+ #include "nsString.h"
+ #include "nsReadableUtils.h"
+ #include "nsLocalFile.h"
+diff --git a/xpcom/io/nsNativeCharsetUtils.cpp b/xpcom/io/nsNativeCharsetUtils.cpp
+--- a/xpcom/io/nsNativeCharsetUtils.cpp
++++ b/xpcom/io/nsNativeCharsetUtils.cpp
+@@ -1,16 +1,14 @@
+ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+ /* vim: set ts=8 sts=2 et sw=2 tw=80: */
+ /* 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/. */
+ 
+-#include "xpcom-private.h"
+-
+ //-----------------------------------------------------------------------------
+ // Non-Windows
+ //-----------------------------------------------------------------------------
+ #ifndef XP_WIN
+ 
+ #include "nsAString.h"
+ #include "nsReadableUtils.h"
+ #include "nsString.h"
+diff --git a/xpcom/moz.build b/xpcom/moz.build
+--- a/xpcom/moz.build
++++ b/xpcom/moz.build
+@@ -37,14 +37,13 @@ TEST_DIRS += [
+ #  Can't build internal xptcall tests that use symbols which are not exported.
+ #TEST_DIRS += [
+ #    'reflect/xptinfo/tests',
+ #    'reflect/xptcall/tests,
+ #]
+ 
+ CONFIGURE_DEFINE_FILES += [
+     'xpcom-config.h',
+-    'xpcom-private.h',
+ ]
+ 
+ EXPORTS += [
+     '!xpcom-config.h',
+ ]
+diff --git a/xpcom/xpcom-private.h.in b/xpcom/xpcom-private.h.in
+deleted file mode 100644
+--- a/xpcom/xpcom-private.h.in
++++ /dev/null
+@@ -1,38 +0,0 @@
+-/* 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/. */
+-
+-/* The following defines are only used by the xpcom implementation */
+-
+-#ifndef _XPCOM_PRIVATE_H_
+-#define _XPCOM_PRIVATE_H_
+-
+-/* Define if getpagesize() is available */
+-#undef HAVE_GETPAGESIZE
+-
+-/* Define if statvfs64() is available */
+-#undef HAVE_STATVFS64
+-
+-/* Define if statvfs() is available */
+-#undef HAVE_STATVFS
+-
+-/* Define if statfs64() is available */
+-#undef HAVE_STATFS64
+-
+-/* Define if statfs() is available */
+-#undef HAVE_STATFS
+-
+-/* Define if <sys/statvfs.h> is present */
+-#undef HAVE_SYS_STATVFS_H
+-
+-/* Define if <sys/statfs.h> is present */
+-#undef HAVE_SYS_STATFS_H
+-
+-/* Define if <sys/vfs.h> is present */
+-#undef HAVE_SYS_VFS_H
+-
+-/* Define if <sys/mount.h> is present */
+-#undef HAVE_SYS_MOUNT_H
+-
+-#endif /* _XPCOM_PRIVATE_H_ */
+-

+ 6 - 6
mozilla-release/patches/1664083-82a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1599709470 0
 # Date 1599709470 0
 # Node ID 808a836d9f2b54b8e386cfe7647851259de98abd
 # Node ID 808a836d9f2b54b8e386cfe7647851259de98abd
-# Parent  e2bcb16778f78bef1bda5639abeac792884dcf22
+# Parent  0e9b21e03cfc1afd2a4cbda42bf6ae532d55c21e
 Bug 1664083 - Remove support for external source directories. r=nalexander
 Bug 1664083 - Remove support for external source directories. r=nalexander
 
 
 It was there for comm-central, and hasn't been used since bug 1479904.
 It was there for comm-central, and hasn't been used since bug 1479904.
@@ -77,7 +77,7 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
      return mozconfig
      return mozconfig
  
  
  
  
-@@ -1031,27 +1015,23 @@ set_define('XP_FREEBSD', target_is_freeb
+@@ -1042,27 +1026,23 @@ set_define('XP_FREEBSD', target_is_freeb
  def target_is_solaris(target):
  def target_is_solaris(target):
      if target.kernel == 'SunOS':
      if target.kernel == 'SunOS':
          return True
          return True
@@ -110,7 +110,7 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
 diff --git a/old-configure.in b/old-configure.in
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
 +++ b/old-configure.in
-@@ -1755,18 +1755,16 @@ MOZ_ARG_WITH_STRING(branding,
+@@ -1788,18 +1788,16 @@ MOZ_ARG_WITH_STRING(branding,
  
  
  REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
  REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
  if test -z "$REAL_BRANDING_DIRECTORY"; then
  if test -z "$REAL_BRANDING_DIRECTORY"; then
@@ -132,7 +132,7 @@ diff --git a/old-configure.in b/old-configure.in
 diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py
 diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py
 --- a/python/mozbuild/mozbuild/backend/configenvironment.py
 --- a/python/mozbuild/mozbuild/backend/configenvironment.py
 +++ b/python/mozbuild/mozbuild/backend/configenvironment.py
 +++ b/python/mozbuild/mozbuild/backend/configenvironment.py
-@@ -176,24 +176,16 @@ class ConfigEnvironment(object):
+@@ -173,24 +173,16 @@ class ConfigEnvironment(object):
              sorted([
              sorted([
                  '%s =' % name
                  '%s =' % name
                  for name in self.substs if not self.substs[name]
                  for name in self.substs if not self.substs[name]
@@ -156,11 +156,11 @@ diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozb
      @memoized_property
      @memoized_property
      def acdefines(self):
      def acdefines(self):
          acdefines = dict((name, self.defines[name])
          acdefines = dict((name, self.defines[name])
-                          for name in self.defines
+                          for name in self.defines)
 diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
 diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
 --- a/python/mozbuild/mozbuild/frontend/context.py
 --- a/python/mozbuild/mozbuild/frontend/context.py
 +++ b/python/mozbuild/mozbuild/frontend/context.py
 +++ b/python/mozbuild/mozbuild/frontend/context.py
-@@ -678,21 +678,16 @@ class SourcePath(Path):
+@@ -684,21 +684,16 @@ class SourcePath(Path):
          if value.startswith('!'):
          if value.startswith('!'):
              raise ValueError('Object directory paths are not allowed')
              raise ValueError('Object directory paths are not allowed')
          if value.startswith('%'):
          if value.startswith('%'):

+ 137 - 0
mozilla-release/patches/1667436-83a1.patch

@@ -0,0 +1,137 @@
+# HG changeset patch
+# User Ricky Stewart <rstewart@mozilla.com>
+# Date 1601916701 0
+# Node ID dc6b76f01a2d7f12c6ddb71bc0dcb5d7892102e2
+# Parent  4ab3141fc0f6551f3099afae3671c764ff34c8db
+Bug 1667436 - Merge content of `docs/setup/mach.rst` into existing documentation r=firefox-build-system-reviewers,mhentges DONTBUILD
+
+This document was imported from MDN and contained very outdated/incorrect information, and much of the information here is duplicated from the existing `mach` documentation. For the little content that isn't already expressed in the existing documentation in a better way, merge it into `python/mach/docs`.
+
+The unique content is mainly in the FAQ, so I added a new page for that.
+
+Differential Revision: https://phabricator.services.mozilla.com/D91455
+
+diff --git a/python/mach/docs/faq.rst b/python/mach/docs/faq.rst
+new file mode 100644
+--- /dev/null
++++ b/python/mach/docs/faq.rst
+@@ -0,0 +1,85 @@
++.. _mach_faq:
++
++==========================
++Frequently Asked Questions
++==========================
++
++How do I report bugs?
++---------------------
++
++Bugs against the ``mach`` core can be filed in Bugzilla in the `Firefox
++Build System::Mach
++Core <https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20Build%20System&component=Mach%20Core>`__ component.
++
++.. note::
++
++   Most ``mach`` bugs are bugs in individual commands, not bugs in the core
++   ``mach`` code. Bugs for individual commands should be filed against the
++   component that command is related to. For example, bugs in the
++   *build* command should be filed against *Firefox Build System ::
++   General*. Bugs against testing commands should be filed somewhere in
++   the *Testing* product.
++
++
++Is ``mach`` a build system?
++---------------------------
++
++No. ``mach`` is just a generic command dispatching tool that happens to have
++a few commands that interact with the real build system. Historically,
++``mach`` *was* born to become a better interface to the build system.
++However, its potential beyond just build system interaction was quickly
++realized and ``mach`` grew to fit those needs.
++
++How do I add features to ``mach``?
++----------------------------------
++If you would like to add a new feature to ``mach`` that cannot be implemented as
++a ``mach`` command, the first step is to file a bug in the
++``Firefox Build System :: Mach Core`` component.
++
++Should I implement X as a ``mach`` command?
++-------------------------------------------
++
++There are no hard or fast rules. Generally speaking, if you have some
++piece of functionality or action that is useful to multiple people
++(especially if it results in productivity wins), then you should
++consider implementing a ``mach`` command for it.
++
++Some other cases where you should consider implementing something as a
++mach command:
++
++-  When your tool is a random script in the tree. Random scripts are
++   hard to find and may not conform to coding conventions or best
++   practices. Mach provides a framework in which your tool can live that
++   will put it in a better position to succeed than if it were on its
++   own.
++-  When the alternative is a ``make`` target. The build team generally does
++   not like one-off ``make`` targets that aren't part of building (read:
++   compiling) the tree. This includes things related to testing and
++   packaging. These weigh down ``Makefiles`` and add to the burden of
++   maintaining the build system. Instead, you are encouraged to
++   implement ancillary functionality in Python. If you do implement something
++   in Python, hooking it up to ``mach`` is often trivial.
++
++
++How does ``mach`` fit into the modules system?
++----------------------------------------------
++
++Mozilla operates with a `modules governance
++system <https://www.mozilla.org/about/governance/policies/module-ownership/>`__ where
++there are different components with different owners. There is not
++currently a ``mach`` module. There may or may never be one; currently ``mach``
++is owned by the build team.
++
++Even if a ``mach`` module were established, ``mach`` command modules would
++likely never belong to it. Instead, ``mach`` command modules are owne by the
++team/module that owns the system they interact with. In other words, ``mach``
++is not a power play to consolidate authority for tooling. Instead, it aims to
++expose that tooling through a common, shared interface.
++
++
++Who do I contact for help or to report issues?
++----------------------------------------------
++
++You can ask questions in
++`#build <https://chat.mozilla.org/#/room/#build:mozilla.org>`__.
++
+diff --git a/python/mach/docs/index.rst b/python/mach/docs/index.rst
+--- a/python/mach/docs/index.rst
++++ b/python/mach/docs/index.rst
+@@ -79,8 +79,9 @@ best fit for you.
+    :maxdepth: 1
+    :hidden:
+ 
+    usage
+    commands
+    driver
+    logging
+    settings
++   faq
+diff --git a/python/mach/docs/usage.rst b/python/mach/docs/usage.rst
+--- a/python/mach/docs/usage.rst
++++ b/python/mach/docs/usage.rst
+@@ -105,10 +105,17 @@ The settings file follows the ``ini`` fo
+     eslint = lint -l eslint
+ 
+     [build]
+     telemetry = true
+ 
+     [try]
+     default = fuzzy
+ 
++Adding ``mach`` to your ``PATH``
++--------------------------------
++
++If you don't like having to type ``./mach``, you can add your source directory
++to your ``PATH``. DO NOT copy the script to a directory already in your
++``PATH``.
++
+ 
+ .. _bash completion: https://searchfox.org/mozilla-central/source/python/mach/bash-completion.sh

+ 5 - 5
mozilla-release/patches/1667896-83a1.patch

@@ -2,7 +2,7 @@
 # User Ricky Stewart <rstewart@mozilla.com>
 # User Ricky Stewart <rstewart@mozilla.com>
 # Date 1601344273 0
 # Date 1601344273 0
 # Node ID de328913ae125ff7c3810cadf8b65547f15a981d
 # Node ID de328913ae125ff7c3810cadf8b65547f15a981d
-# Parent  ef8d8a0e760d2f40759aefa120c286dcfd052f55
+# Parent  98ca7e0d36b83f75fb2d1d12b57377e4a6b31bd3
 Bug 1667896 - Remove `MOZ_ANDROID_DISTRIBUTION_DIRECTORY` r=nalexander
 Bug 1667896 - Remove `MOZ_ANDROID_DISTRIBUTION_DIRECTORY` r=nalexander
 
 
 This config value is evidently a Fennec thing that isn't used anywhere any more.
 This config value is evidently a Fennec thing that isn't used anywhere any more.
@@ -12,7 +12,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D91647
 diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
 diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
 --- a/build/moz.configure/old.configure
 --- a/build/moz.configure/old.configure
 +++ b/build/moz.configure/old.configure
 +++ b/build/moz.configure/old.configure
-@@ -179,17 +179,16 @@ def old_configure_options(*options):
+@@ -103,17 +103,16 @@ def old_configure_options(*options):
      '--enable-system-pixman',
      '--enable-system-pixman',
      '--enable-universalchardet',
      '--enable-universalchardet',
      '--enable-updater',
      '--enable-updater',
@@ -24,16 +24,16 @@ diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configu
 -    '--with-android-distribution-directory',
 -    '--with-android-distribution-directory',
      '--with-android-max-sdk',
      '--with-android-max-sdk',
      '--with-android-min-sdk',
      '--with-android-min-sdk',
-     '--with-app-basename',
-     '--with-app-name',
      '--with-branding',
      '--with-branding',
      '--with-debug-label',
      '--with-debug-label',
      '--with-distribution-id',
      '--with-distribution-id',
      '--with-jitreport-granularity',
      '--with-jitreport-granularity',
+     '--with-macbundlename-prefix',
+     '--with-nss-exec-prefix',
 diff --git a/old-configure.in b/old-configure.in
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
 +++ b/old-configure.in
-@@ -1638,32 +1638,16 @@ MOZ_DEVTOOLS=server
+@@ -1632,32 +1632,16 @@ MOZ_DEVTOOLS=server
  
  
  case "$target_os" in
  case "$target_os" in
      mingw*)
      mingw*)

+ 125 - 0
mozilla-release/patches/1669633-1-83a1.patch

@@ -0,0 +1,125 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093591 0
+# Node ID f9b1e7a5b6eef7b81c2170ca1701fcc49e87b72c
+# Parent  0a8dd586f954d25ca5a96b0b184e136eae5d6fde
+Bug 1669633 - Don't set AC_SUBSTs and AC_DEFINEs from old-configure directly. r=firefox-build-system-reviewers,rstewart
+
+In order to be able to run both old-configure and js/src/old-configure
+from the same python configure run, we need to stop setting the items
+set by old-configure into the global sandbox config, and instead store
+them to be later handled by configure.py.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92718
+
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -290,48 +290,27 @@ def old_configure(prepare_configure, pre
+         if flag not in all_options:
+             die('Missing option in `@old_configure_options` in %s: %s',
+                 __file__, flag)
+ 
+     # If the code execution above fails, we want to keep the file around for
+     # debugging.
+     os.remove('config.data')
+ 
+-    for c in ('substs', 'defines'):
+-        raw_config[c] = [
++    return namespace(**{
++        c: [
+             (k[1:-1], v[1:-1] if isinstance(v, string_types) else v)
+             for k, v in raw_config[c]
+         ]
+-
+-    return raw_config
+-
+-
+-# set_config is only available in the global namespace, not directly in
+-# @depends functions, but we do need to enumerate the result of
+-# old_configure, so we cheat.
+-@imports('__sandbox__')
+-def set_old_configure_config(name, value):
+-    __sandbox__.set_config_impl(name, value)
+-
+-# Same as set_old_configure_config, but for set_define.
++        for c in ('substs', 'defines')
++    })
+ 
+ 
+-@imports('__sandbox__')
+-def set_old_configure_define(name, value):
+-    __sandbox__.set_define_impl(name, value)
+-
+-
+-@depends(old_configure)
+-@imports(_from='six', _import='iteritems')
+-def post_old_configure(raw_config):
+-    for k, v in raw_config['substs']:
+-        set_old_configure_config(k, v)
+-
+-    for k, v in iteritems(dict(raw_config['defines'])):
+-        set_old_configure_define(k, v)
++set_config('OLD_CONFIGURE_SUBSTS', old_configure.substs)
++set_config('OLD_CONFIGURE_DEFINES', old_configure.defines)
+ 
+ 
+ # Assuming no other option is declared after this function, handle the
+ # env options that were injected by mozconfig_options by creating dummy
+ # Option instances and having the sandbox's CommandLineHelper handle
+ # them. We only do so for options that haven't been declared so far,
+ # which should be a proxy for the options that old-configure handles
+ # and that we don't know anything about.
+diff --git a/configure.py b/configure.py
+--- a/configure.py
++++ b/configure.py
+@@ -86,21 +86,26 @@ def config_status(config):
+         # Serialize types that look like lists and tuples as lists.
+         if not isinstance(v, (bytes, six.text_type, dict)) and isinstance(v, Iterable):
+             return list(v)
+         return v
+ 
+     sanitized_config = {}
+     sanitized_config['substs'] = {
+         k: sanitize_config(v) for k, v in six.iteritems(config)
+-        if k not in ('DEFINES', 'TOPSRCDIR', 'TOPOBJDIR', 'CONFIG_STATUS_DEPS')
++        if k not in ('DEFINES', 'TOPSRCDIR', 'TOPOBJDIR', 'CONFIG_STATUS_DEPS',
++                     'OLD_CONFIGURE_SUBSTS', 'OLD_CONFIGURE_DEFINES')
+     }
++    for k, v in config['OLD_CONFIGURE_SUBSTS']:
++        sanitized_config['substs'][k] = sanitize_config(v)
+     sanitized_config['defines'] = {
+         k: sanitize_config(v) for k, v in six.iteritems(config['DEFINES'])
+     }
++    for k, v in config['OLD_CONFIGURE_DEFINES']:
++        sanitized_config['defines'][k] = sanitize_config(v)
+     sanitized_config['topsrcdir'] = config['TOPSRCDIR']
+     sanitized_config['topobjdir'] = config['TOPOBJDIR']
+     sanitized_config['mozconfig'] = config.get('MOZCONFIG')
+ 
+     if not check_unicode(sanitized_config):
+         print("Configuration should be all unicode.", file=sys.stderr)
+         print("Please file a bug for the above.", file=sys.stderr)
+         sys.exit(1)
+diff --git a/js/sub.configure b/js/sub.configure
+--- a/js/sub.configure
++++ b/js/sub.configure
+@@ -38,17 +38,17 @@ def js_subconfigure(host, target, build_
+ 
+     logger = logging.getLogger('moz.configure')
+     formatter = logging.Formatter('js/src> %(levelname)s: %(message)s')
+     for handler in logger.handlers:
+         handler.setFormatter(formatter)
+         if isinstance(handler, ConfigureOutputHandler):
+             handler._stdout = PrefixOutput('js/src> ', handler._stdout)
+ 
+-    substs = dict(old_configure['substs'])
++    substs = dict(old_configure.substs)
+     assignments = dict(old_configure_assignments)
+     environ = dict(os.environ)
+ 
+     options = [host, target] +  js_configure_args
+ 
+     options.append('--prefix=%s/dist' % build_env.topobjdir)
+ 
+     if substs.get('ZLIB_IN_MOZGLUE'):

+ 86 - 0
mozilla-release/patches/1669633-2-83a1.patch

@@ -0,0 +1,86 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093501 0
+# Node ID 261ea39c0758d2fef335d39a63efc94b38135524
+# Parent  c1121d3309c7631bbfeadfa0d9ebb9653a84de1e
+Bug 1669633 - Normalize sanitized_config earlier. r=firefox-build-system-reviewers,rstewart
+
+It wasn't normalized early enough to end up in config.status. It is
+surprising this hasn't caused problems earlier.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92719
+
+diff --git a/configure.py b/configure.py
+--- a/configure.py
++++ b/configure.py
+@@ -106,16 +106,36 @@ def config_status(config):
+     sanitized_config['topobjdir'] = config['TOPOBJDIR']
+     sanitized_config['mozconfig'] = config.get('MOZCONFIG')
+ 
+     if not check_unicode(sanitized_config):
+         print("Configuration should be all unicode.", file=sys.stderr)
+         print("Please file a bug for the above.", file=sys.stderr)
+         sys.exit(1)
+ 
++    # Some values in sanitized_config also have more complex types, such as
++    # EnumString, which using when calling config_status would currently
++    # break the build, as well as making it inconsistent with re-running
++    # config.status, for which they are normalized to plain strings via
++    # indented_repr. Likewise for non-dict non-string iterables being
++    # converted to lists.
++    def normalize(obj):
++        if isinstance(obj, dict):
++            return {
++                k: normalize(v)
++                for k, v in six.iteritems(obj)
++            }
++        if isinstance(obj, six.text_type):
++            return six.text_type(obj)
++        if isinstance(obj, Iterable):
++            return [normalize(o) for o in obj]
++        return obj
++
++    sanitized_config = normalize(sanitized_config)
++
+     # Create config.status. Eventually, we'll want to just do the work it does
+     # here, when we're able to skip configure tests/use cached results/not rely
+     # on autoconf.
+     logging.getLogger('moz.configure').info('Creating config.status')
+     with codecs.open('config.status', 'w', 'utf-8') as fh:
+         fh.write(textwrap.dedent('''\
+             #!%(python)s
+             # coding=utf-8
+@@ -149,32 +169,14 @@ def config_status(config):
+                                                       config['TOPSRCDIR'])):
+             fh.write('%s\n' % mozpath.normpath(f))
+ 
+     # Other things than us are going to run this file, so we need to give it
+     # executable permissions.
+     os.chmod('config.status', 0o755)
+     if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
+         from mozbuild.config_status import config_status
+-
+-        # Some values in sanitized_config also have more complex types, such as
+-        # EnumString, which using when calling config_status would currently
+-        # break the build, as well as making it inconsistent with re-running
+-        # config.status, for which they are normalized to plain strings via
+-        # indented_repr. Likewise for non-dict non-string iterables being
+-        # converted to lists.
+-        def normalize(obj):
+-            if isinstance(obj, dict):
+-                return {
+-                    k: normalize(v)
+-                    for k, v in six.iteritems(obj)
+-                }
+-            if isinstance(obj, six.text_type):
+-                return six.text_type(obj)
+-            if isinstance(obj, Iterable):
+-                return [normalize(o) for o in obj]
+-            return obj
+-        return config_status(args=[], **normalize(sanitized_config))
++        return config_status(args=[], **sanitized_config)
+     return 0
+ 
+ 
+ if __name__ == '__main__':
+     sys.exit(main(sys.argv))

+ 84 - 0
mozilla-release/patches/1669633-3-83a1.patch

@@ -0,0 +1,84 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093478 0
+# Node ID 51743cdf9c63cb1bf33794b2435d8dde4f006f49
+# Parent  bda0af22eacc4e3351137fae3f671f5a59406508
+Bug 1669633 - Only use MOZ_ZLIB_LIBS in config/external/zlib/moz.build. r=firefox-build-system-reviewers,rstewart
+
+This simplifies how js gets zlib by simply using the zlib Library
+defined in config/external/zlib instead of manually adding MOZ_ZLIB_LIBS
+that it needs to inherit somehow correctly from the top-level configure.
+
+The use in browser/app was redundant with mozglue depending on zlib
+already.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92720
+
+diff --git a/browser/app/moz.build b/browser/app/moz.build
+--- a/browser/app/moz.build
++++ b/browser/app/moz.build
+@@ -97,19 +97,16 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_
+ # The heap will grow if need be.
+ #
+ # Set it to 256k.  See bug 127069.
+ if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'):
+     LDFLAGS += ['/HEAP:0x40000']
+ 
+ DisableStlWrapping()
+ 
+-if CONFIG['MOZ_LINKER']:
+-    OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
+-
+ if CONFIG['HAVE_CLOCK_MONOTONIC']:
+     OS_LIBS += CONFIG['REALTIME_LIBS']
+ 
+ if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
+     DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
+     COMPILE_FLAGS['OS_CXXFLAGS'] = [
+         f for f in COMPILE_FLAGS.get('OS_CXXFLAGS', [])
+         if not f.startswith('-march=') and f not in ('-msse', '-msse2', '-mfpmath=sse')
+diff --git a/js/src/js-standalone.mozbuild.1669633_3.later b/js/src/js-standalone.mozbuild.1669633_3.later
+new file mode 100644
+--- /dev/null
++++ b/js/src/js-standalone.mozbuild.1669633_3.later
+@@ -0,0 +1,17 @@
++--- js-standalone.mozbuild
+++++ js-standalone.mozbuild
++@@ -3,12 +3,11 @@
++ # 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/.
++ 
++ # These configure options are needed by standalone SpiderMonkey tools. The full
++ # Gecko build performs equivalents elsewhere in its configuration.
++ 
++ USE_LIBS += [
++-    'jsrust'
+++    'jsrust',
+++    'zlib',
++ ]
++-
++-OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
+diff --git a/js/sub.configure b/js/sub.configure
+--- a/js/sub.configure
++++ b/js/sub.configure
+@@ -46,19 +46,16 @@ def js_subconfigure(host, target, build_
+     substs = dict(old_configure.substs)
+     assignments = dict(old_configure_assignments)
+     environ = dict(os.environ)
+ 
+     options = [host, target] +  js_configure_args
+ 
+     options.append('--prefix=%s/dist' % build_env.topobjdir)
+ 
+-    if substs.get('ZLIB_IN_MOZGLUE'):
+-        substs['MOZ_ZLIB_LIBS'] = ''
+-
+     environ['MOZILLA_CENTRAL_PATH'] = build_env.topsrcdir
+     if 'MOZ_BUILD_APP' in environ:
+         del environ['MOZ_BUILD_APP']
+ 
+     # Here, we mimic what we used to do from old-configure, which makes this
+     # all awkward.
+ 
+     # The following variables were saved at the beginning of old-configure,

+ 92 - 0
mozilla-release/patches/1669633-4-83a1.patch

@@ -0,0 +1,92 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093458 0
+# Node ID 0ff51d71f0c088cf21e1eca91e6b50b1c7544f32
+# Parent  9c90c18cb0c0b4f77f1d764c06778a7de9017288
+Bug 1669633 - Remove MOZ_BUILD_ROOT. r=firefox-build-system-reviewers,andi,rstewart
+
+It is only really used in js/src/devtools/rootAnalysis/Makefile.in,
+and even there, the way it is used seems wrong, so fix that at the
+same time (binaries have been linked into $DIST/bin directly for a
+while).
+
+Differential Revision: https://phabricator.services.mozilla.com/D92721
+
+diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -107,26 +107,23 @@ def check_build_environment(help, dist):
+             % ('\n  '.join(conflict_files), topsrcdir)
+             )
+ 
+     return result
+ 
+ 
+ set_config('TOPSRCDIR', check_build_environment.topsrcdir)
+ set_config('TOPOBJDIR', check_build_environment.topobjdir)
+-set_config('MOZ_BUILD_ROOT', check_build_environment.topobjdir)
+ set_config('DIST', check_build_environment.dist)
+ 
+ add_old_configure_assignment(
+     '_topsrcdir', check_build_environment.topsrcdir)
+ add_old_configure_assignment(
+     '_objdir', check_build_environment.topobjdir)
+ add_old_configure_assignment(
+-    'MOZ_BUILD_ROOT', check_build_environment.topobjdir)
+-add_old_configure_assignment(
+     'DIST', check_build_environment.dist)
+ 
+ option(env='MOZ_AUTOMATION', help='Enable options for automated builds')
+ set_config('MOZ_AUTOMATION', depends_if('MOZ_AUTOMATION')(lambda x: True))
+ 
+ 
+ option(env='OLD_CONFIGURE', nargs=1, help='Path to the old configure script')
+ 
+diff --git a/config/makefiles/debugmake.mk b/config/makefiles/debugmake.mk
+--- a/config/makefiles/debugmake.mk
++++ b/config/makefiles/debugmake.mk
+@@ -56,17 +56,16 @@ ifneq (,$(filter $(PROGRAM) $(HOST_PROGR
+ 	@echo --------------------------------------------------------------------------------
+ endif
+ 	$(LOOP_OVER_DIRS)
+ 
+ showbuild showhost: _DEPEND_CFLAGS=
+ showbuild showhost: COMPILE_PDB_FLAG=
+ showbuild:
+ 	$(call print_vars,\
+-		MOZ_BUILD_ROOT \
+ 		MOZ_WIDGET_TOOLKIT \
+ 		CC \
+ 		CXX \
+ 		CCC \
+ 		CPP \
+ 		LD \
+ 		AR \
+ 		IMPLIB \
+diff --git a/js/src/devtools/rootAnalysis/Makefile.in b/js/src/devtools/rootAnalysis/Makefile.in
+--- a/js/src/devtools/rootAnalysis/Makefile.in
++++ b/js/src/devtools/rootAnalysis/Makefile.in
+@@ -10,21 +10,21 @@
+ # plugin, and then do a regular build of whatever portion of the tree you are
+ # analyzing. The plugins will dump out several xdb database files. Various
+ # analysis scripts, written in JS, will run over those database files to
+ # produce the final analysis output.
+ 
+ include $(topsrcdir)/config/config.mk
+ 
+ # Tree to build and analyze, defaulting to the current tree
+-TARGET_JSOBJDIR ?= $(MOZ_BUILD_ROOT)
++TARGET_JSOBJDIR ?= $(TOPOBJDIR)
+ 
+ # Path to a JS binary to use to run the analysis. You really want this to be an
+ # optimized build.
+-JS ?= $(MOZ_BUILD_ROOT)/shell/js
++JS ?= $(DIST)/bin/js
+ 
+ # Path to an xgill checkout containing the GCC plugin, xdb-processing binaries,
+ # and compiler wrapper scripts used to automatically integrate into an existing
+ # build system.
+ SIXGILL ?= @SIXGILL_PATH@
+ 
+ # Path to the JS scripts that will perform the analysis, defaulting to the same
+ # place as this Makefile.in, which is probably what you want.

+ 260 - 0
mozilla-release/patches/1669633-5-83a1.patch

@@ -0,0 +1,260 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602106453 0
+# Node ID 0d3e42d60028f4d43a53b602bcd37f5ddccae95c
+# Parent  e99c6dcb76ee088e3b587dc3069cec57ac24b21b
+Bug 1669633 - Split prepare_configure and move autoconf to old_configure. r=firefox-build-system-reviewers,rstewart
+
+Preparing to run both old-configure and js/src/old-configure from the
+same python configure run, we refactor things such that shared parts are
+separate.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92722
+
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -17,110 +17,37 @@ def prepare_mozconfig(mozconfig):
+         for key, (old, value) in mozconfig['vars']['modified'].items():
+             items[key] = (value, 'modified')
+         for t in ('env', 'vars'):
+             for key in mozconfig[t]['removed'].keys():
+                 items[key] = (None, 'removed ' + t)
+         return items
+ 
+ 
+-@depends('OLD_CONFIGURE', 'MOZILLABUILD', prepare_mozconfig, awk, m4, check_build_environment,
+-         shell, old_configure_assignments, build_project)
+-@imports(_from='__builtin__', _import='open')
+-@imports(_from='__builtin__', _import='print')
+-@imports(_from='__builtin__', _import='sorted')
+-@imports('glob')
+-@imports('itertools')
+-@imports('subprocess')
+-# Import getmtime without overwriting the sandbox os.path.
+-@imports(_from='os.path', _import='getmtime')
+-@imports(_from='os.path', _import='exists')
+-@imports(_from='mozbuild.shellutil', _import='quote')
+-@imports(_from='tempfile', _import='NamedTemporaryFile')
+-@imports(_from='os', _import='environ')
+-@imports(_from='os', _import='remove')
+-@imports(_from='os', _import='rename')
+-@imports(_from='subprocess', _import='CalledProcessError')
+-@imports(_from='__builtin__', _import='OSError')
+-def prepare_configure(old_configure, mozillabuild, mozconfig, awk, m4, build_env, shell,
+-                      old_configure_assignments, build_project):
++@depends('OLD_CONFIGURE', build_project)
++def old_configure(old_configure, build_project):
+     # os.path.abspath in the sandbox will ensure forward slashes on Windows,
+     # which is actually necessary because this path actually ends up literally
+     # as $0, and backslashes there breaks autoconf's detection of the source
+     # directory.
+     old_configure = os.path.abspath(old_configure[0])
+     if build_project == 'js':
+         old_configure_dir = os.path.dirname(old_configure)
+         if not old_configure_dir.endswith('/js/src'):
+             old_configure = os.path.join(old_configure_dir, 'js', 'src',
+                                          os.path.basename(old_configure))
++    return old_configure
+ 
+-    refresh = True
+-    if exists(old_configure):
+-        mtime = getmtime(old_configure)
+-        aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
+-                               '*.m4')
+-        for input in itertools.chain(
+-            (old_configure + '.in',
+-             os.path.join(os.path.dirname(old_configure), 'aclocal.m4')),
+-            glob.iglob(aclocal),
+-        ):
+-            if getmtime(input) > mtime:
+-                break
+-        else:
+-            refresh = False
+-
+-    if refresh:
+-        autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
+-        log.info('Refreshing %s with %s', old_configure, autoconf)
+-        env = dict(environ)
+-        env['M4'] = m4
+-        env['AWK'] = awk
+-        env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
+ 
+-        try:
+-            script = subprocess.check_output([
+-                shell, autoconf,
+-                '--localdir=%s' % os.path.dirname(old_configure),
+-                old_configure + '.in'], env=env)
+-        except CalledProcessError as exc:
+-            # Autoconf on win32 may break due to a bad $PATH.  Let the user know
+-            # their $PATH is suspect.
+-            if mozillabuild:
+-                mozillabuild_path = normsep(mozillabuild[0])
+-                sh_path = normsep(find_program('sh'))
+-                if mozillabuild_path not in sh_path:
+-                    log.warning("The '{}msys/bin' directory is not first in $PATH. "
+-                                "This may cause autoconf to fail. ($PATH is currently "
+-                                "set to: {})".format(mozillabuild_path, environ[
+-                        'PATH']))
+-            die('autoconf exited with return code {}'.format(exc.returncode))
+-
+-        if not script:
+-            die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
+-
+-        # Make old-configure append to config.log, where we put our own log.
+-        # This could be done with a m4 macro, but it's way easier this way
+-        script = script.replace(b'>./config.log', b'>>${CONFIG_LOG=./config.log}')
+-
+-        with NamedTemporaryFile(mode='wb', prefix=os.path.basename(old_configure),
+-                                dir=os.path.dirname(old_configure), delete=False) as fh:
+-            fh.write(script)
+-
+-        try:
+-            rename(fh.name, old_configure)
+-        except OSError:
+-            try:
+-                # Likely the file already existed (on Windows). Retry after removing it.
+-                remove(old_configure)
+-                rename(fh.name, old_configure)
+-            except OSError as e:
+-                die('Failed re-creating old-configure: %s' % e.message)
+-
+-    cmd = [shell, old_configure]
++@depends(prepare_mozconfig, old_configure_assignments)
++@imports(_from='__builtin__', _import='open')
++@imports(_from='__builtin__', _import='print')
++@imports(_from='__builtin__', _import='sorted')
++@imports(_from='mozbuild.shellutil', _import='quote')
++def prepare_configure(mozconfig, old_configure_assignments):
+     with open('old-configure.vars', 'w') as out:
+         log.debug('Injecting the following to old-configure:')
+ 
+         def inject(command):
+             print(command, file=out) # noqa Python 2vs3
+             log.debug('| %s', command)
+ 
+         if mozconfig:
+@@ -132,18 +59,16 @@ def prepare_configure(old_configure, moz
+                 else:
+                     inject("%s=%s # %s" % (key, quote(value), action))
+ 
+             inject('# end of mozconfig values')
+ 
+         for k, v in old_configure_assignments:
+             inject('%s=%s' % (k, quote(v)))
+ 
+-    return cmd
+-
+ 
+ @template
+ def old_configure_options(*options):
+     for opt in options:
+         option(opt, nargs='*', help='Help missing for old configure options')
+ 
+     @dependable
+     def all_options():
+@@ -209,30 +134,101 @@ def prepare_configure_options(host, targ
+         value.format(name)
+         for name, value in zip(all_options, options)
+         if value.origin != 'default'
+     ] + [host, target]
+ 
+     return namespace(options=options, all_options=all_options)
+ 
+ 
+-@depends(prepare_configure, prepare_configure_options, altered_path)
++@depends(prepare_configure, prepare_configure_options, altered_path,
++         check_build_environment, old_configure, 'MOZILLABUILD', awk, m4, shell)
+ @imports(_from='__builtin__', _import='compile')
+ @imports(_from='__builtin__', _import='open')
++@imports(_from='__builtin__', _import='OSError')
++@imports('glob')
++@imports('itertools')
+ @imports('logging')
+ @imports('os')
+ @imports('subprocess')
+ @imports('sys')
+ @imports(_from='mozbuild.shellutil', _import='quote')
+ @imports(_from='mozbuild.shellutil', _import='split')
++@imports(_from='tempfile', _import='NamedTemporaryFile')
++@imports(_from='subprocess', _import='CalledProcessError')
+ @imports(_from='six', _import='exec_')
+ @imports(_from='six', _import='iteritems')
+ @imports(_from='six', _import='string_types')
+-def old_configure(prepare_configure, prepare_configure_options, altered_path):
+-    cmd = prepare_configure + prepare_configure_options.options
++def old_configure(prepare_configure, prepare_configure_options, altered_path, build_env,
++                  old_configure, mozillabuild, awk, m4, shell):
++    # Use prepare_configure to make lint happy
++    prepare_configure
++    refresh = True
++    if os.path.exists(old_configure):
++        mtime = os.path.getmtime(old_configure)
++        aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
++                               '*.m4')
++        for input in itertools.chain(
++            (old_configure + '.in',
++             os.path.join(os.path.dirname(old_configure), 'aclocal.m4')),
++            glob.iglob(aclocal),
++        ):
++            if os.path.getmtime(input) > mtime:
++                break
++        else:
++            refresh = False
++
++    if refresh:
++        autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
++        log.info('Refreshing %s with %s', old_configure, autoconf)
++        env = dict(os.environ)
++        env['M4'] = m4
++        env['AWK'] = awk
++        env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
++
++        try:
++            script = subprocess.check_output([
++                shell, autoconf,
++                '--localdir=%s' % os.path.dirname(old_configure),
++                old_configure + '.in'], env=env)
++        except CalledProcessError as exc:
++            # Autoconf on win32 may break due to a bad $PATH.  Let the user know
++            # their $PATH is suspect.
++            if mozillabuild:
++                mozillabuild_path = normsep(mozillabuild[0])
++                sh_path = normsep(find_program('sh'))
++                if mozillabuild_path not in sh_path:
++                    log.warning("The '{}msys/bin' directory is not first in $PATH. "
++                                "This may cause autoconf to fail. ($PATH is currently "
++                                "set to: {})".format(mozillabuild_path, os.environ[
++                        'PATH']))
++            die('autoconf exited with return code {}'.format(exc.returncode))
++
++        if not script:
++            die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
++
++        # Make old-configure append to config.log, where we put our own log.
++        # This could be done with a m4 macro, but it's way easier this way
++        script = script.replace(b'>./config.log', b'>>${CONFIG_LOG=./config.log}')
++
++        with NamedTemporaryFile(mode='wb', prefix=os.path.basename(old_configure),
++                                dir=os.path.dirname(old_configure), delete=False) as fh:
++            fh.write(script)
++
++        try:
++            os.rename(fh.name, old_configure)
++        except OSError:
++            try:
++                # Likely the file already existed (on Windows). Retry after removing it.
++                os.remove(old_configure)
++                os.rename(fh.name, old_configure)
++            except OSError as e:
++                die('Failed re-creating old-configure: %s' % e.message)
++
++    cmd = [shell, old_configure] + prepare_configure_options.options
+ 
+     env = dict(os.environ)
+ 
+     # For debugging purpose, in case it's not what we'd expect.
+     log.debug('Running %s', quote(*cmd))
+ 
+     # Our logging goes to config.log, the same file old.configure uses.
+     # We can't share the handle on the file, so close it.

+ 337 - 0
mozilla-release/patches/1669633-6-83a1.patch

@@ -0,0 +1,337 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093387 0
+# Node ID c233e3e55972e1d17d65b86285d4eb95f4606c4b
+# Parent  bba7763437884421266e0214cd5dddb5b61aa30f
+Bug 1669633 - Turn old_configure into a template. r=firefox-build-system-reviewers,rstewart
+
+This helps reduce the diff size for subsequent patches.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92723
+
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -134,177 +134,182 @@ def prepare_configure_options(host, targ
+         value.format(name)
+         for name, value in zip(all_options, options)
+         if value.origin != 'default'
+     ] + [host, target]
+ 
+     return namespace(options=options, all_options=all_options)
+ 
+ 
+-@depends(prepare_configure, prepare_configure_options, altered_path,
+-         check_build_environment, old_configure, 'MOZILLABUILD', awk, m4, shell)
+-@imports(_from='__builtin__', _import='compile')
+-@imports(_from='__builtin__', _import='open')
+-@imports(_from='__builtin__', _import='OSError')
+-@imports('glob')
+-@imports('itertools')
+-@imports('logging')
+-@imports('os')
+-@imports('subprocess')
+-@imports('sys')
+-@imports(_from='mozbuild.shellutil', _import='quote')
+-@imports(_from='mozbuild.shellutil', _import='split')
+-@imports(_from='tempfile', _import='NamedTemporaryFile')
+-@imports(_from='subprocess', _import='CalledProcessError')
+-@imports(_from='six', _import='exec_')
+-@imports(_from='six', _import='iteritems')
+-@imports(_from='six', _import='string_types')
+-def old_configure(prepare_configure, prepare_configure_options, altered_path, build_env,
+-                  old_configure, mozillabuild, awk, m4, shell):
+-    # Use prepare_configure to make lint happy
+-    prepare_configure
+-    refresh = True
+-    if os.path.exists(old_configure):
+-        mtime = os.path.getmtime(old_configure)
+-        aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
+-                               '*.m4')
+-        for input in itertools.chain(
+-            (old_configure + '.in',
+-             os.path.join(os.path.dirname(old_configure), 'aclocal.m4')),
+-            glob.iglob(aclocal),
+-        ):
+-            if os.path.getmtime(input) > mtime:
+-                break
+-        else:
+-            refresh = False
++@template
++def old_configure_for(old_configure_path):
++    @depends(prepare_configure, prepare_configure_options, altered_path,
++             check_build_environment, old_configure_path, 'MOZILLABUILD', awk, m4, shell)
++    @imports(_from='__builtin__', _import='compile')
++    @imports(_from='__builtin__', _import='open')
++    @imports(_from='__builtin__', _import='OSError')
++    @imports('glob')
++    @imports('itertools')
++    @imports('logging')
++    @imports('os')
++    @imports('subprocess')
++    @imports('sys')
++    @imports(_from='mozbuild.shellutil', _import='quote')
++    @imports(_from='mozbuild.shellutil', _import='split')
++    @imports(_from='tempfile', _import='NamedTemporaryFile')
++    @imports(_from='subprocess', _import='CalledProcessError')
++    @imports(_from='six', _import='exec_')
++    @imports(_from='six', _import='iteritems')
++    @imports(_from='six', _import='string_types')
++    def old_configure(prepare_configure, prepare_configure_options, altered_path, build_env,
++                      old_configure, mozillabuild, awk, m4, shell):
++        # Use prepare_configure to make lint happy
++        prepare_configure
++        refresh = True
++        if os.path.exists(old_configure):
++            mtime = os.path.getmtime(old_configure)
++            aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
++                                   '*.m4')
++            for input in itertools.chain(
++                (old_configure + '.in',
++                 os.path.join(os.path.dirname(old_configure), 'aclocal.m4')),
++                glob.iglob(aclocal),
++            ):
++                if os.path.getmtime(input) > mtime:
++                    break
++            else:
++                refresh = False
+ 
+-    if refresh:
+-        autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
+-        log.info('Refreshing %s with %s', old_configure, autoconf)
+-        env = dict(os.environ)
+-        env['M4'] = m4
+-        env['AWK'] = awk
+-        env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
++        if refresh:
++            autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
++            log.info('Refreshing %s with %s', old_configure, autoconf)
++            env = dict(os.environ)
++            env['M4'] = m4
++            env['AWK'] = awk
++            env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
+ 
+-        try:
+-            script = subprocess.check_output([
+-                shell, autoconf,
+-                '--localdir=%s' % os.path.dirname(old_configure),
+-                old_configure + '.in'], env=env)
+-        except CalledProcessError as exc:
+-            # Autoconf on win32 may break due to a bad $PATH.  Let the user know
+-            # their $PATH is suspect.
+-            if mozillabuild:
+-                mozillabuild_path = normsep(mozillabuild[0])
+-                sh_path = normsep(find_program('sh'))
+-                if mozillabuild_path not in sh_path:
+-                    log.warning("The '{}msys/bin' directory is not first in $PATH. "
+-                                "This may cause autoconf to fail. ($PATH is currently "
+-                                "set to: {})".format(mozillabuild_path, os.environ[
+-                        'PATH']))
+-            die('autoconf exited with return code {}'.format(exc.returncode))
++            try:
++                script = subprocess.check_output([
++                    shell, autoconf,
++                    '--localdir=%s' % os.path.dirname(old_configure),
++                    old_configure + '.in'], env=env)
++            except CalledProcessError as exc:
++                # Autoconf on win32 may break due to a bad $PATH.  Let the user know
++                # their $PATH is suspect.
++                if mozillabuild:
++                    mozillabuild_path = normsep(mozillabuild[0])
++                    sh_path = normsep(find_program('sh'))
++                    if mozillabuild_path not in sh_path:
++                        log.warning("The '{}msys/bin' directory is not first in $PATH. "
++                                    "This may cause autoconf to fail. ($PATH is currently "
++                                    "set to: {})".format(mozillabuild_path, os.environ[
++                            'PATH']))
++                die('autoconf exited with return code {}'.format(exc.returncode))
+ 
+-        if not script:
+-            die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
+-
+-        # Make old-configure append to config.log, where we put our own log.
+-        # This could be done with a m4 macro, but it's way easier this way
+-        script = script.replace(b'>./config.log', b'>>${CONFIG_LOG=./config.log}')
++            if not script:
++                die('Generated old-configure is empty! Check that your autoconf 2.13 program works!')
+ 
+-        with NamedTemporaryFile(mode='wb', prefix=os.path.basename(old_configure),
+-                                dir=os.path.dirname(old_configure), delete=False) as fh:
+-            fh.write(script)
++            # Make old-configure append to config.log, where we put our own log.
++            # This could be done with a m4 macro, but it's way easier this way
++            script = script.replace(b'>./config.log', b'>>${CONFIG_LOG=./config.log}')
+ 
+-        try:
+-            os.rename(fh.name, old_configure)
+-        except OSError:
++            with NamedTemporaryFile(mode='wb', prefix=os.path.basename(old_configure),
++                                    dir=os.path.dirname(old_configure), delete=False) as fh:
++                fh.write(script)
++
+             try:
+-                # Likely the file already existed (on Windows). Retry after removing it.
+-                os.remove(old_configure)
+                 os.rename(fh.name, old_configure)
+-            except OSError as e:
+-                die('Failed re-creating old-configure: %s' % e.message)
++            except OSError:
++                try:
++                    # Likely the file already existed (on Windows). Retry after removing it.
++                    os.remove(old_configure)
++                    os.rename(fh.name, old_configure)
++                except OSError as e:
++                    die('Failed re-creating old-configure: %s' % e.message)
+ 
+-    cmd = [shell, old_configure] + prepare_configure_options.options
++        cmd = [shell, old_configure] + prepare_configure_options.options
+ 
+-    env = dict(os.environ)
++        env = dict(os.environ)
+ 
+-    # For debugging purpose, in case it's not what we'd expect.
+-    log.debug('Running %s', quote(*cmd))
++        # For debugging purpose, in case it's not what we'd expect.
++        log.debug('Running %s', quote(*cmd))
+ 
+-    # Our logging goes to config.log, the same file old.configure uses.
+-    # We can't share the handle on the file, so close it.
+-    logger = logging.getLogger('moz.configure')
+-    config_log = None
+-    for handler in logger.handlers:
+-        if isinstance(handler, logging.FileHandler):
+-            config_log = handler
+-            config_log.close()
+-            logger.removeHandler(config_log)
+-            env['CONFIG_LOG'] = config_log.baseFilename
+-            log_size = os.path.getsize(config_log.baseFilename)
+-            break
++        # Our logging goes to config.log, the same file old.configure uses.
++        # We can't share the handle on the file, so close it.
++        logger = logging.getLogger('moz.configure')
++        config_log = None
++        for handler in logger.handlers:
++            if isinstance(handler, logging.FileHandler):
++                config_log = handler
++                config_log.close()
++                logger.removeHandler(config_log)
++                env['CONFIG_LOG'] = config_log.baseFilename
++                log_size = os.path.getsize(config_log.baseFilename)
++                break
+ 
+-    if altered_path:
+-        env['PATH'] = altered_path
+-
+-    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
++        if altered_path:
++            env['PATH'] = altered_path
+ 
+-    while True:
+-        line = proc.stdout.readline()
+-        if not line:
+-            break
+-        log.info(line.rstrip())
++        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
++                                env=env)
++        while True:
++            line = proc.stdout.readline()
++            if not line:
++                break
++            log.info(line.rstrip())
+ 
+-    ret = proc.wait()
+-    if ret:
+-        with log.queue_debug():
+-            if config_log:
+-                with open(config_log.baseFilename, 'r') as fh:
+-                    fh.seek(log_size)
+-                    for line in fh:
+-                        log.debug(line.rstrip())
+-            log.error('old-configure failed')
+-        sys.exit(ret)
++        ret = proc.wait()
++        if ret:
++            with log.queue_debug():
++                if config_log:
++                    with open(config_log.baseFilename, 'r') as fh:
++                        fh.seek(log_size)
++                        for line in fh:
++                            log.debug(line.rstrip())
++                log.error('old-configure failed')
++            sys.exit(ret)
+ 
+-    if config_log:
+-        # Create a new handler in append mode
+-        handler = logging.FileHandler(config_log.baseFilename, mode='a', delay=True)
+-        handler.setFormatter(config_log.formatter)
+-        logger.addHandler(handler)
++        if config_log:
++            # Create a new handler in append mode
++            handler = logging.FileHandler(config_log.baseFilename, mode='a', delay=True)
++            handler.setFormatter(config_log.formatter)
++            logger.addHandler(handler)
+ 
+-    raw_config = {
+-        'split': split,
+-        'unique_list': unique_list,
+-    }
+-    with open('config.data', 'r') as fh:
+-        code = compile(fh.read(), 'config.data', 'exec')
+-        exec_(code, raw_config)
++        raw_config = {
++            'split': split,
++            'unique_list': unique_list,
++        }
++        with open('config.data', 'r') as fh:
++            code = compile(fh.read(), 'config.data', 'exec')
++            exec_(code, raw_config)
+ 
+-    # Ensure all the flags known to old-configure appear in the
+-    # @old_configure_options above.
+-    all_options = set(prepare_configure_options.all_options)
+-    for flag in raw_config['flags']:
+-        if flag not in all_options:
+-            die('Missing option in `@old_configure_options` in %s: %s',
+-                __file__, flag)
++        # Ensure all the flags known to old-configure appear in the
++        # @old_configure_options above.
++        all_options = set(prepare_configure_options.all_options)
++        for flag in raw_config['flags']:
++            if flag not in all_options:
++                die('Missing option in `@old_configure_options` in %s: %s',
++                    __file__, flag)
+ 
+-    # If the code execution above fails, we want to keep the file around for
+-    # debugging.
+-    os.remove('config.data')
++        # If the code execution above fails, we want to keep the file around for
++        # debugging.
++        os.remove('config.data')
+ 
+-    return namespace(**{
+-        c: [
+-            (k[1:-1], v[1:-1] if isinstance(v, string_types) else v)
+-            for k, v in raw_config[c]
+-        ]
+-        for c in ('substs', 'defines')
+-    })
++        return namespace(**{
++            c: [
++                (k[1:-1], v[1:-1] if isinstance(v, string_types) else v)
++                for k, v in raw_config[c]
++            ]
++            for c in ('substs', 'defines')
++        })
++
++    return old_configure
+ 
+ 
++old_configure = old_configure_for(old_configure)
+ set_config('OLD_CONFIGURE_SUBSTS', old_configure.substs)
+ set_config('OLD_CONFIGURE_DEFINES', old_configure.defines)
+ 
+ 
+ # Assuming no other option is declared after this function, handle the
+ # env options that were injected by mozconfig_options by creating dummy
+ # Option instances and having the sandbox's CommandLineHelper handle
+ # them. We only do so for options that haven't been declared so far,

+ 33 - 0
mozilla-release/patches/1669633-7-83a1.patch

@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602093372 0
+# Node ID 70d4c79579581b4a7566a9ef268b54dd432228bf
+# Parent  c429f519f4afdc0938f546e163944c1564f6e6c6
+Bug 1669633 - Don't pass --prefix to the js subconfigure. r=firefox-build-system-reviewers,andi,rstewart
+
+That hasn't actually been necessary for a very long time.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92724
+
+diff --git a/js/sub.configure b/js/sub.configure
+--- a/js/sub.configure
++++ b/js/sub.configure
+@@ -44,18 +44,16 @@ def js_subconfigure(host, target, build_
+             handler._stdout = PrefixOutput('js/src> ', handler._stdout)
+ 
+     substs = dict(old_configure.substs)
+     assignments = dict(old_configure_assignments)
+     environ = dict(os.environ)
+ 
+     options = [host, target] +  js_configure_args
+ 
+-    options.append('--prefix=%s/dist' % build_env.topobjdir)
+-
+     environ['MOZILLA_CENTRAL_PATH'] = build_env.topsrcdir
+     if 'MOZ_BUILD_APP' in environ:
+         del environ['MOZ_BUILD_APP']
+ 
+     # Here, we mimic what we used to do from old-configure, which makes this
+     # all awkward.
+ 
+     # The following variables were saved at the beginning of old-configure,

+ 519 - 0
mozilla-release/patches/1669633-8-83a1.patch

@@ -0,0 +1,519 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602105199 0
+# Node ID 8b4ab5dd44467f812d7fd59b1b837b1a7a4bb20b
+# Parent  c2aad101ad992c7e0b62c116dcdb19e1bb8d037a
+Bug 1669633 - Don't recurse into js/src for the python-part of configure. r=firefox-build-system-reviewers,rstewart
+
+Instead, we now run js/src/old-configure from the top-level configure
+after having run old-configure and extracted a few variables to inherit
+from it.
+
+Because we're now running from the top-level, $_objdir is always the
+top-level objdir, which simplifies some things. The topobjdir in
+js/src/config.status, however, needs to stay in js/src because of the
+build frontend expecting it there.
+
+When running js/src/old-configure, we used to need some special
+treatment for a large number of variables for historic reasons, where
+we'd take values from the assigned values before running old-configure
+for some, or from AC_SUBSTs after running old-configure.
+
+Now that both old-configure and js/src/old-configure get the same
+assignments from old-configure.vars, we don't need anything special for
+the former. And only a few remaining variables still need manual work
+for the latter.
+
+One notable difference, though, is that the new code doesn't try to
+avoid running js subconfigure, which added complexity, and was actually
+error-prone.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92725
+
+diff --git a/build/autoconf/altoptions.m4 b/build/autoconf/altoptions.m4
+--- a/build/autoconf/altoptions.m4
++++ b/build/autoconf/altoptions.m4
+@@ -68,10 +68,10 @@ AC_DEFUN([MOZ_ARG_WITH_STRING],
+ 
+ dnl MOZ_ARG_HEADER(Comment)
+ dnl This is used by webconfig to group options
+ define(MOZ_ARG_HEADER, [# $1])
+ 
+ dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
+ AC_DEFUN([MOZ_READ_MOZCONFIG],
+ [AC_REQUIRE([AC_INIT_BINSH])dnl
+-. ./old-configure.vars
++. $OLD_CONFIGURE_VARS
+ ])
+diff --git a/build/autoconf/clang-plugin.m4 b/build/autoconf/clang-plugin.m4
+--- a/build/autoconf/clang-plugin.m4
++++ b/build/autoconf/clang-plugin.m4
+@@ -162,26 +162,22 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
+     AC_DEFINE(MOZ_CLANG_PLUGIN)
+ fi
+ 
+ if test -n "$ENABLE_MOZSEARCH_PLUGIN"; then
+     if test -z "${ENABLE_CLANG_PLUGIN}"; then
+         AC_MSG_ERROR([Can't use mozsearch plugin without --enable-clang-plugin.])
+     fi
+ 
+-    dnl We use this construct rather than $_objdir to avoid getting /js/src in the
+-    dnl path when compiling JS code.
+-    OBJDIR="$(dirname $(dirname $(dirname $CLANG_PLUGIN)))"
+-
+     CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -add-plugin -Xclang mozsearch-index"
+ 
+     dnl Parameters are: srcdir, outdir (path where output JSON is stored), objdir.
+     CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_topsrcdir"
+-    CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $OBJDIR/mozsearch_index"
+-    CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $OBJDIR"
++    CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_objdir/mozsearch_index"
++    CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_objdir"
+ 
+     AC_DEFINE(MOZ_MOZSEARCH_PLUGIN)
+ fi
+ 
+ AC_SUBST_LIST(CLANG_PLUGIN_FLAGS)
+ AC_SUBST_LIST(LLVM_CXXFLAGS)
+ AC_SUBST_LIST(LLVM_LDFLAGS)
+ AC_SUBST_LIST(CLANG_LDFLAGS)
+diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -135,18 +135,21 @@ def prepare_configure_options(host, targ
+         for name, value in zip(all_options, options)
+         if value.origin != 'default'
+     ] + [host, target]
+ 
+     return namespace(options=options, all_options=all_options)
+ 
+ 
+ @template
+-def old_configure_for(old_configure_path):
+-    @depends(prepare_configure, prepare_configure_options, altered_path,
++def old_configure_for(old_configure_path, extra_env=None):
++    if extra_env is None:
++        extra_env = dependable(None)
++
++    @depends(prepare_configure, prepare_configure_options, altered_path, extra_env,
+              check_build_environment, old_configure_path, 'MOZILLABUILD', awk, m4, shell)
+     @imports(_from='__builtin__', _import='compile')
+     @imports(_from='__builtin__', _import='open')
+     @imports(_from='__builtin__', _import='OSError')
+     @imports('glob')
+     @imports('itertools')
+     @imports('logging')
+     @imports('os')
+@@ -154,18 +157,18 @@ def old_configure_for(old_configure_path
+     @imports('sys')
+     @imports(_from='mozbuild.shellutil', _import='quote')
+     @imports(_from='mozbuild.shellutil', _import='split')
+     @imports(_from='tempfile', _import='NamedTemporaryFile')
+     @imports(_from='subprocess', _import='CalledProcessError')
+     @imports(_from='six', _import='exec_')
+     @imports(_from='six', _import='iteritems')
+     @imports(_from='six', _import='string_types')
+-    def old_configure(prepare_configure, prepare_configure_options, altered_path, build_env,
+-                      old_configure, mozillabuild, awk, m4, shell):
++    def old_configure(prepare_configure, prepare_configure_options, altered_path, extra_env,
++                      build_env, old_configure, mozillabuild, awk, m4, shell):
+         # Use prepare_configure to make lint happy
+         prepare_configure
+         refresh = True
+         if os.path.exists(old_configure):
+             mtime = os.path.getmtime(old_configure)
+             aclocal = os.path.join(build_env.topsrcdir, 'build', 'autoconf',
+                                    '*.m4')
+             for input in itertools.chain(
+@@ -243,16 +246,20 @@ def old_configure_for(old_configure_path
+                 logger.removeHandler(config_log)
+                 env['CONFIG_LOG'] = config_log.baseFilename
+                 log_size = os.path.getsize(config_log.baseFilename)
+                 break
+ 
+         if altered_path:
+             env['PATH'] = altered_path
+ 
++        if extra_env:
++            env.update(extra_env)
++
++        env['OLD_CONFIGURE_VARS'] = os.path.join(build_env.topobjdir, 'old-configure.vars')
+         proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+                                 env=env)
+         while True:
+             line = proc.stdout.readline()
+             if not line:
+                 break
+             log.info(line.rstrip())
+ 
+diff --git a/configure.py b/configure.py
+--- a/configure.py
++++ b/configure.py
+@@ -1,15 +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 codecs
++import errno
+ import io
+ import itertools
+ import logging
+ import os
+ import sys
+ import textwrap
+ 
+ 
+@@ -44,16 +45,41 @@ def main(argv):
+     if os.environ.get('MOZ_CONFIGURE_TRACE'):
+         sandbox._logger.setLevel(TRACE)
+ 
+     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
+ 
+     if sandbox._help:
+         return 0
+ 
++    logging.getLogger('moz.configure').info('Creating config.status')
++
++    old_js_configure_substs = config.pop('OLD_JS_CONFIGURE_SUBSTS', None)
++    old_js_configure_defines = config.pop('OLD_JS_CONFIGURE_DEFINES', None)
++    if old_js_configure_substs or old_js_configure_defines:
++        js_config = config.copy()
++        pwd = os.getcwd()
++        try:
++            try:
++                os.makedirs('js/src')
++            except OSError as e:
++                if e.errno != errno.EEXIST:
++                    raise
++
++            os.chdir('js/src')
++            js_config['OLD_CONFIGURE_SUBSTS'] = old_js_configure_substs
++            js_config['OLD_CONFIGURE_DEFINES'] = old_js_configure_defines
++            # The build system frontend expects $objdir/js/src/config.status
++            # to have $objdir/js/src as topobjdir.
++            # We want forward slashes on all platforms.
++            js_config['TOPOBJDIR'] += '/js/src'
++            config_status(js_config, execute=False)
++        finally:
++            os.chdir(pwd)
++
+     return config_status(config)
+ 
+ 
+ def check_unicode(obj):
+     '''Recursively check that all strings in the object are unicode strings.'''
+     if isinstance(obj, dict):
+         result = True
+         for k, v in six.iteritems(obj):
+@@ -68,17 +94,17 @@ def check_unicode(obj):
+         return False
+     if isinstance(obj, six.text_type):
+         return True
+     if isinstance(obj, Iterable):
+         return all(check_unicode(o) for o in obj)
+     return True
+ 
+ 
+-def config_status(config):
++def config_status(config, execute=True):
+     # Sanitize config data to feed config.status
+     # Ideally, all the backend and frontend code would handle the booleans, but
+     # there are so many things involved, that it's easier to keep config.status
+     # untouched for now.
+     def sanitize_config(v):
+         if v is True:
+             return '1'
+         if v is False:
+@@ -128,30 +154,29 @@ def config_status(config):
+             return [normalize(o) for o in obj]
+         return obj
+ 
+     sanitized_config = normalize(sanitized_config)
+ 
+     # Create config.status. Eventually, we'll want to just do the work it does
+     # here, when we're able to skip configure tests/use cached results/not rely
+     # on autoconf.
+-    logging.getLogger('moz.configure').info('Creating config.status')
+     with codecs.open('config.status', 'w', 'utf-8') as fh:
+         fh.write(textwrap.dedent('''\
+             #!%(python)s
+             # coding=utf-8
+             from __future__ import unicode_literals
+         ''') % {'python': config['PYTHON3']})
+         for k, v in six.iteritems(sanitized_config):
+             fh.write('%s = ' % k)
+             write_indented_repr(fh, v)
+         fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
+                  "'substs', 'mozconfig']")
+ 
+-        if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
++        if execute:
+             fh.write(textwrap.dedent('''
+                 if __name__ == '__main__':
+                     from mozbuild.util import patch_main
+                     patch_main()
+                     from mozbuild.config_status import config_status
+                     args = dict([(name, globals()[name]) for name in __all__])
+                     config_status(**args)
+             '''))
+@@ -166,16 +191,16 @@ def config_status(config):
+         for f in itertools.chain(config['CONFIG_STATUS_DEPS'],
+                                  iter_modules_in_path(config['TOPOBJDIR'],
+                                                       config['TOPSRCDIR'])):
+             fh.write('%s\n' % mozpath.normpath(f))
+ 
+     # Other things than us are going to run this file, so we need to give it
+     # executable permissions.
+     os.chmod('config.status', 0o755)
+-    if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
++    if execute:
+         from mozbuild.config_status import config_status
+         return config_status(args=[], **sanitized_config)
+     return 0
+ 
+ 
+ if __name__ == '__main__':
+     sys.exit(main(sys.argv))
+diff --git a/js/moz.configure b/js/moz.configure
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -384,23 +384,18 @@ js_option('--enable-ctypes',
+           default=ctypes_default,
+           help='{Enable|Disable} js-ctypes')
+ 
+ build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
+ 
+ set_config('BUILD_CTYPES', build_ctypes)
+ set_define('BUILD_CTYPES', build_ctypes)
+ 
+-@depends(build_ctypes, building_js)
+-def js_has_ctypes(ctypes, js):
+-    if ctypes and js:
+-        return True
+-
+-set_config('JS_HAS_CTYPES', js_has_ctypes)
+-set_define('JS_HAS_CTYPES', js_has_ctypes)
++set_config('JS_HAS_CTYPES', build_ctypes)
++set_define('JS_HAS_CTYPES', build_ctypes)
+ 
+ @depends('--enable-ctypes', '--enable-compile-environment')
+ def ctypes_and_compile_environment(ctypes, compile_environment):
+     return ctypes and compile_environment
+ 
+ include('ffi.configure', when=ctypes_and_compile_environment)
+ 
+ 
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -59,21 +59,17 @@ USE_PTHREADS=
+ 
+ LDFLAGS="$LDFLAGS $LINKER_LDFLAGS"
+ 
+ if test -z "$JS_STANDALONE"; then
+   autoconfmk=autoconf-js.mk
+ fi
+ AC_SUBST(autoconfmk)
+ 
+-if test -n "$JS_STANDALONE"; then
+-  jsconfdefs=$_objdir/js/src/js-confdefs.h
+-else
+-  jsconfdefs=$_objdir/js-confdefs.h
+-fi
++jsconfdefs=$_objdir/js/src/js-confdefs.h
+ 
+ MOZ_ANDROID_NDK
+ 
+ dnl ========================================================
+ dnl Checks for compilers.
+ dnl ========================================================
+ 
+ if test "$COMPILE_ENVIRONMENT"; then
+diff --git a/js/sub.configure b/js/sub.configure
+--- a/js/sub.configure
++++ b/js/sub.configure
+@@ -1,29 +1,17 @@
+ # 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/.
+ 
+-@depends(host_for_sub_configure, target_for_sub_configure, check_build_environment,
+-         js_configure_args, prepare_mozconfig, old_configure,
+-         old_configure_assignments, '--cache-file')
+-@imports('errno')
++@depends(check_build_environment)
+ @imports('logging')
+-@imports('os')
+-@imports('pickle')
+-@imports('sys')
+-@imports(_from='__main__', _import='config_status')
+-@imports(_from='__builtin__', _import='OSError')
+-@imports(_from='__builtin__', _import='open')
+ @imports(_from='__builtin__', _import='object')
+-@imports(_from='mozbuild.configure', _import='ConfigureSandbox')
+ @imports(_from='mozbuild.configure.util', _import='ConfigureOutputHandler')
+-def js_subconfigure(host, target, build_env, js_configure_args, mozconfig,
+-                    old_configure, old_configure_assignments, cache_file):
+-
++def old_js_configure(build_env):
+     class PrefixOutput(object):
+         def __init__(self, prefix, fh):
+             self._fh = fh
+             self._begin_line = True
+             self._prefix = prefix
+ 
+         def write(self, content):
+             if self._begin_line:
+@@ -37,129 +25,58 @@ def js_subconfigure(host, target, build_
+             self._fh.flush()
+ 
+     logger = logging.getLogger('moz.configure')
+     formatter = logging.Formatter('js/src> %(levelname)s: %(message)s')
+     for handler in logger.handlers:
+         handler.setFormatter(formatter)
+         if isinstance(handler, ConfigureOutputHandler):
+             handler._stdout = PrefixOutput('js/src> ', handler._stdout)
++    return os.path.join(build_env.topsrcdir, 'js', 'src', 'old-configure')
+ 
+-    substs = dict(old_configure.substs)
+-    assignments = dict(old_configure_assignments)
+-    environ = dict(os.environ)
+ 
+-    options = [host, target] +  js_configure_args
+-
+-    environ['MOZILLA_CENTRAL_PATH'] = build_env.topsrcdir
+-    if 'MOZ_BUILD_APP' in environ:
+-        del environ['MOZ_BUILD_APP']
+-
++@depends(old_configure.substs, mozconfig)
++def old_js_configure_env(substs, mozconfig):
++    substs = dict(substs)
+     # Here, we mimic what we used to do from old-configure, which makes this
+     # all awkward.
+ 
+-    # The following variables were saved at the beginning of old-configure,
+-    # and restored before invoking the subconfigure. Which means their value
+-    # should be taken from the old_configure_assignments or mozconfig.
+-    from_assignment = set(
+-        ('CC', 'CXX', 'CPPFLAGS', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'HOST_CC',
+-         'HOST_CXXFLAGS', 'HOST_LDFLAGS'))
+-
+     # Variables that were explicitly exported from old-configure, and those
+     # explicitly set in the environment when invoking old-configure, were
+     # automatically inherited from subconfigure. We assume the relevant ones
+     # have a corresponding AC_SUBST in old-configure, making them available
+     # in `substs`.
++    extra_env = {}
++
+     for var in (
+-        'MOZ_SYSTEM_ZLIB', 'MOZ_ZLIB_CFLAGS', 'MOZ_ZLIB_LIBS',
+-        'MOZ_DEV_EDITION', 'STLPORT_LIBS', 'DIST', 'MOZ_LINKER',
+-        'ZLIB_IN_MOZGLUE', 'RANLIB', 'AR', 'CPP', 'CC', 'CXX', 'CPPFLAGS',
+-        'CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'HOST_CC', 'HOST_CXX', 'HOST_CPPFLAGS',
+-        'HOST_CXXFLAGS', 'HOST_LDFLAGS'
++        'MOZ_DEV_EDITION', 'STLPORT_LIBS', 'MOZ_LINKER', 'ZLIB_IN_MOZGLUE',
++        'RANLIB',
+     ):
+-        if var not in from_assignment and var in substs:
++        if var in substs:
+             value = substs[var]
+-        elif var in assignments:
+-            value = assignments[var]
+         elif mozconfig and var in mozconfig and \
+                 not mozconfig[var][1].startswith('removed'):
+             value = mozconfig[var][0]
+         else:
+             continue
+         if isinstance(value, list):
+             value = ' '.join(value)
+-        environ[var] = value
+-
+-    options.append('JS_STANDALONE=')
+-
+-    srcdir = os.path.join(build_env.topsrcdir, 'js', 'src')
+-    objdir = os.path.join(build_env.topobjdir, 'js', 'src')
++        extra_env[var] = value
+ 
+-    data_file = os.path.join(objdir, 'configure.pkl')
+-    previous_args = None
+-    if os.path.exists(data_file):
+-        with open(data_file, 'rb') as f:
+-            previous_args = pickle.load(f)
+-
+-    cache_file = cache_file or './config.cache'
+-    cache_file = os.path.join(build_env.topobjdir, cache_file)
+-
+-    try:
+-        os.makedirs(objdir)
+-    except OSError as e:
+-        if e.errno != errno.EEXIST:
+-            raise
+-
+-    with open(data_file, 'wb') as f:
+-        pickle.dump(options, f)
++    return extra_env
+ 
+-    # Only run configure if one of the following is true:
+-    # - config.status doesn't exist
+-    # - config.status is older than an input to configure
+-    # - the configure arguments changed
+-    configure = os.path.join(srcdir, 'old-configure')
+-    config_status_path = os.path.join(objdir, 'config.status')
+-    skip_configure = True
+-    if not os.path.exists(config_status_path):
+-        skip_configure = False
+-    else:
+-        config_status_deps = os.path.join(objdir, 'config_status_deps.in')
+-        if not os.path.exists(config_status_deps):
+-            skip_configure = False
+-        else:
+-            with open(config_status_deps, 'r') as fh:
+-                dep_files = fh.read().splitlines() + [configure]
+-            if (any(not os.path.exists(f) or
+-                    (os.path.getmtime(config_status_path) < os.path.getmtime(f))
+-                    for f in dep_files) or
+-                ((previous_args or options) != options)):
+-                skip_configure = False
++old_js_configure = old_configure_for(old_js_configure, extra_env=old_js_configure_env)
++set_config('OLD_JS_CONFIGURE_SUBSTS', old_js_configure.substs)
++set_config('OLD_JS_CONFIGURE_DEFINES', old_js_configure.defines)
++
+ 
+-    ret = 0
+-    if not skip_configure:
+-        oldpwd = os.getcwd()
+-        os.chdir(objdir)
+-        command = [
+-            os.path.join(build_env.topsrcdir, 'configure.py'),
+-            '--enable-project=js',
+-        ]
+-        environ['OLD_CONFIGURE'] = os.path.join(
+-            os.path.dirname(configure), 'old-configure')
+-        command += options
+-        command += ['--cache-file=%s' % cache_file]
+-
+-        log.info('configuring')
+-        log.info('running %s' % ' '.join(command[:-1]))
+-        config = {}
+-        sandbox = ConfigureSandbox(config, environ, command, logger=logger)
+-        sandbox.run(os.path.join(build_env.topsrcdir, 'moz.configure'))
+-        ret = config_status(config)
+-        os.chdir(oldpwd)
+-
++@dependable
++@imports('logging')
++@imports(_from='mozbuild.configure.util', _import='ConfigureOutputHandler')
++def post_old_js_configure():
+     # Restore unprefixed logging.
+     formatter = logging.Formatter('%(levelname)s: %(message)s')
++    logger = logging.getLogger('moz.configure')
+     for handler in logger.handlers:
+         handler.setFormatter(formatter)
+         if isinstance(handler, ConfigureOutputHandler):
+             handler._stdout.flush()
+             handler._stdout = handler._stdout._fh
+-
+-    return ret

+ 192 - 0
mozilla-release/patches/1669633-9-83a1.patch

@@ -0,0 +1,192 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1602092886 0
+# Node ID b0b0edc7fde099e5a97caccb287c2677da206715
+# Parent  8b003101e8e6c037fd80c7aeef022e5277a28912
+Bug 1669633 - Remove the JS_STANDALONE option. r=firefox-build-system-reviewers,rstewart
+
+It was only meant to be used internally, when the top-level python
+configure invoked the js python subconfigure. Now that this doesn't
+happen, we can remove the option, and consolidate js_standalone and
+building_js, which are now roughly synonyms.
+
+Differential Revision: https://phabricator.services.mozilla.com/D92726
+
+diff --git a/build/moz.configure/nspr.configure b/build/moz.configure/nspr.configure
+--- a/build/moz.configure/nspr.configure
++++ b/build/moz.configure/nspr.configure
+@@ -1,49 +1,49 @@
+ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+ # vim: set filetype=python:
+ # 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/.
+ 
+ # Top-level configure defaults to building NSPR from source. Standalone JS
+ # doesn't.
+-js_option('--enable-nspr-build', when=building_js,
++js_option('--enable-nspr-build', when=js_standalone,
+           help='{Build|Do not build} NSPR from source tree')
+ 
+-@depends('--enable-nspr-build', when=building_js)
++@depends('--enable-nspr-build', when=js_standalone)
+ def enable_nspr_build(enable):
+     if enable:
+         return enable
+ 
+ js_option('--with-system-nspr', help='Use system NSPR')
+ 
+-@depends(enable_nspr_build, '--with-system-nspr', 'JS_STANDALONE')
++@depends(enable_nspr_build, '--with-system-nspr', js_standalone)
+ def build_nspr(nspr_build, system_nspr, js_standalone):
+     if nspr_build is not None and nspr_build.origin != 'default':
+         if nspr_build and system_nspr:
+             die('Cannot use both --enable-nspr-build and --with-system-nspr')
+     if js_standalone:
+         return nspr_build
+     return not system_nspr
+ 
+ set_config('MOZ_BUILD_NSPR', True, when=build_nspr)
+ set_config('MOZ_SYSTEM_NSPR', True, when='--with-system-nspr')
+ 
+-@depends(build_nspr, '--with-system-nspr', building_js)
+-def js_without_nspr(build_nspr, system_nspr, building_js):
+-    if building_js:
++@depends(build_nspr, '--with-system-nspr', js_standalone)
++def js_without_nspr(build_nspr, system_nspr, js_standalone):
++    if js_standalone:
+         return not build_nspr and not system_nspr
+ 
+ set_config('JS_WITHOUT_NSPR', True, when=js_without_nspr)
+ set_define('JS_WITHOUT_NSPR', True, when=js_without_nspr)
+ 
+-@depends(building_js)
+-def nspr_minver(building_js):
+-    if building_js:
++@depends(js_standalone)
++def nspr_minver(js_standalone):
++    if js_standalone:
+         return 'nspr >= 4.10'
+     return 'nspr >= 4.25'
+ 
+ nspr_pkg = pkg_check_modules('NSPR', nspr_minver, when='--with-system-nspr')
+ 
+ @depends_if(nspr_pkg)
+ def nspr_pkg(nspr_pkg):
+     def extract(prefix, list):
+diff --git a/js/moz.configure b/js/moz.configure
+--- a/js/moz.configure
++++ b/js/moz.configure
+@@ -3,60 +3,50 @@
+ # 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/.
+ 
+ # /!\ Use js_option() instead of option() in this file. /!\
+ # =========================================================
+ 
+ @depends(build_project)
+-def building_js(build_project):
+-    return build_project == 'js'
+-
+-# Exception to the rule above: JS_STANDALONE is a special option that doesn't
+-# want the js_option treatment. When we're done merging js/src/configure and
+-# top-level configure, it can go away, although the JS_STANDALONE config
+-# will still need to be set depending on building_js above.
+-option(env='JS_STANDALONE', default=building_js,
+-       help='Reserved for internal use')
++def js_standalone(build_project):
++    if build_project == 'js':
++        return True
+ 
+ # Branding
+ # ==============================================================
+ js_option('--with-app-name', env='MOZ_APP_NAME', nargs=1,
+           help='Used for e.g. the binary program file name. If not set, '
+           'defaults to a lowercase form of MOZ_APP_BASENAME.')
+ 
+-@depends('--with-app-name', 'JS_STANDALONE', moz_app_basename)
++@depends('--with-app-name', js_standalone, moz_app_basename)
+ def moz_app_name(value, js_standalone, moz_app_basename):
+     if value:
+         return value[0]
+     if js_standalone:
+         return 'js'
+     return moz_app_basename.lower()
+ 
+ set_config('MOZ_APP_NAME', moz_app_name)
+ 
+ include('../build/moz.configure/nspr.configure',
+         when='--enable-compile-environment')
+ include('../build/moz.configure/rust.configure',
+         when='--enable-compile-environment')
+ include('../build/moz.configure/bindgen.configure',
+         when='--enable-compile-environment')
+ 
+-@depends('JS_STANDALONE')
+-def js_standalone(value):
+-    if value:
+-        return True
+ set_config('JS_STANDALONE', js_standalone)
+ set_define('JS_STANDALONE', js_standalone)
+ add_old_configure_assignment('JS_STANDALONE', js_standalone)
+-js_option('--disable-js-shell', default=building_js,
++js_option('--enable-js-shell', default=js_standalone,
+           help='{Build|Do not build} the JS shell')
+ 
+-@depends('--disable-js-shell')
++@depends('--enable-js-shell')
+ def js_disable_shell(value):
+     if not value:
+         return True
+ 
+ set_config('JS_DISABLE_SHELL', js_disable_shell)
+ 
+ set_define('JS_64BIT', depends(target)(lambda t: t.bitness == 64 or None))
+ 
+@@ -371,19 +361,19 @@ def more_deterministic(value):
+     if value:
+         return True
+ 
+ set_define('JS_MORE_DETERMINISTIC', more_deterministic)
+ 
+ 
+ # CTypes
+ # =======================================================
+-@depends(building_js)
+-def ctypes_default(building_js):
+-    return not building_js
++@depends(js_standalone)
++def ctypes_default(js_standalone):
++    return not js_standalone
+ 
+ js_option('--enable-ctypes',
+           default=ctypes_default,
+           help='{Enable|Disable} js-ctypes')
+ 
+ build_ctypes = depends_if('--enable-ctypes')(lambda _: True)
+ 
+ set_config('BUILD_CTYPES', build_ctypes)
+@@ -474,19 +464,19 @@ js_option('--with-system-icu', help='Use
+ 
+ system_icu = pkg_check_modules('MOZ_ICU', 'icu-i18n >= 67.1', when='--with-system-icu')
+ 
+ set_config('MOZ_SYSTEM_ICU', True, when=system_icu)
+ set_define('MOZ_SYSTEM_ICU', True, when=system_icu)
+ 
+ js_option('--without-intl-api', help='Disable ECMAScript Internationalization API')
+ 
+-@depends('--with-intl-api', building_js)
+-def check_intl_api(enabled, building_js):
+-    if not enabled and not building_js:
++@depends('--with-intl-api', js_standalone)
++def check_intl_api(enabled, js_standalone):
++    if not enabled and not js_standalone:
+         die('--without-intl-api is not supported')
+ 
+ set_config('JS_HAS_INTL_API', True, when='--with-intl-api')
+ set_define('JS_HAS_INTL_API', True, when='--with-intl-api')
+ 
+ @depends(check_build_environment, when='--with-intl-api')
+ @imports(_from='__builtin__', _import='open')
+ @imports(_from='__builtin__', _import='ValueError')

+ 483 - 0
mozilla-release/patches/1670385-83a1.patch

@@ -0,0 +1,483 @@
+# HG changeset patch
+# User Andrew Halberstadt <ahal@pm.me>
+# Date 1602646324 0
+# Node ID 7a7006c24e69828fdc543ed04229964329563274
+# Parent  f9c4c56fdbcfbd577945c623cc48295594279632
+Bug 1670385 - [mach] Move 'TestBase._run_mach' to a pytest fixture, r=firefox-build-system-reviewers,rstewart
+
+I accidentally broke the 'mach' unittests on Python 2 due to some difference in the unittest
+module. Rather than poking into 'unittest', this patch moves us closer to the pytest format
+while also fixing the issue.
+
+Differential Revision: https://phabricator.services.mozilla.com/D93420
+
+diff --git a/python/mach/mach/test/common.py b/python/mach/mach/test/conftest.py
+rename from python/mach/mach/test/common.py
+rename to python/mach/mach/test/conftest.py
+--- a/python/mach/mach/test/common.py
++++ b/python/mach/mach/test/conftest.py
+@@ -1,62 +1,84 @@
+ # 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
+-from __future__ import unicode_literals
++from __future__ import absolute_import, unicode_literals
+ 
+ import os
+ import sys
+ import unittest
+ 
++import pytest
+ import six
++from buildconfig import topsrcdir
+ 
+ try:
+     from StringIO import StringIO
+ except ImportError:
+     # TODO io.StringIO causes failures with Python 2 (needs to be sorted out)
+     from io import StringIO
+ 
+ from mach.main import Mach
+ 
+ here = os.path.abspath(os.path.dirname(__file__))
++PROVIDER_DIR = os.path.join(here, 'providers')
+ 
+ 
+-class TestBase(unittest.TestCase):
+-    provider_dir = os.path.join(here, 'providers')
++@pytest.fixture(scope="class")
++def get_mach(request):
+ 
+-    @classmethod
+-    def get_mach(cls, provider_files=None, entry_point=None, context_handler=None):
++    def _populate_context(key):
++        if key == 'topdir':
++            return topsrcdir
++
++    def inner(provider_files=None, entry_point=None, context_handler=None):
+         m = Mach(os.getcwd())
+         m.define_category('testing', 'Mach unittest', 'Testing for mach core', 10)
+         m.define_category('misc', 'Mach misc', 'Testing for mach core', 20)
+-        m.populate_context_handler = context_handler
++        m.populate_context_handler = context_handler or _populate_context
+ 
+         if provider_files:
+             if isinstance(provider_files, six.string_types):
+                 provider_files = [provider_files]
+ 
+             for path in provider_files:
+-                m.load_commands_from_file(os.path.join(cls.provider_dir, path))
++                m.load_commands_from_file(os.path.join(PROVIDER_DIR, path))
+ 
+         if entry_point:
+             m.load_commands_from_entry_point(entry_point)
+ 
+         return m
+ 
+-    def _run_mach(self, argv, *args, **kwargs):
+-        m = self.get_mach(*args, **kwargs)
++    if request.cls and issubclass(request.cls, unittest.TestCase):
++        request.cls.get_mach = lambda cls, *args, **kwargs: inner(*args, **kwargs)
++    return inner
++
++
++@pytest.fixture(scope="class")
++def run_mach(request, get_mach):
++
++    def inner(argv, *args, **kwargs):
++        m = get_mach(*args, **kwargs)
+ 
+         stdout = StringIO()
+         stderr = StringIO()
+ 
+         if sys.version_info < (3, 0):
+             stdout.encoding = 'UTF-8'
+             stderr.encoding = 'UTF-8'
+ 
+         try:
+             result = m.run(argv, stdout=stdout, stderr=stderr)
+         except SystemExit:
+             result = None
+ 
+         return (result, stdout.getvalue(), stderr.getvalue())
++
++    if request.cls and issubclass(request.cls, unittest.TestCase):
++        request.cls._run_mach = lambda cls, *args, **kwargs: inner(*args, **kwargs)
++    return inner
++
++
++@pytest.mark.usefixtures("get_mach", "run_mach")
++class TestBase(unittest.TestCase):
++    pass
+diff --git a/python/mach/mach/test/test_commands.py b/python/mach/mach/test/test_commands.py
+--- a/python/mach/mach/test/test_commands.py
++++ b/python/mach/mach/test/test_commands.py
+@@ -7,73 +7,71 @@ from __future__ import absolute_import, 
+ import os
+ import sys
+ 
+ import pytest
+ from mozunit import main
+ 
+ from buildconfig import topsrcdir
+ import mach
+-from mach.test.common import TestBase
+ 
+ ALL_COMMANDS = [
+     'cmd_bar',
+     'cmd_foo',
+     'cmd_foobar',
+     'mach-commands',
+     'mach-completion',
+     'mach-debug-commands',
+ ]
+ 
+ 
+ @pytest.fixture
+-def run_mach():
++def run_completion(run_mach):
+ 
+-    tester = TestBase()
+-
+-    def inner(args):
++    def inner(args=[]):
+         mach_dir = os.path.dirname(mach.__file__)
+         providers = [
+             'commands.py',
+             os.path.join(mach_dir, 'commands', 'commandinfo.py'),
+         ]
+ 
+         def context_handler(key):
+             if key == 'topdir':
+                 return topsrcdir
+ 
+-        return tester._run_mach(args, providers, context_handler=context_handler)
++        args = ["mach-completion"] + args
++        return run_mach(args, providers, context_handler=context_handler)
+ 
+     return inner
+ 
+ 
+ def format(targets):
+     return "\n".join(targets) + "\n"
+ 
+ 
+-def test_mach_completion(run_mach):
+-    result, stdout, stderr = run_mach(['mach-completion'])
++def test_mach_completion(run_completion):
++    result, stdout, stderr = run_completion()
+     assert result == 0
+     assert stdout == format(ALL_COMMANDS)
+ 
+-    result, stdout, stderr = run_mach(['mach-completion', 'cmd_f'])
++    result, stdout, stderr = run_completion(['cmd_f'])
+     assert result == 0
+     # While it seems like this should return only commands that have
+     # 'cmd_f' as a prefix, the completion script will handle this case
+     # properly.
+     assert stdout == format(ALL_COMMANDS)
+ 
+-    result, stdout, stderr = run_mach(['mach-completion', 'cmd_foo'])
++    result, stdout, stderr = run_completion(['cmd_foo'])
+     assert result == 0
+     assert stdout == format(['help', '--arg'])
+ 
+ 
+ @pytest.mark.parametrize("shell", ("bash", "fish", "zsh"))
+-def test_generate_mach_completion_script(run_mach, shell):
+-    rv, out, err = run_mach(["mach-completion", shell])
++def test_generate_mach_completion_script(run_completion, shell):
++    rv, out, err = run_completion([shell])
+     print(out)
+     print(err, file=sys.stderr)
+     assert rv == 0
+     assert err == ""
+ 
+     assert "cmd_foo" in out
+     assert "arg" in out
+     assert "cmd_foobar" in out
+diff --git a/python/mach/mach/test/test_conditions.py b/python/mach/mach/test/test_conditions.py
+--- a/python/mach/mach/test/test_conditions.py
++++ b/python/mach/mach/test/test_conditions.py
+@@ -6,17 +6,17 @@ from __future__ import absolute_import
+ from __future__ import unicode_literals
+ 
+ import os
+ 
+ from buildconfig import topsrcdir
+ from mach.base import MachError
+ from mach.main import Mach
+ from mach.registrar import Registrar
+-from mach.test.common import TestBase
++from mach.test.conftest import TestBase, PROVIDER_DIR
+ 
+ from mozunit import main
+ 
+ 
+ def _make_populate_context(include_extra_attributes):
+     def _populate_context(key=None):
+         if key is None:
+             return
+@@ -38,60 +38,59 @@ def _make_populate_context(include_extra
+ 
+ _populate_bare_context = _make_populate_context(False)
+ _populate_context = _make_populate_context(True)
+ 
+ 
+ class TestConditions(TestBase):
+     """Tests for conditionally filtering commands."""
+ 
+-    def _run_mach(self, args, context_handler=_populate_bare_context):
+-        return TestBase._run_mach(self, args, 'conditions.py',
+-                                  context_handler=context_handler)
++    def _run(self, args, context_handler=_populate_bare_context):
++        return self._run_mach(args, 'conditions.py', context_handler=context_handler)
+ 
+     def test_conditions_pass(self):
+         """Test that a command which passes its conditions is runnable."""
+ 
+-        self.assertEquals((0, '', ''), self._run_mach(['cmd_foo']))
+-        self.assertEquals((0, '', ''), self._run_mach(['cmd_foo_ctx'], _populate_context))
++        self.assertEquals((0, '', ''), self._run(['cmd_foo']))
++        self.assertEquals((0, '', ''), self._run(['cmd_foo_ctx'], _populate_context))
+ 
+     def test_invalid_context_message(self):
+         """Test that commands which do not pass all their conditions
+         print the proper failure message."""
+ 
+         def is_bar():
+             """Bar must be true"""
+         fail_conditions = [is_bar]
+ 
+         for name in ('cmd_bar', 'cmd_foobar'):
+-            result, stdout, stderr = self._run_mach([name])
++            result, stdout, stderr = self._run([name])
+             self.assertEquals(1, result)
+ 
+             fail_msg = Registrar._condition_failed_message(name, fail_conditions)
+             self.assertEquals(fail_msg.rstrip(), stdout.rstrip())
+ 
+         for name in ('cmd_bar_ctx', 'cmd_foobar_ctx'):
+-            result, stdout, stderr = self._run_mach([name], _populate_context)
++            result, stdout, stderr = self._run([name], _populate_context)
+             self.assertEquals(1, result)
+ 
+             fail_msg = Registrar._condition_failed_message(name, fail_conditions)
+             self.assertEquals(fail_msg.rstrip(), stdout.rstrip())
+ 
+     def test_invalid_type(self):
+         """Test that a condition which is not callable raises an exception."""
+ 
+         m = Mach(os.getcwd())
+         m.define_category('testing', 'Mach unittest', 'Testing for mach core', 10)
+         self.assertRaises(MachError, m.load_commands_from_file,
+-                          os.path.join(self.provider_dir, 'conditions_invalid.py'))
++                          os.path.join(PROVIDER_DIR, 'conditions_invalid.py'))
+ 
+     def test_help_message(self):
+         """Test that commands that are not runnable do not show up in help."""
+ 
+-        result, stdout, stderr = self._run_mach(['help'], _populate_context)
++        result, stdout, stderr = self._run(['help'], _populate_context)
+         self.assertIn('cmd_foo', stdout)
+         self.assertNotIn('cmd_bar', stdout)
+         self.assertNotIn('cmd_foobar', stdout)
+         self.assertIn('cmd_foo_ctx', stdout)
+         self.assertNotIn('cmd_bar_ctx', stdout)
+         self.assertNotIn('cmd_foobar_ctx', stdout)
+ 
+ 
+diff --git a/python/mach/mach/test/test_dispatcher.py b/python/mach/mach/test/test_dispatcher.py
+--- a/python/mach/mach/test/test_dispatcher.py
++++ b/python/mach/mach/test/test_dispatcher.py
+@@ -1,29 +1,31 @@
+ # 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
+ from __future__ import unicode_literals
+ 
+ import os
++import unittest
+ from io import StringIO
+ 
++import pytest
+ from mozunit import main
+ from six import string_types
+ 
+ from mach.base import CommandContext
+ from mach.registrar import Registrar
+-from mach.test.common import TestBase
+ 
+ here = os.path.abspath(os.path.dirname(__file__))
+ 
+ 
+-class TestDispatcher(TestBase):
++@pytest.mark.usefixtures("get_mach", "run_mach")
++class TestDispatcher(unittest.TestCase):
+     """Tests dispatch related code"""
+ 
+     def get_parser(self, config=None):
+         mach = self.get_mach('basic.py')
+ 
+         for provider in Registrar.settings_providers:
+             mach.settings.register_provider(provider)
+ 
+diff --git a/python/mach/mach/test/test_entry_point.py b/python/mach/mach/test/test_entry_point.py
+--- a/python/mach/mach/test/test_entry_point.py
++++ b/python/mach/mach/test/test_entry_point.py
+@@ -4,17 +4,17 @@
+ from __future__ import absolute_import
+ from __future__ import unicode_literals
+ 
+ import imp
+ import os
+ import sys
+ 
+ from mach.base import MachError
+-from mach.test.common import TestBase
++from mach.test.conftest import TestBase
+ from mock import patch
+ 
+ from mozunit import main
+ 
+ 
+ here = os.path.abspath(os.path.dirname(__file__))
+ 
+ 
+@@ -28,35 +28,35 @@ class Entry():
+             return self.providers
+         return _providers
+ 
+ 
+ class TestEntryPoints(TestBase):
+     """Test integrating with setuptools entry points"""
+     provider_dir = os.path.join(here, 'providers')
+ 
+-    def _run_mach(self):
+-        return TestBase._run_mach(self, ['help'], entry_point='mach.providers')
++    def _run_help(self):
++        return self._run_mach(['help'], entry_point='mach.providers')
+ 
+     @patch('pkg_resources.iter_entry_points')
+     def test_load_entry_point_from_directory(self, mock):
+         # Ensure parent module is present otherwise we'll (likely) get
+         # an error due to unknown parent.
+         if 'mach.commands' not in sys.modules:
+             mod = imp.new_module('mach.commands')
+             sys.modules['mach.commands'] = mod
+ 
+         mock.return_value = [Entry([self.provider_dir])]
+         # Mach error raised due to conditions_invalid.py
+         with self.assertRaises(MachError):
+-            self._run_mach()
++            self._run_help()
+ 
+     @patch('pkg_resources.iter_entry_points')
+     def test_load_entry_point_from_file(self, mock):
+         mock.return_value = [Entry([os.path.join(self.provider_dir, 'basic.py')])]
+ 
+-        result, stdout, stderr = self._run_mach()
++        result, stdout, stderr = self._run_help()
+         self.assertIsNone(result)
+         self.assertIn('cmd_foo', stdout)
+ 
+ 
+ if __name__ == '__main__':
+     main()
+diff --git a/python/mach/mach/test/test_error_output.py b/python/mach/mach/test/test_error_output.py
+--- a/python/mach/mach/test/test_error_output.py
++++ b/python/mach/mach/test/test_error_output.py
+@@ -1,46 +1,28 @@
+ # 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
+-from __future__ import unicode_literals
++from __future__ import absolute_import, unicode_literals
+ 
+-from buildconfig import topsrcdir
+ from mach.main import (
+     COMMAND_ERROR,
+     MODULE_ERROR
+ )
+-from mach.test.common import TestBase
+-
+ from mozunit import main
+ 
+ 
+-def _populate_context(key):
+-    if key == 'topdir':
+-        return topsrcdir
+-
+-class TestErrorOutput(TestBase):
+-
+-    def _run_mach(self, args):
+-        return TestBase._run_mach(
+-            self, args, 'throw.py', context_handler=_populate_context)
++def test_command_error(run_mach):
++    result, stdout, stderr = run_mach(['throw', '--message', 'Command Error'],
++                                      provider_files='throw.py')
++    assert result == 1
++    assert COMMAND_ERROR_TEMPLATE % 'throw' in stdout
+ 
+-    def test_command_error(self):
+-        result, stdout, stderr = self._run_mach(['throw', '--message',
+-                                                'Command Error'])
+-
+-        self.assertEqual(result, 1)
+-
+-        self.assertIn(COMMAND_ERROR, stdout)
+-
+-    def test_invoked_error(self):
+-        result, stdout, stderr = self._run_mach(['throw_deep', '--message',
+-                                                'Deep stack'])
+-
+-        self.assertEqual(result, 1)
+-
+-        self.assertIn(MODULE_ERROR, stdout)
++def test_invoked_error(run_mach):
++    result, stdout, stderr = run_mach(['throw_deep', '--message', 'Deep stack'],
++                                      provider_files='throw.py')
++    assert result == 1
++    assert MODULE_ERROR_TEMPLATE % 'throw_deep' in stdout
+ 
+ 
+ if __name__ == '__main__':
+     main()
+diff --git a/python/mach/mach/test/test_mach.py b/python/mach/mach/test/test_mach.py
+--- a/python/mach/mach/test/test_mach.py
++++ b/python/mach/mach/test/test_mach.py
+@@ -1,26 +1,25 @@
+ # 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, unicode_literals
+ 
+ import os
+ 
+-from mach.test.common import TestBase
+ from mozunit import main
+ 
+ 
+-def test_set_isatty_environ(monkeypatch):
++def test_set_isatty_environ(monkeypatch, get_mach):
+     # Make sure the 'MACH_STDOUT_ISATTY' variable gets set.
+     monkeypatch.delenv('MACH_STDOUT_ISATTY', raising=False)
+     monkeypatch.setattr(os, 'isatty', lambda fd: True)
+ 
+-    m = TestBase.get_mach()
++    m = get_mach()
+     orig_run = m._run
+     env_is_set = []
+ 
+     def wrap_run(*args, **kwargs):
+         env_is_set.append('MACH_STDOUT_ISATTY' in os.environ)
+         return orig_run(*args, **kwargs)
+ 
+     monkeypatch.setattr(m, '_run', wrap_run)

+ 4 - 4
mozilla-release/patches/1672940-84a1.patch

@@ -2,7 +2,7 @@
 # User Emilio Cobos Alvarez <emilio@crisal.io>
 # User Emilio Cobos Alvarez <emilio@crisal.io>
 # Date 1603453036 0
 # Date 1603453036 0
 # Node ID ea01ecd10760a3c6b6958dfe7375298b43a38e19
 # Node ID ea01ecd10760a3c6b6958dfe7375298b43a38e19
-# Parent  acec50b5eec82374c27a9d39684900528f039d25
+# Parent  555050ef8738344c469e588c5ac591d39d5251bf
 Bug 1672940 - Remove biplist. r=firefox-build-system-reviewers,glandium
 Bug 1672940 - Remove biplist. r=firefox-build-system-reviewers,glandium
 
 
 biplist broke with python 3.9, but we don't need this anymore because
 biplist broke with python 3.9, but we don't need this anymore because
@@ -15,12 +15,12 @@ Differential Revision: https://phabricator.services.mozilla.com/D94577
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
-@@ -139,18 +139,19 @@ def host_is_osx(host):
+@@ -140,18 +140,19 @@ def host_is_osx(host):
  with only_when(host_is_osx | target_is_osx):
  with only_when(host_is_osx | target_is_osx):
      # MacOS SDK
      # MacOS SDK
      # =========
      # =========
  
  
-     js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
+     option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
             help='Location of platform SDK to use')
             help='Location of platform SDK to use')
  
  
      @depends('--with-macos-sdk', host)
      @depends('--with-macos-sdk', host)
@@ -36,7 +36,7 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
              sdk = sdk[0]
              sdk = sdk[0]
          elif host.os == 'OSX':
          elif host.os == 'OSX':
              sdk = check_cmd_output('xcrun', '--show-sdk-path', onerror=lambda: '').rstrip()
              sdk = check_cmd_output('xcrun', '--show-sdk-path', onerror=lambda: '').rstrip()
-@@ -161,17 +162,18 @@ with only_when(host_is_osx | target_is_o
+@@ -162,17 +163,18 @@ with only_when(host_is_osx | target_is_o
              die('Need a macOS SDK when targeting macOS. Please use --with-macos-sdk '
              die('Need a macOS SDK when targeting macOS. Please use --with-macos-sdk '
                  'to give the path to a macOS SDK.')
                  'to give the path to a macOS SDK.')
  
  

+ 3 - 3
mozilla-release/patches/1678291-2-85a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1605817520 0
 # Date 1605817520 0
 # Node ID 5588b2b9a15e9743801db553bb79de637f46b55a
 # Node ID 5588b2b9a15e9743801db553bb79de637f46b55a
-# Parent  5b52a614e169ec5501d95017a3f6afda28fadd2e
+# Parent  802b5b76567754d3598160e7dab00177f362e579
 Bug 1678291 - Default to use private frameworks from the SDK. r=firefox-build-system-reviewers,mhentges
 Bug 1678291 - Default to use private frameworks from the SDK. r=firefox-build-system-reviewers,mhentges
 
 
 And don't set it via mozconfig. The default to /System/Library/PrivateFrameworks
 And don't set it via mozconfig. The default to /System/Library/PrivateFrameworks
@@ -75,5 +75,5 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
  
  
  # Compiler wrappers
  # Compiler wrappers
  # ==============================================================
  # ==============================================================
- # Normally, we'd use js_option and automatically have those variables
- # propagated to js/src, but things are complicated by possible additional
+ option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
+        help='Enable compiling with wrappers such as distcc and ccache')

+ 2 - 2
mozilla-release/patches/1681406-85a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1607520396 0
 # Date 1607520396 0
 # Node ID 3c639828681a296190a137835ce1a85c57e71431
 # Node ID 3c639828681a296190a137835ce1a85c57e71431
-# Parent  0fb38a8fbc93a81ed138afd3bdaf7972d99b5d49
+# Parent  29088f7fd57cf1c982f4442eff59687d49491dbc
 Bug 1681406 - Require 10.12 SDK for the build. r=firefox-build-system-reviewers,dmajor
 Bug 1681406 - Require 10.12 SDK for the build. r=firefox-build-system-reviewers,dmajor
 
 
 Bug 1680152 updated automation to use the 10.12 SDK, and shortly after,
 Bug 1680152 updated automation to use the 10.12 SDK, and shortly after,
@@ -19,7 +19,7 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
 --- a/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 @@ -144,18 +144,18 @@ with only_when(host_is_osx | target_is_o
 @@ -144,18 +144,18 @@ with only_when(host_is_osx | target_is_o
-     js_option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
+     option('--with-macos-sdk', env='MACOS_SDK_DIR', nargs=1,
             help='Location of platform SDK to use')
             help='Location of platform SDK to use')
  
  
      @depends('--with-macos-sdk', host)
      @depends('--with-macos-sdk', host)

+ 3 - 3
mozilla-release/patches/1683797-2-88a1.patch

@@ -2,7 +2,7 @@
 # User Mitchell Hentges <mhentges@mozilla.com>
 # User Mitchell Hentges <mhentges@mozilla.com>
 # Date 1615301125 0
 # Date 1615301125 0
 # Node ID 697524537cc4d91ba6f65c4ff5886dcebb4cc238
 # Node ID 697524537cc4d91ba6f65c4ff5886dcebb4cc238
-# Parent  34edec64f5b652975bdeea055c16ef89c854879f
+# Parent  7de3e2c5e6971b9f811a6436ec317483c351f0ae
 Bug 1683797: Removes redundant path parsing r=sheehan,firefox-build-system-reviewers,glandium
 Bug 1683797: Removes redundant path parsing r=sheehan,firefox-build-system-reviewers,glandium
 
 
 We already know the project name, we should unbundle it
 We already know the project name, we should unbundle it
@@ -16,7 +16,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D106293
 diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
 diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
 --- a/build/moz.configure/init.configure
 --- a/build/moz.configure/init.configure
 +++ b/build/moz.configure/init.configure
 +++ b/build/moz.configure/init.configure
-@@ -1028,21 +1028,19 @@ def include_project_configure(project, b
+@@ -1038,21 +1038,19 @@ def include_project_configure(project, b
  
  
      base_dir = build_env.topsrcdir
      base_dir = build_env.topsrcdir
      path = os.path.join(base_dir, project[0], 'moz.configure')
      path = os.path.join(base_dir, project[0], 'moz.configure')
@@ -40,4 +40,4 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
  add_old_configure_assignment('MOZ_BUILD_APP', build_project)
  add_old_configure_assignment('MOZ_BUILD_APP', build_project)
  
  
  
  
- # This is temporary until js/src/configure and configure are merged.
+ # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in

+ 1 - 67
mozilla-release/patches/1692383-87a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1613523218 0
 # Date 1613523218 0
 # Node ID 9539a7f2006af1fbe025182ca40e2a52c368e77b
 # Node ID 9539a7f2006af1fbe025182ca40e2a52c368e77b
-# Parent  d0e189bc34b4b245260dacd40d85b474fdc139df
+# Parent  50ea10dc5be6b8a7ad8fe9327a32fabb6978bb5d
 Bug 1692383 - Upgrade python-zstandard to 0.15.1. r=firefox-build-system-reviewers,mhentges
 Bug 1692383 - Upgrade python-zstandard to 0.15.1. r=firefox-build-system-reviewers,mhentges
 
 
 As far as I can tell, we don't use zstandard from python2. As the last
 As far as I can tell, we don't use zstandard from python2. As the last
@@ -11,72 +11,6 @@ version.
 
 
 Differential Revision: https://phabricator.services.mozilla.com/D105075
 Differential Revision: https://phabricator.services.mozilla.com/D105075
 
 
-diff --git a/build/debian-packages/python-zstandard-buster.diff b/build/debian-packages/python-zstandard-buster.diff
-new file mode 100644
---- /dev/null
-+++ b/build/debian-packages/python-zstandard-buster.diff
-@@ -0,0 +1,61 @@
-+diff --git a/debian/changelog b/debian/changelog
-+index 84028db..d6c86c4 100644
-+--- a/debian/changelog
-++++ b/debian/changelog
-+@@ -1,3 +1,10 @@
-++python-zstandard (0.15.1-1.deb10moz1) buster; urgency=low
-++
-++  * Mozilla backport for buster.
-++  * Apply https://github.com/indygreg/python-zstandard/pull/139.
-++
-++ -- Mike Hommey <glandium@mozilla.com>  Fri, 12 Feb 2021 13:22:31 +0900
-++
-+ python-zstandard (0.15.0~dev0-1) unstable; urgency=low
-+
-+   * New version.
-+diff --git a/debian/control b/debian/control
-+index 1835727..f8a1a7c 100644
-+--- a/debian/control
-++++ b/debian/control
-+@@ -5,13 +5,9 @@ Priority: optional
-+ Build-Depends:
-+   debhelper (>= 7),
-+   dh-python,
-+-  python-all-dev,
-+   python3-all-dev,
-+-  python-hypothesis,
-+   python3-hypothesis,
-+-  python-pytest,
-+   python3-pytest,
-+-  python-setuptools,
-+   python3-setuptools
-+ Standards-Version: 3.9.1
-+ X-Python3-Version: >= 3.5
-+@@ -19,17 +14,6 @@ Homepage: https://github.com/indygreg/python-zstandard
-+ Vcs-Browser: https://github.com/indygreg/python-zstandard.git
-+ Vcs-Git: https://github.com/indygreg/python-zstandard.git
-+ 
-+-Package: python-zstandard
-+-Architecture: any
-+-Depends:
-+-  ${misc:Depends},
-+-  ${python:Depends},
-+-  ${shlibs:Depends}
-+-Provides:
-+- ${python:Provides}
-+-Description: Zstandard bindings for Python
-+-  Python bindings to zstandard compression library.
-+-
-+ Package: python3-zstandard
-+ Architecture: any
-+ Depends:
-+diff --git a/debian/rules b/debian/rules
-+index 751826f..3a2c1b5 100755
-+--- a/debian/rules
-++++ b/debian/rules
-+@@ -6,4 +6,4 @@ export PYBUILD_NAME=zstandard
-+ export PYBUILD_TEST_ARGS=-I fuzzing
-+ 
-+ %:
-+-	dh $@ --parallel --with python2,python3 --buildsystem=pybuild
-++	dh $@ --parallel --with python3 --buildsystem=pybuild
 diff --git a/build/zstandard_requirements.in b/build/zstandard_requirements.in
 diff --git a/build/zstandard_requirements.in b/build/zstandard_requirements.in
 --- a/build/zstandard_requirements.in
 --- a/build/zstandard_requirements.in
 +++ b/build/zstandard_requirements.in
 +++ b/build/zstandard_requirements.in

+ 8 - 8
mozilla-release/patches/1692940-02-88a1.patch

@@ -3,7 +3,7 @@
 # Date 1614043603 0
 # Date 1614043603 0
 #      Tue Feb 23 01:26:43 2021 +0000
 #      Tue Feb 23 01:26:43 2021 +0000
 # Node ID a22f5d28effbce01de85f81f00339389727e29ff
 # Node ID a22f5d28effbce01de85f81f00339389727e29ff
-# Parent  e06a443a0fe44fb57060add4e0f543b001da5c06
+# Parent  775d54a5b9ad1cd6f41e1558d79e383534bc5ded
 Bug 1692940 - Change the logic to check for nasm. r=firefox-build-system-reviewers,dmajor
 Bug 1692940 - Change the logic to check for nasm. r=firefox-build-system-reviewers,dmajor
 
 
 Instead of preemptively check for it, and then check if it's good enough to
 Instead of preemptively check for it, and then check if it's good enough to
@@ -18,11 +18,11 @@ Differential Revision: https://phabricator.services.mozilla.com/D105425
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
-@@ -2148,53 +2148,16 @@ add_old_configure_assignment('ENABLE_CLA
+@@ -2118,53 +2118,16 @@ add_old_configure_assignment('ENABLE_CLA
                               depends_if('--enable-clang-plugin')(lambda _: True))
                               depends_if('--enable-clang-plugin')(lambda _: True))
  
  
- js_option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
-           help="Enable building with the mozsearch indexer plugin")
+ option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN',
+        help="Enable building with the mozsearch indexer plugin")
  
  
  add_old_configure_assignment('ENABLE_MOZSEARCH_PLUGIN',
  add_old_configure_assignment('ENABLE_MOZSEARCH_PLUGIN',
                               depends_if('--enable-mozsearch-plugin')(lambda _: True))
                               depends_if('--enable-mozsearch-plugin')(lambda _: True))
@@ -68,14 +68,14 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
  # Code Coverage
  # Code Coverage
  # ==============================================================
  # ==============================================================
  
  
- js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
-           help='Enable code coverage')
+ option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+        help='Enable code coverage')
  
  
  @depends('--enable-coverage')
  @depends('--enable-coverage')
 diff --git a/toolkit/moz.configure b/toolkit/moz.configure
 diff --git a/toolkit/moz.configure b/toolkit/moz.configure
 --- a/toolkit/moz.configure
 --- a/toolkit/moz.configure
 +++ b/toolkit/moz.configure
 +++ b/toolkit/moz.configure
-@@ -403,26 +403,27 @@ imply_option('--enable-fmp4', ffmpeg, '-
+@@ -406,26 +406,27 @@ imply_option('--enable-fmp4', ffmpeg, '-
  option('--disable-av1',
  option('--disable-av1',
          help='Disable av1 video support')
          help='Disable av1 video support')
  
  
@@ -113,7 +113,7 @@ diff --git a/toolkit/moz.configure b/toolkit/moz.configure
  set_define('MOZ_AV1', av1)
  set_define('MOZ_AV1', av1)
  
  
  # Built-in fragmented MP4 support.
  # Built-in fragmented MP4 support.
-@@ -1494,16 +1495,92 @@ def valid_yasm_version(yasm_version, for
+@@ -1573,16 +1574,92 @@ def valid_yasm_version(yasm_version, for
      by_version = sorted(versioned.items(), key=lambda x: x[1])
      by_version = sorted(versioned.items(), key=lambda x: x[1])
      if by_version:
      if by_version:
          what, version = by_version[-1]
          what, version = by_version[-1]

+ 5 - 5
mozilla-release/patches/1692945-2-87a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1613510226 0
 # Date 1613510226 0
 # Node ID 44e6140070a0b4088e1ca8017611af569e57c6d7
 # Node ID 44e6140070a0b4088e1ca8017611af569e57c6d7
-# Parent  52724e40d03a347983b69077caeb874dd22c099b
+# Parent  692de1035947af19d5cc97f9675ad8b9aeba19f2
 Bug 1692945 - Remove unused [YN]ASM variables. r=firefox-build-system-reviewers,andi,dmajor
 Bug 1692945 - Remove unused [YN]ASM variables. r=firefox-build-system-reviewers,andi,dmajor
 
 
 None of HAVE_NASM, HAVE_YASM, NASM_MAJOR_VERSION and NASM_MINOR_VERSION are
 None of HAVE_NASM, HAVE_YASM, NASM_MAJOR_VERSION and NASM_MINOR_VERSION are
@@ -13,7 +13,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D105269
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
-@@ -2165,30 +2165,16 @@ def nasm_version(nasm):
+@@ -2135,30 +2135,16 @@ def nasm_version(nasm):
      if retcode:
      if retcode:
          # mac stub binary
          # mac stub binary
          return None
          return None
@@ -44,7 +44,7 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
              ('OSX', 'x86_64'): ['-f', 'macho64'],
              ('OSX', 'x86_64'): ['-f', 'macho64'],
              ('WINNT', 'x86'): ['-f', 'win32'],
              ('WINNT', 'x86'): ['-f', 'win32'],
              ('WINNT', 'x86_64'): ['-f', 'win64'],
              ('WINNT', 'x86_64'): ['-f', 'win64'],
-@@ -2200,33 +2186,16 @@ def nasm_asflags(nasm, target):
+@@ -2170,33 +2156,16 @@ def nasm_asflags(nasm, target):
                  asflags = ['-f', 'elf32']
                  asflags = ['-f', 'elf32']
              elif target.cpu == 'x86_64':
              elif target.cpu == 'x86_64':
                  asflags = ['-f', 'elf64']
                  asflags = ['-f', 'elf64']
@@ -74,7 +74,7 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
  # Code Coverage
  # Code Coverage
  # ==============================================================
  # ==============================================================
  
  
- js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
-           help='Enable code coverage')
+ option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+        help='Enable code coverage')
  
  
  @depends('--enable-coverage')
  @depends('--enable-coverage')

+ 1 - 20
mozilla-release/patches/1695773-88a1.patch

@@ -2,32 +2,13 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1615249152 0
 # Date 1615249152 0
 # Node ID ba5dddbbb1a98d6d19ab8d31c9f86615187983d7
 # Node ID ba5dddbbb1a98d6d19ab8d31c9f86615187983d7
-# Parent  62d03f876e075e7192f2ab658efbd36bdf02de3b
+# Parent  a2659db2db7c25d9fd43491f170f51bd1b8500d4
 Bug 1695773 - Upgrade python-zstandard to 0.15.2. r=firefox-build-system-reviewers,mhentges
 Bug 1695773 - Upgrade python-zstandard to 0.15.2. r=firefox-build-system-reviewers,mhentges
 
 
 It's the first release with arm64 mac wheels.
 It's the first release with arm64 mac wheels.
 
 
 Differential Revision: https://phabricator.services.mozilla.com/D106848
 Differential Revision: https://phabricator.services.mozilla.com/D106848
 
 
-diff --git a/build/debian-packages/python-zstandard-buster.diff b/build/debian-packages/python-zstandard-buster.diff
---- a/build/debian-packages/python-zstandard-buster.diff
-+++ b/build/debian-packages/python-zstandard-buster.diff
-@@ -1,14 +1,14 @@
- diff --git a/debian/changelog b/debian/changelog
- index 84028db..d6c86c4 100644
- --- a/debian/changelog
- +++ b/debian/changelog
- @@ -1,3 +1,10 @@
--+python-zstandard (0.15.1-1.deb10moz1) buster; urgency=low
-++python-zstandard (0.15.2-1.deb10moz1) buster; urgency=low
- +
- +  * Mozilla backport for buster.
- +  * Apply https://github.com/indygreg/python-zstandard/pull/139.
- +
- + -- Mike Hommey <glandium@mozilla.com>  Fri, 12 Feb 2021 13:22:31 +0900
- +
-  python-zstandard (0.15.0~dev0-1) unstable; urgency=low
- 
 diff --git a/build/zstandard_requirements.in b/build/zstandard_requirements.in
 diff --git a/build/zstandard_requirements.in b/build/zstandard_requirements.in
 --- a/build/zstandard_requirements.in
 --- a/build/zstandard_requirements.in
 +++ b/build/zstandard_requirements.in
 +++ b/build/zstandard_requirements.in

+ 0 - 144
mozilla-release/patches/1716972-91a1.patch

@@ -1,144 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1623923455 0
-# Node ID 79e9fb0fdfac5a0ef178d5c09161a5711e6fac5e
-# Parent  39b976c7b734a6a6706cb686b2faaffb2e35c7d8
-Bug 1716972 - Remove leftover from bug 1695773. r=firefox-build-system-reviewers,andi
-
-Differential Revision: https://phabricator.services.mozilla.com/D118153
-
-diff --git a/build/debian-packages/python-zstandard-buster.diff b/build/debian-packages/python-zstandard-buster.diff
-deleted file mode 100644
---- a/build/debian-packages/python-zstandard-buster.diff
-+++ /dev/null
-@@ -1,61 +0,0 @@
--diff --git a/debian/changelog b/debian/changelog
--index 84028db..d6c86c4 100644
----- a/debian/changelog
--+++ b/debian/changelog
--@@ -1,3 +1,10 @@
--+python-zstandard (0.15.2-1.deb10moz1) buster; urgency=low
--+
--+  * Mozilla backport for buster.
--+  * Apply https://github.com/indygreg/python-zstandard/pull/139.
--+
--+ -- Mike Hommey <glandium@mozilla.com>  Fri, 12 Feb 2021 13:22:31 +0900
--+
-- python-zstandard (0.15.0~dev0-1) unstable; urgency=low
--
--   * New version.
--diff --git a/debian/control b/debian/control
--index 1835727..f8a1a7c 100644
----- a/debian/control
--+++ b/debian/control
--@@ -5,13 +5,9 @@ Priority: optional
-- Build-Depends:
--   debhelper (>= 7),
--   dh-python,
---  python-all-dev,
--   python3-all-dev,
---  python-hypothesis,
--   python3-hypothesis,
---  python-pytest,
--   python3-pytest,
---  python-setuptools,
--   python3-setuptools
-- Standards-Version: 3.9.1
-- X-Python3-Version: >= 3.5
--@@ -19,17 +14,6 @@ Homepage: https://github.com/indygreg/python-zstandard
-- Vcs-Browser: https://github.com/indygreg/python-zstandard.git
-- Vcs-Git: https://github.com/indygreg/python-zstandard.git
-- 
---Package: python-zstandard
---Architecture: any
---Depends:
---  ${misc:Depends},
---  ${python:Depends},
---  ${shlibs:Depends}
---Provides:
--- ${python:Provides}
---Description: Zstandard bindings for Python
---  Python bindings to zstandard compression library.
---
-- Package: python3-zstandard
-- Architecture: any
-- Depends:
--diff --git a/debian/rules b/debian/rules
--index 751826f..3a2c1b5 100755
----- a/debian/rules
--+++ b/debian/rules
--@@ -6,4 +6,4 @@ export PYBUILD_NAME=zstandard
-- export PYBUILD_TEST_ARGS=-I fuzzing
-- 
-- %:
---	dh $@ --parallel --with python2,python3 --buildsystem=pybuild
--+	dh $@ --parallel --with python3 --buildsystem=pybuild
-diff --git a/build/debian-packages/python-zstandard-jessie.diff.1857492.later b/build/debian-packages/python-zstandard-jessie.diff.1857492.later
-new file mode 100644
---- /dev/null
-+++ b/build/debian-packages/python-zstandard-jessie.diff.1857492.later
-@@ -0,0 +1,64 @@
-+--- python-zstandard-jessie.diff
-++++ python-zstandard-jessie.diff
-+@@ -1,61 +0,0 @@
-+-diff --git a/debian/changelog b/debian/changelog
-+-index 84028db..d6c86c4 100644
-+---- a/debian/changelog
-+-+++ b/debian/changelog
-+-@@ -1,3 +1,10 @@
-+-+python-zstandard (0.15.2-1.deb8moz1) jessie; urgency=low
-+-+
-+-+  * Remove build dependencies so package builds on jessie.
-+-+  * Apply https://github.com/indygreg/python-zstandard/pull/139.
-+-+
-+-+ -- Mike Hommey <glandium@mozilla.com>  Fri, 12 Feb 2021 13:22:31 +0900
-+-+
-+- python-zstandard (0.15.0~dev0-1) unstable; urgency=low
-+-
-+-   * New version.
-+-diff --git a/debian/control b/debian/control
-+-index 1835727..f8a1a7c 100644
-+---- a/debian/control
-+-+++ b/debian/control
-+-@@ -5,13 +5,8 @@ Priority: optional
-+- Build-Depends:
-+-   debhelper (>= 7),
-+-   dh-python,
-+--  python-all-dev,
-+-   python3-all-dev,
-+--  python-hypothesis,
-+--  python3-hypothesis,
-+--  python-pytest,
-+-   python3-pytest,
-+--  python-setuptools,
-+-   python3-setuptools
-+- Standards-Version: 3.9.1
-+- X-Python3-Version: >= 3.5
-+-@@ -19,17 +14,6 @@ Homepage: https://github.com/indygreg/python-zstandard
-+- Vcs-Browser: https://github.com/indygreg/python-zstandard.git
-+- Vcs-Git: https://github.com/indygreg/python-zstandard.git
-+- 
-+--Package: python-zstandard
-+--Architecture: any
-+--Depends:
-+--  ${misc:Depends},
-+--  ${python:Depends},
-+--  ${shlibs:Depends}
-+--Provides:
-+-- ${python:Provides}
-+--Description: Zstandard bindings for Python
-+--  Python bindings to zstandard compression library.
-+--
-+- Package: python3-zstandard
-+- Architecture: any
-+- Depends:
-+-diff --git a/debian/rules b/debian/rules
-+-index 751826f..3a2c1b5 100755
-+---- a/debian/rules
-+-+++ b/debian/rules
-+-@@ -6,4 +6,4 @@ export PYBUILD_NAME=zstandard
-+- export PYBUILD_TEST_ARGS=-I fuzzing
-+- 
-+- %:
-+--	dh $@ --parallel --with python2,python3 --buildsystem=pybuild
-+-+	dh $@ --parallel --with python3 --buildsystem=pybuild

+ 3 - 3
mozilla-release/patches/1718878-2-9107.patch

@@ -2,7 +2,7 @@
 # User Alex Hochheiden <ahochheiden@mozilla.com>
 # User Alex Hochheiden <ahochheiden@mozilla.com>
 # Date 1635341713 0
 # Date 1635341713 0
 # Node ID 3b175cd808efc5d0d90387035ceba1df475a2396
 # Node ID 3b175cd808efc5d0d90387035ceba1df475a2396
-# Parent  0838053b562455b504d15c698d608961b2f0f712
+# Parent  e1d017ecafe5d885373bba3356960647524e4b50
 Bug 1718878 - Updates to the build system to enable compatibility with Python 3.10 (Mainly regarding collections.abc) r=mhentges,webdriver-reviewers,whimboo a=RyanVM
 Bug 1718878 - Updates to the build system to enable compatibility with Python 3.10 (Mainly regarding collections.abc) r=mhentges,webdriver-reviewers,whimboo a=RyanVM
 
 
 Previously, collections.abc was available from the collections import. In Python
 Previously, collections.abc was available from the collections import. In Python
@@ -16,8 +16,8 @@ Differential Revision: https://phabricator.services.mozilla.com/D128838
 diff --git a/configure.py b/configure.py
 diff --git a/configure.py b/configure.py
 --- a/configure.py
 --- a/configure.py
 +++ b/configure.py
 +++ b/configure.py
-@@ -7,22 +7,17 @@ from __future__ import absolute_import, 
- import codecs
+@@ -8,22 +8,17 @@ import codecs
+ import errno
  import io
  import io
  import itertools
  import itertools
  import logging
  import logging

+ 9 - 9
mozilla-release/patches/1728988-1-VS2022-base-25310.patch

@@ -1,14 +1,14 @@
 # HG changeset patch
 # HG changeset patch
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # Date 1634166376 -7200
 # Date 1634166376 -7200
-# Parent  4798536e3b52265b18995768f4bce8b3f353e18e
+# Parent  740ddc18640a21ca4c447a34ff74ad84201131fa
 Bug 1728988 - Support VS2022. r=IanN a=IanN
 Bug 1728988 - Support VS2022. r=IanN a=IanN
 SeaMonkey release branch only.
 SeaMonkey release branch only.
 
 
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 --- a/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
 +++ b/build/moz.configure/toolchain.configure
-@@ -586,25 +586,26 @@ def get_vc_paths(topsrcdir):
+@@ -541,25 +541,26 @@ def get_vc_paths(topsrcdir):
  
  
  @depends(host)
  @depends(host)
  def host_is_windows(host):
  def host_is_windows(host):
@@ -16,10 +16,10 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
          return True
          return True
  
  
  
  
- js_option('--with-visual-studio-version', nargs=1,
--          choices=('2017', '2019'), when=host_is_windows,
-+          choices=('2017', '2019', '2022'), when=host_is_windows,
-           help='Select a specific Visual Studio version to use')
+ option('--with-visual-studio-version', nargs=1,
+-       choices=('2017', '2019'), when=host_is_windows,
++       choices=('2017', '2019', '2022'), when=host_is_windows,
+        help='Select a specific Visual Studio version to use')
  
  
  
  
  @depends('--with-visual-studio-version', when=host_is_windows)
  @depends('--with-visual-studio-version', when=host_is_windows)
@@ -31,13 +31,13 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
 +                '2022': 17}[value[0]]
 +                '2022': 17}[value[0]]
  
  
  
  
- js_option(env='VC_PATH', nargs=1, when=host_is_windows,
-           help='Path to the Microsoft Visual C/C++ compiler')
+ option(env='VC_PATH', nargs=1, when=host_is_windows,
+        help='Path to the Microsoft Visual C/C++ compiler')
  
  
  
  
  @depends(vs_major_version, check_build_environment, 'VC_PATH',
  @depends(vs_major_version, check_build_environment, 'VC_PATH',
           '--with-visual-studio-version', when=host_is_windows)
           '--with-visual-studio-version', when=host_is_windows)
-@@ -1164,16 +1165,18 @@ host_cxx_compiler = compiler('C++', host
+@@ -1119,16 +1120,18 @@ host_cxx_compiler = compiler('C++', host
  non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
  non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
  building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
  building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
  
  

+ 10 - 10
mozilla-release/patches/1747754-PARTIAL-97a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1640816331 0
 # Date 1640816331 0
 # Node ID 34308b58e329edae3ade1265ebf7e3882d73b0ea
 # Node ID 34308b58e329edae3ade1265ebf7e3882d73b0ea
-# Parent  d5b1bdecefa06a8ad83df5e32c23852fbeec1365
+# Parent  c3cf26e83db704c5f1668b7c1a4bcf35ad4a07e4
 Bug 1747754 - Move --with-android-min-sdk to python configure. r=firefox-build-system-reviewers,geckoview-reviewers,mhentges,calu
 Bug 1747754 - Move --with-android-min-sdk to python configure. r=firefox-build-system-reviewers,geckoview-reviewers,mhentges,calu
 
 
 And remove --with-android-max-sdk, which hasn't been used since the
 And remove --with-android-max-sdk, which hasn't been used since the
@@ -58,7 +58,7 @@ diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4
 diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
 diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
 --- a/build/moz.configure/old.configure
 --- a/build/moz.configure/old.configure
 +++ b/build/moz.configure/old.configure
 +++ b/build/moz.configure/old.configure
-@@ -184,18 +184,16 @@ def old_configure_options(*options):
+@@ -109,18 +109,16 @@ def old_configure_options(*options):
      '--enable-system-pixman',
      '--enable-system-pixman',
      '--enable-universalchardet',
      '--enable-universalchardet',
      '--enable-updater',
      '--enable-updater',
@@ -69,24 +69,24 @@ diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configu
      '--prefix',
      '--prefix',
 -    '--with-android-max-sdk',
 -    '--with-android-max-sdk',
 -    '--with-android-min-sdk',
 -    '--with-android-min-sdk',
-     '--with-app-basename',
-     '--with-app-name',
      '--with-branding',
      '--with-branding',
      '--with-debug-label',
      '--with-debug-label',
      '--with-distribution-id',
      '--with-distribution-id',
      '--with-jitreport-granularity',
      '--with-jitreport-granularity',
      '--with-macbundlename-prefix',
      '--with-macbundlename-prefix',
      '--with-nss-exec-prefix',
      '--with-nss-exec-prefix',
+     '--with-nss-prefix',
+     '--with-system-libevent',
 diff --git a/old-configure.in b/old-configure.in
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
 +++ b/old-configure.in
-@@ -1695,27 +1695,16 @@ MOZ_ARG_WITH_STRING(app-basename,
- WITH_APP_BASENAME=$withval,
- )
- 
- if test -n "$WITH_APP_BASENAME" ; then
-     MOZ_APP_BASENAME="$WITH_APP_BASENAME"
+@@ -1665,27 +1665,16 @@ if test "$BUILDING_RELEASE"; then
+   # Override value in defines.sh, if any
+   EARLY_BETA_OR_EARLIER=
+ elif test "$EARLY_BETA_OR_EARLIER"; then
+   AC_DEFINE(EARLY_BETA_OR_EARLIER)
  fi
  fi
+ AC_SUBST(EARLY_BETA_OR_EARLIER)
  
  
  dnl ========================================================
  dnl ========================================================
 -dnl Ensure Android SDK and build-tools versions depending on
 -dnl Ensure Android SDK and build-tools versions depending on

+ 20 - 43
mozilla-release/patches/NOBUG-nukemozlinker-25319.patch

@@ -1,34 +1,11 @@
 # HG changeset patch
 # HG changeset patch
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # Date 1705411363 -3600
 # Date 1705411363 -3600
-# Parent  f6c75b14314a3c6b26fa84bd97e3e1ba4ac880ec
+# Parent  3ea8123a15b1540d5fb83cb3953075b03696f57f
 No Bug - Nuke custom linker. r=me a=me
 No Bug - Nuke custom linker. r=me a=me
 
 
 It was only needed for Android.
 It was only needed for Android.
 
 
-diff --git a/browser/app/moz.build b/browser/app/moz.build
---- a/browser/app/moz.build
-+++ b/browser/app/moz.build
-@@ -97,19 +97,16 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_
- # The heap will grow if need be.
- #
- # Set it to 256k.  See bug 127069.
- if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'):
-     LDFLAGS += ['/HEAP:0x40000']
- 
- DisableStlWrapping()
- 
--if CONFIG['MOZ_LINKER']:
--    OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
--
- if CONFIG['HAVE_CLOCK_MONOTONIC']:
-     OS_LIBS += CONFIG['REALTIME_LIBS']
- 
- if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
-     DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
-     COMPILE_FLAGS['OS_CXXFLAGS'] = [
-         f for f in COMPILE_FLAGS.get('OS_CXXFLAGS', [])
-         if not f.startswith('-march=') and f not in ('-msse', '-msse2', '-mfpmath=sse')
 diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild
 diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild
 --- a/js/src/js-config.mozbuild
 --- a/js/src/js-config.mozbuild
 +++ b/js/src/js-config.mozbuild
 +++ b/js/src/js-config.mozbuild
@@ -48,7 +25,7 @@ diff --git a/js/src/js-config.mozbuild b/js/src/js-config.mozbuild
 diff --git a/js/src/old-configure.in b/js/src/old-configure.in
 diff --git a/js/src/old-configure.in b/js/src/old-configure.in
 --- a/js/src/old-configure.in
 --- a/js/src/old-configure.in
 +++ b/js/src/old-configure.in
 +++ b/js/src/old-configure.in
-@@ -1522,17 +1522,16 @@ AC_SUBST(TARGET_XPCOM_ABI)
+@@ -1509,17 +1509,16 @@ AC_SUBST(TARGET_XPCOM_ABI)
  
  
  dnl === -AC_SUBST(GCC_USE_GNU_LD) Bug 1478499 part 5 ===
  dnl === -AC_SUBST(GCC_USE_GNU_LD) Bug 1478499 part 5 ===
  
  
@@ -114,25 +91,25 @@ diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers
 diff --git a/js/sub.configure b/js/sub.configure
 diff --git a/js/sub.configure b/js/sub.configure
 --- a/js/sub.configure
 --- a/js/sub.configure
 +++ b/js/sub.configure
 +++ b/js/sub.configure
-@@ -82,17 +82,17 @@ def js_subconfigure(host, target, build_
+@@ -42,17 +42,17 @@ def old_js_configure_env(substs, mozconf
      # Variables that were explicitly exported from old-configure, and those
      # Variables that were explicitly exported from old-configure, and those
      # explicitly set in the environment when invoking old-configure, were
      # explicitly set in the environment when invoking old-configure, were
      # automatically inherited from subconfigure. We assume the relevant ones
      # automatically inherited from subconfigure. We assume the relevant ones
      # have a corresponding AC_SUBST in old-configure, making them available
      # have a corresponding AC_SUBST in old-configure, making them available
      # in `substs`.
      # in `substs`.
+     extra_env = {}
+ 
      for var in (
      for var in (
-         'MOZ_SYSTEM_ZLIB', 'MOZ_ZLIB_CFLAGS', 'MOZ_ZLIB_LIBS',
-         'MOZ_APP_NAME', 'MOZ_APP_REMOTINGNAME', 'MOZ_DEV_EDITION',
--        'STLPORT_LIBS', 'DIST', 'MOZ_LINKER', 'ZLIB_IN_MOZGLUE', 'RANLIB',
-+        'STLPORT_LIBS', 'DIST', 'ZLIB_IN_MOZGLUE', 'RANLIB',
-         'AR', 'CPP', 'CC', 'CXX', 'CPPFLAGS', 'CFLAGS', 'CXXFLAGS',
-         'LDFLAGS', 'HOST_CC', 'HOST_CXX', 'HOST_CPPFLAGS',
-         'HOST_CXXFLAGS', 'HOST_LDFLAGS'
+-        'MOZ_DEV_EDITION', 'STLPORT_LIBS', 'MOZ_LINKER', 'ZLIB_IN_MOZGLUE',
++        'MOZ_DEV_EDITION', 'STLPORT_LIBS', 'ZLIB_IN_MOZGLUE',
+         'RANLIB',
      ):
      ):
-         if var not in from_assignment and var in substs:
+         if var in substs:
              value = substs[var]
              value = substs[var]
-         elif var in assignments:
-             value = assignments[var]
+         elif mozconfig and var in mozconfig and \
+                 not mozconfig[var][1].startswith('removed'):
+             value = mozconfig[var][0]
+         else:
 diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build
 diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build
 --- a/mozglue/build/moz.build
 --- a/mozglue/build/moz.build
 +++ b/mozglue/build/moz.build
 +++ b/mozglue/build/moz.build
@@ -6331,7 +6308,7 @@ diff --git a/mozglue/moz.build b/mozglue/moz.build
 diff --git a/old-configure.in b/old-configure.in
 diff --git a/old-configure.in b/old-configure.in
 --- a/old-configure.in
 --- a/old-configure.in
 +++ b/old-configure.in
 +++ b/old-configure.in
-@@ -599,20 +599,16 @@ case "$target" in
+@@ -586,20 +586,16 @@ case "$target" in
  
  
          LDFLAGS=$_SAVE_LDFLAGS
          LDFLAGS=$_SAVE_LDFLAGS
      fi
      fi
@@ -6352,7 +6329,7 @@ diff --git a/old-configure.in b/old-configure.in
          MOZ_OPTIMIZE_FLAGS="-Oz"
          MOZ_OPTIMIZE_FLAGS="-Oz"
          # Disable the outliner, which causes performance regressions, and is
          # Disable the outliner, which causes performance regressions, and is
          # enabled on some platforms at -Oz.
          # enabled on some platforms at -Oz.
-@@ -948,23 +944,16 @@ if test -z "$MOZ_OPTIMIZE_FLAGS"; then
+@@ -935,23 +931,16 @@ if test -z "$MOZ_OPTIMIZE_FLAGS"; then
      MOZ_OPTIMIZE_FLAGS="-O"
      MOZ_OPTIMIZE_FLAGS="-O"
  fi
  fi
  
  
@@ -6376,7 +6353,7 @@ diff --git a/old-configure.in b/old-configure.in
      MOZ_COMPILER_OPTS
      MOZ_COMPILER_OPTS
  fi # COMPILE_ENVIRONMENT
  fi # COMPILE_ENVIRONMENT
  
  
-@@ -1406,17 +1395,17 @@ AC_CACHE_CHECK(for __thread keyword for 
+@@ -1393,17 +1382,17 @@ AC_CACHE_CHECK(for __thread keyword for 
                 ac_cv_thread_keyword,
                 ac_cv_thread_keyword,
                 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
                 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
                              [return tlsIsMainThread;],
                              [return tlsIsMainThread;],
@@ -6395,7 +6372,7 @@ diff --git a/old-configure.in b/old-configure.in
        :
        :
        ;;
        ;;
      *-android*|*-linuxandroid*)
      *-android*|*-linuxandroid*)
-@@ -1427,33 +1416,16 @@ if test "$ac_cv_thread_keyword" = yes -a
+@@ -1414,33 +1403,16 @@ if test "$ac_cv_thread_keyword" = yes -a
        ;;
        ;;
      *)
      *)
        AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
        AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
@@ -6429,7 +6406,7 @@ diff --git a/old-configure.in b/old-configure.in
  dnl ========================================================
  dnl ========================================================
  dnl
  dnl
  dnl Internationalization and Locale support is different
  dnl Internationalization and Locale support is different
-@@ -2498,17 +2470,17 @@ fi # COMPILE_ENVIRONMENT
+@@ -2453,17 +2425,17 @@ fi # COMPILE_ENVIRONMENT
  dnl ========================================================
  dnl ========================================================
  dnl =
  dnl =
  dnl = Static Build Options
  dnl = Static Build Options
@@ -6448,10 +6425,10 @@ diff --git a/old-configure.in b/old-configure.in
  AC_SUBST(ZLIB_IN_MOZGLUE)
  AC_SUBST(ZLIB_IN_MOZGLUE)
  
  
  dnl ========================================================
  dnl ========================================================
-@@ -2736,17 +2708,16 @@ AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
+@@ -2691,17 +2663,16 @@ AC_SUBST(MOZ_UPDATER)
+ AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
  AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
  AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
  AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
  AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
- AC_SUBST(STRIP_FLAGS)
  AC_SUBST(INCREMENTAL_LINKER)
  AC_SUBST(INCREMENTAL_LINKER)
  
  
  AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
  AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)

+ 1 - 23
mozilla-release/patches/TOP-NOBUG-PLASTER-Stylo-25314.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # HG changeset patch
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # User Frank-Rainer Grahl <frgrahl@gmx.net>
 # Date 1658061774 -7200
 # Date 1658061774 -7200
-# Parent  663dd60eb3dda78bb3218721a11abd6cff1afd3d
+# Parent  1fb3e7d371be5f2ac06bdaf30cbc61f628793e85
 No Bug - Hack around enable-stylo failing in mach configure. r=me a=me
 No Bug - Hack around enable-stylo failing in mach configure. r=me a=me
 
 
 Needs more ports in the build system to work ok out of the box.
 Needs more ports in the build system to work ok out of the box.
@@ -9,28 +9,6 @@ Needs more ports in the build system to work ok out of the box.
 diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure
 diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure
 --- a/build/moz.configure/bindgen.configure
 --- a/build/moz.configure/bindgen.configure
 +++ b/build/moz.configure/bindgen.configure
 +++ b/build/moz.configure/bindgen.configure
-@@ -110,19 +110,19 @@ def llvm_config_paths(host):
- 
-     return llvm_config_progs
- 
- js_option(env='LLVM_CONFIG', nargs=1, help='Path to llvm-config')
- 
- llvm_config = check_prog('LLVM_CONFIG', llvm_config_paths, input='LLVM_CONFIG',
-                          what='llvm-config', allow_missing=True)
- 
--js_option('--with-libclang-path', nargs=1,
-+option('--with-libclang-path', nargs=1,
-           help='Absolute path to a directory containing Clang/LLVM libraries for bindgen (version 3.9.x or above)')
--js_option('--with-clang-path', nargs=1,
-+option('--with-clang-path', nargs=1,
-           help='Absolute path to a Clang binary for bindgen (version 3.9.x or above)')
- 
- def invoke_llvm_config(llvm_config, *options):
-     '''Invoke llvm_config with the given options and return the first line of
-     output.'''
-     lines = check_cmd_output(llvm_config, *options).splitlines()
-     return lines[0]
- 
 @@ -166,29 +166,19 @@ def bindgen_config_paths(llvm_config, li
 @@ -166,29 +166,19 @@ def bindgen_config_paths(llvm_config, li
          # At least one of the choices must be found.
          # At least one of the choices must be found.
          for choice in libclang_choices:
          for choice in libclang_choices:

+ 4 - 4
mozilla-release/patches/TOP-NOBUG-REGEXP-21-1634135-78a1-25318.patch

@@ -1,13 +1,13 @@
 # HG changeset patch
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690630056 -7200
 # Date 1690630056 -7200
-# Parent  1177c801fe6ea3840ead7af6b5ce3ae3a9f3d331
+# Parent  8456946a70798ded56d8a473ff8c8023bb3a0fe1
 No Bug - Import new regexp V8 engine. r=frg a=frg
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 
 diff --git a/js/moz.configure b/js/moz.configure
 diff --git a/js/moz.configure b/js/moz.configure
 --- a/js/moz.configure
 --- a/js/moz.configure
 +++ b/js/moz.configure
 +++ b/js/moz.configure
-@@ -435,19 +435,19 @@ def enable_pipeline_operator(value):
+@@ -439,19 +439,19 @@ def enable_pipeline_operator(value):
  
  
  set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
  set_config('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
  set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
  set_define('ENABLE_PIPELINE_OPERATOR', enable_pipeline_operator)
@@ -16,8 +16,8 @@ diff --git a/js/moz.configure b/js/moz.configure
  # Initial support for new regexp engine
  # Initial support for new regexp engine
  # ==================================================
  # ==================================================
  
  
--js_option('--enable-new-regexp', default=False, help='Enable new regexp engine')
-+js_option('--disable-new-regexp', help='{Enable|Disable} new regexp engine')
+-option('--enable-new-regexp', default=False, help='Enable new regexp engine'
++option('--disable-new-regexp', help='{Enable|Disable} new regexp engine')
  
  
 -@depends('--enable-new-regexp')
 -@depends('--enable-new-regexp')
 +@depends('--disable-new-regexp')
 +@depends('--disable-new-regexp')

+ 4 - 4
mozilla-release/patches/TOP-NOBUG-REGEXP-37-1642493-79a1-25318.patch

@@ -1,7 +1,7 @@
 # HG changeset patch
 # HG changeset patch
 # User Dmitry Butskoy <buc@buc.me>
 # User Dmitry Butskoy <buc@buc.me>
 # Date 1690631112 -7200
 # Date 1690631112 -7200
-# Parent  e656a9b4fb74d0078183e69ac27f5015b89f0600
+# Parent  940f053d5f2df6e6958cd7d510e0deff5b27fa4f
 No Bug - Import new regexp V8 engine. r=frg a=frg
 No Bug - Import new regexp V8 engine. r=frg a=frg
 
 
 diff --git a/.clang-format-ignore b/.clang-format-ignore
 diff --git a/.clang-format-ignore b/.clang-format-ignore
@@ -23,7 +23,7 @@ diff --git a/.clang-format-ignore b/.clang-format-ignore
 diff --git a/js/moz.configure b/js/moz.configure
 diff --git a/js/moz.configure b/js/moz.configure
 --- a/js/moz.configure
 --- a/js/moz.configure
 +++ b/js/moz.configure
 +++ b/js/moz.configure
-@@ -432,30 +432,16 @@ js_option('--enable-pipeline-operator', 
+@@ -436,30 +436,16 @@ option('--enable-pipeline-operator', def
  def enable_pipeline_operator(value):
  def enable_pipeline_operator(value):
      if value:
      if value:
          return True
          return True
@@ -35,7 +35,7 @@ diff --git a/js/moz.configure b/js/moz.configure
 -# Initial support for new regexp engine
 -# Initial support for new regexp engine
 -# ==================================================
 -# ==================================================
 -
 -
--js_option('--disable-new-regexp', help='{Enable|Disable} new regexp engine')
+-option('--disable-new-regexp', help='{Enable|Disable} new regexp engine')
 -
 -
 -@depends('--disable-new-regexp')
 -@depends('--disable-new-regexp')
 -def enable_new_regexp(value):
 -def enable_new_regexp(value):
@@ -48,7 +48,7 @@ diff --git a/js/moz.configure b/js/moz.configure
 -
 -
  # ECMAScript Internationalization API Support (uses ICU)
  # ECMAScript Internationalization API Support (uses ICU)
  # ======================================================
  # ======================================================
- js_option('--with-system-icu', help='Use system ICU')
+ option('--with-system-icu', help='Use system ICU')
  
  
  system_icu = pkg_check_modules('MOZ_ICU', 'icu-i18n >= 67.1', when='--with-system-icu')
  system_icu = pkg_check_modules('MOZ_ICU', 'icu-i18n >= 67.1', when='--with-system-icu')
  
  

+ 39 - 3
mozilla-release/patches/series

@@ -4086,7 +4086,6 @@ NOBUG-20180505-lint-61a1.patch
 1460258-62a1.patch
 1460258-62a1.patch
 1302449-62a1.patch
 1302449-62a1.patch
 1459979-62a1.patch
 1459979-62a1.patch
-1460451-62a1.patch
 1374699-1-62a1.patch
 1374699-1-62a1.patch
 1374699-2-62a1.patch
 1374699-2-62a1.patch
 1374699-3-62a1.patch
 1374699-3-62a1.patch
@@ -6601,6 +6600,9 @@ NOBUG-removenonascii67a1-25314.patch
 1558667-78a1.patch
 1558667-78a1.patch
 1638060-78a1.patch
 1638060-78a1.patch
 1640142-78a1.patch
 1640142-78a1.patch
+# Here
+1640578-78a1.patch
+# Here
 1638993-78a1.patch
 1638993-78a1.patch
 1638976-78a1.patch
 1638976-78a1.patch
 1640171-2-78a1.patch
 1640171-2-78a1.patch
@@ -6644,6 +6646,9 @@ NOBUG-removenonascii67a1-25314.patch
 1642032-2-79a1.patch
 1642032-2-79a1.patch
 1496639-79a1.patch
 1496639-79a1.patch
 1622963-2only-79a1.patch
 1622963-2only-79a1.patch
+# Here
+1642893-79a1.patch
+# Here
 1621960-1-79a1.patch
 1621960-1-79a1.patch
 1621960-2-79a1.patch
 1621960-2-79a1.patch
 1643298-79a1.patch
 1643298-79a1.patch
@@ -6759,6 +6764,11 @@ NOBUG-removenonascii67a1-25314.patch
 1656063-81a1.patch
 1656063-81a1.patch
 1655835-81a1.patch
 1655835-81a1.patch
 1657650-81a1.patch
 1657650-81a1.patch
+# Here
+1651680-1-81a1.patch
+1651680-2-81a1.patch
+1657954-81a1.patch
+# Here
 1657719-81a1.patch
 1657719-81a1.patch
 1657168-81a1.patch
 1657168-81a1.patch
 1652374-2only-81a1.patch
 1652374-2only-81a1.patch
@@ -6794,6 +6804,15 @@ NOBUG-removenonascii67a1-25314.patch
 1661635-82a1.patch
 1661635-82a1.patch
 1662130-82a1.patch
 1662130-82a1.patch
 1647792-82a1.patch
 1647792-82a1.patch
+# Here
+1664077-1-82a1.patch
+1664077-2-82a1.patch
+1664077-3-82a1.patch
+1658976-1-82a1.patch
+1658976-2-82a1.patch
+1661790-82a1.patch
+1664083-82a1.patch
+# Here
 1659542-82a1.patch
 1659542-82a1.patch
 1662819-82a1.patch
 1662819-82a1.patch
 1662787-82a1.patch
 1662787-82a1.patch
@@ -6811,6 +6830,11 @@ NOBUG-removenonascii67a1-25314.patch
 1638966-82a1.patch
 1638966-82a1.patch
 1664210-82a1.patch
 1664210-82a1.patch
 1663863-82a1.patch
 1663863-82a1.patch
+# Here
+1667436-83a1.patch
+1519990-2-83a1.patch
+1519990-3-83a1.patch
+# Here
 1666232-83a1.patch
 1666232-83a1.patch
 1627944-83a1.patch
 1627944-83a1.patch
 1661485-83a1.patch
 1661485-83a1.patch
@@ -6823,6 +6847,19 @@ NOBUG-removenonascii67a1-25314.patch
 1667394-83a1.patch
 1667394-83a1.patch
 1670039-83a1.patch
 1670039-83a1.patch
 1670784-83a1.patch
 1670784-83a1.patch
+# Here
+1670385-83a1.patch
+1669633-1-83a1.patch
+1669633-2-83a1.patch
+1669633-3-83a1.patch
+1669633-4-83a1.patch
+1669633-5-83a1.patch
+1669633-6-83a1.patch
+1669633-7-83a1.patch
+1669633-8-83a1.patch
+1669633-9-83a1.patch
+1520395-83a1.patch
+# Here
 1658308-3no12-83a1.patch
 1658308-3no12-83a1.patch
 1667835-83a1.patch
 1667835-83a1.patch
 1667473-1-83a1.patch
 1667473-1-83a1.patch
@@ -7616,14 +7653,13 @@ TOP-NOBUG-fixnasmcheck-25320.patch
 1902935-seamonkey-credits-25320.patch
 1902935-seamonkey-credits-25320.patch
 1862395-incorrect-version-resistfingerprinting-v2-25320.patch
 1862395-incorrect-version-resistfingerprinting-v2-25320.patch
 1737436-use-mozilla-compat-version-define-25320.patch
 1737436-use-mozilla-compat-version-define-25320.patch
+1564097-72a1.patch
 1563403-2-73a1.patch
 1563403-2-73a1.patch
 1601872-73a1.patch
 1601872-73a1.patch
-1664083-82a1.patch
 1671424-84a1.patch
 1671424-84a1.patch
 1683797-1-88a1.patch
 1683797-1-88a1.patch
 1683797-2-88a1.patch
 1683797-2-88a1.patch
 1683797-4-88a1.patch
 1683797-4-88a1.patch
-1716972-91a1.patch
 1722540-92a1.patch
 1722540-92a1.patch
 1715900-99a1.patch
 1715900-99a1.patch
 1833379-115a1.patch
 1833379-115a1.patch