The Firefox build system uses the technique of “unified builds” (or elsewhere called “unity builds”) to improve compilation performance. Rather than compiling source files individually, groups of files in the same directory are concatenated together, then compiled once in a single batch.
Unified builds can be configured using the
UNIFIED_SOURCES variable in
Some IDEs (such as VSCode with
clangd) build files in standalone mode, so they may show more failures than a
The amount of files per chunk can be adjusted in
moz.buildfiles with the
FILES_PER_UNIFIED_FILEvariable. Note that changing the chunk size can introduce compilation failures as described above.
We are happy to accept patches that fix problematic unified build chunks (such as by adding includes or namespace annotations).