A somewhat decent CPU. You don't need the most powerful thing ever, it will just take longer on a slower chip. I've built on systems as far down as a 45w Ivy Bridge i7 without issue. (This was a while ago though, and it took a very long time, like 2h 30m without PGO.) There also seems to be a cap as to how many cores or maybe just how fast it will build in. 8c16t of Ryzen 5000 builds in ~20-25m without PGO, and 16c32t builds in a similar amount of time. (It has been a while since I last tested if this was the case, but the browser still spends 10 or more minutes building gkrust-shared and then gkrust, on a single thread, which slows things down.)
You'll want at least 16GB of RAM, and for 16GB you'll want a 12-16GB page file for modern versions. 128/140 ESR is fine with a 4-8GB page file. Maybe you could get away with less RAM and a bigger page file, but depending on the storage this could result in a longer build time. My latest VM currently uses 20GB of RAM and an 8GB page file for 150 (latest as of edit), and my 128 and 140 ESR VMs have 16GB of RAM and an 8GB page file as well.
You will want to build on a SSD. I've been told that NVMe is faster than SATA, but I haven't benchmarked the two directly.
Last I checked it was possible to compile on Windows 8.1, but I build inside VMs running Windows X-Lite Micro 10 SE. It's not possible to build on 7, at least not with later mozillabuild versions. With X-Lite you can make do with a 64GB drive size. (Although I keep my page file on a second drive for my VMs, so it's more like 64GB + 8GB.)
Software Prerequisites:
Install Git or GitHub Desktop (I use this modded Windows 7 compatible GitHub Desktop even on 10 since it's portable and doesn't update, this will come up later.)
Download the r3dfox source code, either using GitHub Desktop, or with CLI git. This will be the most time consuming part, so it's best to start it as soon as possible. It is not recommended to use the download zip option.
Code: Select all
git clone https://github.com/Eclipse-Community/r3dfoxInstall MozillaBuild (as of editing, the latest is 4.2.1)
Download and extract eRust somewhere. For example, I do C:\eRust-(version)
If you want to compile the latest versions, use eRust 1.92.0 for 148+ and eRust 1.86.0 for 137-147 including 140 ESR, and it even works for 128 ESR. For 136 and earlier 1.86.0 may still work, but these were officially built with 1.77.2. eRust is used instead of stock for Vista/7 compatibility, and it comes with modified cargo that doesn't error when it sees modified files which is required to build r3dfox.
The Setup:
Ensure Git is in your path. (./mach bootstrap will complain and won't work for whatever reason if you don't do this)
If you use GitHub Desktop, it may be better to manually install git, as GitHub Desktop has versioned folders. It will automatically update and delete it's old version, including it's old copy of git. If you use a fork that doesn't auto update, it works with the included git.
The Git installer should automatically add Git to the path, however if not, here's how to do it. Right click This PC, Properties, Advanced system settings, Environment Variables, double click the Path User variable (should be the first one and highlighted by default), click new, and paste in the git path. For older Windows versions, you will only see a basic text box. In this case, add ; to the end if it's not already there, and paste the Git directory after it.
For normal Git, it's C:\Program Files\Git\cmd
For GitHub Desktop, it's (GitHub Desktop directory)\resources\app\git\cmd
Click OK on both windows and close out of them all.
Run MozillaBuild
Code: Select all
C:\mozilla-build\start-shell.batMake sure git works by typing git. If it doesn't work, double check the Path, and try rebooting.
cd to the r3dfox source code you downloaded. MozillaBuild uses the Unix style forward slashes instead of Windows style backslashes, so you will need to type it with forward slashes. You can also drag the folder onto the terminal and it will fill in with a working path.
Now to get the system ready to build, you will want to bootstrap here.
Code: Select all
./mach --no-interactive bootstrap --application browserWhen finished it will want you to restart the shell to build. It might be best to also restart the system here too. So close it and/or restart, reopen start-shell.bat, and cd to the r3dfox directory again.
Now you'll want to install or link the eRust toolchain. Currently it's 1.92.0 so I use this command below to link it. For ESR 128 and 140 use 1.86.0, and for ESR 115, use 1.77.2.
Code: Select all
rustup toolchain link eRust-1.92.0 C:/eRust-1.92.0Code: Select all
rustup default eRust-1.92.0
rustup override set eRust-1.92.0I recommend doing this step to ensure the build process works correctly. Installing stock Rust of the same version, and doing another bootstrap to ensure everything is correct.
Code: Select all
rustup install 1.92.0
rustup toolchain remove stable
rustup override set 1.92.0
./mach --no-interactive bootstrap --application browser
rustup override set eRust-1.92.0Now you're ready to build r3dfox.
As a time save, instead of needing to type or paste in cd (browser directory) every time you open start-shell.bat, you can add it to the launch command. Near the bottom, there are two lines that start with ` %MOZILLABUILD%msys2\msys2_shell.cmd`, add ` -c "cd C:/Projects/r3dfox && exec bash"` to the end of both, and save.
Building:
The browser uses a mozconfig to store compile flags and settings. This is normally set as an environment variable or taken from .mozconfig if none is set. However since we have a Linux style terminal, we can specify an environment variable before the command, letting us choose whatever we want, whenever we want, without setting any environment variables or swapping .mozconfig files. However if you're only going to ever use one mozconfig, you can add it as an environment variable. Then you don't need MOZCONFIG=xyz in every command.
To build the x64 release, run these commands.
Code: Select all
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win64 ./mach build
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win64 ./mach packageCode: Select all
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win32 ./mach build
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win32 ./mach packageDo note that this will build without PGO. PGO creates a faster, more optimized build, however it doubles the build time. browser-xyz is a unbranded test mozconfig so it's meant to build very close to final, but without PGO. To build with PGO, add these lines after the MOZ_LTO entries near the bottom of the mozconfig.
Code: Select all
export MOZ_PGO=1
ac_add_options MOZ_PGO=1Code: Select all
rustup override set 1.92.0
./mach --no-interactive bootstrap --application browser
rustup override set eRust-1.92.0x64 clobber:
Code: Select all
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win64 ./mach clobberCode: Select all
MOZCONFIG=C:/Projects/r3dfox/mozconfigs/browser-win32 ./mach clobber

