MozillaBuild

Contents

Overview

MozillaBuild is a meta-installer that provides everything needed to build Mozilla on Windows, sans Visual C++. Its source lives in https://hg.mozilla.org/mozilla-build/. Bugs should be filed in mozilla.org :: MozillaBuild. For information about building Mozilla on Win32, see the Firefox Source Docs page.

Current Version

The current version of MozillaBuild is 4.1. It is available on ftp.mozilla.org.

To Upgrade From A Previous Version

Upgrading from an earlier MozillaBuild installation is straightforward but each step is important.

  1. Delete your current MozillaBuild environment by moving your MozillaBuild folder into the trash. If you can't remove the existing installation, you probably have a terminal open or watchman or ssh-agent running. Terminate that process and try again.
  2. Install the new MozillaBuild release.
  3. Clobber any trees you have by running ./mach clobber (build errors may occur otherwise).
  4. Re-run ./mach bootstrap to ensure that your tools are up-to-date. Ensure that you agree to run the Mercurial configuration wizard to ensure that its extensions are up-to-date.

Windows Terminal

It's possible to use Windows Terminal instead of the Command Prompt when using MozillaBuild. To do so, add the following profile to the Windows Terminal settings JSON file:

{
    "name": "MozillaBuild",
    "commandline": "C:/mozilla-build/start-shell.bat -here",
    "environment": 
    {
        "USE_MINTTY": "0"
    },
}

Note that:

Technical Details

The MozillaBuild package contains other software prerequisites necessary for building Mozilla, including an MSYS2 environment, Mercurial, Python, NSIS, and UPX, as well as optional but useful tools such as wget and emacs. Note that the "UNIX-like" environment provided by MozillaBuild is only really useful for building and committing to the Mozilla source. Many command line tools you would expect in a modern Linux distribution are not present, and it's not possible to install them with a package manager.

MozillaBuild (As of 4.0.2) modifies only one Windows registry value: HKEY_CURRENT_USER\Console\VirtualTerminalLevel=1. This is set to ensure that Virtual Terminal Processing is enabled for all terminals so that ANSI escape sequences are parsed correctly.

Command Prompt Tips and Caveats
  • To paste into this window, you must right-click on the window's title bar, move your cursor to the “Edit” menu, and click “Paste”. You can also set “Quick Edit Mode” in the “Properties” menu and right-click the window to paste your selection.
  • The MSYS2 root directory is located at/c/mozilla-build/msys2/ (assuming the default installation directory).
    • For MozillaBuild 3.4 and older, the MSYS root directory can be found at /c/mozilla-build/msys/ instead.
  • As of MozillaBuild 4.0, cygpath can be used to convert between path types:

To convert from a Windows path to a Unix-y one, such as using MozillaBuild to edit a file printed by hg (remember to use single-quotes here!)

$ cygpath -u 'C:\mozilla-source\mozilla-unified\README.txt'
/c/mozilla-source/mozilla-unified/README.txt

To convert from a Unix-y path to a Windows one, such as for copying a path printed by MozillaBuild to open in your Windows-native IDE:

$ cygpath -w '/c/mozilla-source/mozilla-unified/README.txt'
C:\mozilla-source\mozilla-unified\README.txt

Release Notes

Historic Versions

Old versions of MozillaBuild can also be found on ftp.mozilla.org.