Skip to content

Repository files navigation

Build-Firefox

Requirements

To build the docker image you need at least 2 GB disk space.

To run the container and building firefox you need at least additional 20 GB disk space.

  • Open Container Runtime (i.e. containerd, mobby-engine)
  • bash
  • envsubst via gettext (Fedora)
  • desktop-file-install via desktop-file-utils (Fedora)
  • tar via tar (Fedora)

Usage

Prepare Build Environment

Build Container Image

Clone and build docker image:

git clone https://git.compilenix.org/CompileNix/firefox-build.git
cd firefox-build
docker build -t firefox-build:fedora .

Download Build Tools And Firefox Sources

Now you can prepare the build environment, by installing GIT cinnabar and downloading Firefox source using bootstrap.py.

When asked for Destination directory for clone, enter: firefox

sudo mkdir -v dist firefox mozbuild; sudo chmod -v 0777 dist firefox mozbuild
./run-container.sh --interactive

python3 bootstrap.py --no-interactive --application-choice browser

Build

Update your mozconfig, if you want. Then execute the snippet below.
When asked for Destination directory for Git clone, enter nothing (hit enter).

docker build -t firefox-build:fedora .

./run-container.sh --interactive

cd firefox
build-prepare.sh

apply-patches.py

build.sh

exit
./install.sh # you may run this with sudo if your current user is not permitted to write into the installation directory (default is ~/bin/)

Out Of Memory

run-container.sh starts the container with --oom-score-adj 1000, so when the host runs out of memory the build is killed first instead of other processes. If the build gets OOM-killed (exit code 137), lower JOBS in mozconfig.

Troubleshooting

Compile error: error: options -C embed-bitcode=no and -C lto are incompatible

This "issue" came up with the release of Rust 1.45.

Bugzilla issue

My workaround; downgrade Rust to 1.44.1:

# run this after "bootstrap" and before "./mach build"
source ~/.cargo/env
rustup default 1.44.1

No rule to make target 'alg2268.c', needed by 'alg2268.obj'. Stop

My workaround;

./mach clobber
# continue #Build section with `build-prepare.sh`