DOM/Engineering: Difference between revisions

→‎Building Firefox: add some more build and config info that's somewhat redundant but helps with completionism
(logging details, mainly)
(→‎Building Firefox: add some more build and config info that's somewhat redundant but helps with completionism)
Line 6: Line 6:


== Building Firefox ==
== Building Firefox ==
=== Install Bootstrapping Dependencies ===
MDN has excellent per-platform guides on how to set up your first build.  There's some overlap between those guides and the next section here about checking out the code.  The core thing to know is that you want to check out "mozilla-unified".
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites Build on Windows]
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Mac_OS_X_Prerequisites Build on OS X]
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation Build on Linux]
=== Checking Out the Code ===
You can use hg (mercurial) or git, but it's strongly advised that you at least try using mercurial with bookmarks and the unified repo to start, even if you're a git expert.
Everything you could want to know about using Mercurial with Firefox can be found on the [https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/index.html Mercurial for Mozillians page].  But good first steps are:
* [https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/installing.html Install Mercurial].
* [https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/unifiedrepo.html Check out the unified repo] that has all of the branches you'd care about in one place.
=== Configuring the Build ===
The [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options MDN Configuring Build Options page] has all the details you'd want.
The core configuration options you are likely to care about are:
* <code>ac_add_options --enable-debug</code> - Enable assertions and other DEBUG-conditional code.  These massively slow down the browser and increase console spam, but are quite useful when you're making low level changes and you wan to make sure invariants are checked by assertions.
* <code>ac_add_options --enable-optimize="-Og"</code> - Setting a specific optimization level so that the debugger will have an easier time of inspecting the state of the program.  "Og" was gcc-specific last time I checked; if you're building with clang you might need something different.


=== Making Builds Go Faster ===
=== Making Builds Go Faster ===
Line 11: Line 31:
* You can [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream use Icecream] to distribute builds to other machines on whatever network you're using.  [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream#Running_a_scheduler Each Mozilla office has its own build server you can use].  If you work remotely, you can also see massive speed-ups from adding a second comparable machine.
* You can [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream use Icecream] to distribute builds to other machines on whatever network you're using.  [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream#Running_a_scheduler Each Mozilla office has its own build server you can use].  If you work remotely, you can also see massive speed-ups from adding a second comparable machine.
* You can [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream#Using_ccache use ccache in conjunction with ice cream].  ccache caches deterministic build results which is useful when the only thing that has changed for a file are the timestamps of its dependencies.
* You can [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream#Using_ccache use ccache in conjunction with ice cream].  ccache caches deterministic build results which is useful when the only thing that has changed for a file are the timestamps of its dependencies.
* Remember to [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Using_Icecream#Building update your configuration] so that "make" knows how many jobs to spawn in parallel!


== Spec-Work ==
== Spec-Work ==
Confirmed users
360

edits