Building in CLI
Both browsers build on a Linux host only. The Windows and macOS binaries are cross-compiled from it.
Camoufox's build system is designed to be used in Linux. WSL will not work!
First, clone this repository with Git. The build lives in the browser folder:
git clone --depth 1 https://github.com/daijro/camoufox
cd camoufox/browserNext, fetch Firefox, copy in Camoufox's additions and apply every patch with the following command:
make dirAfter that, you have to bootstrap your system to be able to build Camoufox. You only have to do this one time. It installs the host packages (needs Python 3.11 or newer) and runs Mozilla's bootstrap:
make bootstrapFinally you can build, run and package Camoufox:
make build # ./mach build
make run # run the build
make package-linux arch=x86_64 # or package-macos / package-windowsmake help lists every target. Install ccache: builds use PGO and LTO, so even an incremental build relinks libxul.
To build and package several targets in one go:
python3 multibuild.py --target linux windows macos --arch x86_64 arm64CLI Parameters
| Flag | Values |
|---|---|
--target |
linux, windows, macos (one or more, required) |
--arch |
x86_64, arm64, i686 (one or more, required; i686 builds Windows only) |
--bootstrap |
Bootstrap the build system first |
--clean |
Clean the build directory first |
--preflight |
Check that each target builds without building it: configure, the export tiers, and every patched source file (minutes, not hours) |
Build artifacts are written to browser/dist/.
A cold build needs about 100 GB of free disk (the script refuses to start with less than 130 GB) and several hours; a warm rebuild after a patch edit takes 10 to 20 minutes. Point TMPDIR at real disk: a tmpfs /tmp fills and fails the link.
First, clone the repository with Git. The scripts run from its root:
git clone --depth 1 https://github.com/CamouBrowser/camouwolf
cd camouwolfThen sync Chromium at the pinned tag, apply the patch series and compile. The first run fetches depot_tools and the whole Chromium checkout into .camouwolf-build/:
bash browser/scripts/build.shCAMOUWOLF_INSTALL_DEPS=1 also runs Chromium's install-build-deps.sh, which uses sudo, to install the host packages.
After you change a patch, rebuild the warm tree. This re-applies the series and lets ninja rebuild only what changed:
bash scripts/build-camouwolf-incremental.shFinally, package the build into browser/dist/:
bash scripts/release-camouwolf.sh --target linux --no-releaseEnvironment variables
browser/scripts/build.sh reads its settings from the environment. Its header lists them all; the main ones:
| Variable | Values |
|---|---|
CAMOUWOLF_TARGET |
linux (default), windows or macos |
CAMOUWOLF_ARCH |
x86_64 (default) or arm64 |
CAMOUWOLF_BUILD_DIR |
Where the Chromium checkout lives (default .camouwolf-build) |
CAMOUWOLF_OUT |
The out/ directory name (default Camouwolf) |
CAMOUWOLF_STAGES |
A subset of sync patch build (default all three) |
CAMOUWOLF_NINJA_JOBS |
Cap ninja's parallelism (default all cores) |
CAMOUWOLF_NICE=1 |
Run the compile under nice and ionice |
CAMOUWOLF_MIN_FREE_GB |
Abort if free disk drops below this during the build (default 40) |
CAMOUWOLF_RATE_LIMIT_MB |
Cap the sync's download speed, in MB/s |
CAMOUWOLF_INSTALL_DEPS=1 |
Install the host packages with Chromium's install-build-deps.sh |
Cross-compiling
Every target is built on an x86_64 Linux host with Chromium's own clang and lld. What the host lacks is each vendor's SDK, which is licensed software and is never committed or published:
- Windows needs a Visual Studio and Windows SDK toolchain zip, made on a Windows machine with
browser/scripts/pack-win-toolchain.sh. PointCAMOUWOLF_WIN_TOOLCHAIN_ZIPat it. - macOS needs the MacOSX SDK from an installed Xcode, packed with
browser/scripts/pack-mac-sdk.sh. PointCAMOUWOLF_MAC_SDK_DIRat it.
CAMOUWOLF_TARGET=macos CAMOUWOLF_ARCH=arm64 CAMOUWOLF_MAC_SDK_DIR=<dir> \
CAMOUWOLF_OUT=Camouwolf-macos-arm64 bash browser/scripts/build.sh
bash scripts/release-camouwolf.sh --target macos --arch arm64 --skip-build --no-releaseOnly Linux x86_64 has been linked, run and released so far; python3 -m ci.targets lists each target and why it is off. See CROSS-COMPILING.md for the status of each.
Build artifacts are written to browser/dist/.