Mozilla has, for a while, been using unified source compilation, which concatenates multiple source files together before feeding the result to the compiler.
The idea behind this is that is creates shorter build times and theoretically allows the compiler to optimize more parts of the code.
There are, however, some major drawbacks to this that are considered detrimental to our work here:
- Dependencies can be missed; if the concatenation includes another source file linking in the dependency, (e.g. a header), this header inclusion can be missing without the compiler complaining about it. If code changes and as a result the concatenation changes, we can suddenly be presented with build failures without a clear cause in sources that previously compiled without error.
- It can create code bias for sources that happen to end up in the same block; this in turn can lead to timing differences, races, and performance gaps.
- Debugging is more difficult; the actual compiled source file is a transitional chunk, not the actual source file.
- The build is more fragile: it relies on extra steps performed, is sensitive to newlines at ends of files or not, etc.
- Some source files can’t be built unified, others can, and whether one or the other is true can be difficult to discern.
There is also no conclusive data that the goal set, on our size of source tree, was actually achieved or not.