TL;DR: We’ve added support for building Firefox outside of the unified 
environment

More than 6 years ago we added support to build Firefox in an unified 
environment by bundling together more translation units into a single one and 
feeding it to our build pipeline. This approach proved to be very useful from 
two perspectives: it significantly decreased the building time and also we were 
providing the compiler, aka Clang, with more context that permitted a broader 
range of optimizations resulting in better results for perf tests like 
browsertime.

Unfortunately this also came with a cost: we have stopped supporting the 
non-unified building system, creating a large dependency between different 
translation units. 

Our entire build system for C/C++ relies on the LLVM toolchain, leveraging at 
the maximum potential the Clang tooling that is part of LLVM proved to be very 
challenging with the unified build system. Build time warnings, static-analysis 
(based on clang-tidy), IntelliSense (based on clangd) all are more difficult or 
suboptimal in a unified build context.

Not being able to leverage the Clang tooling toolsuite at its full potential 
was undesirable, so we’ve begun the task of adding support for building outside 
of the unified system. 

We’ve designed a hybrid build system that attempts to perform a build with as 
many files compiled individually as possible.
Due to the implicit dependency problem, not all modules are currently able to 
be compiled in a non-unified environment. To designate these for the hybrid 
build, the `REQUIRES_UNIFIED_BUILD` option can be set in their corresponding 
moz.build file.

To build in the hybrid mode, set the following flag in your mozconfig:
```
ac_add_options --disable-unified-build
```

If you want to benefit from better build time warnings, increased static 
analysis reliability and improved support for C++ language-specific 
IntelliSense for your modules, please help by making them buildable outside of 
the unified environment.

In order to prevent future regressions we also added 3 build tasks, targeting 
linux64, macos64 and win64, that run on autoland and build Firefox with the 
hybrid build method.

If you have any questions, concerns or you would like to know more about this, 
please feel free to reach out to us.

Thank you,
Compiler and Development Tools Team

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/AD041F24-F11F-4670-A8FC-36219B304F53%40mozilla.com.

Reply via email to