Skip to content

Commit

Permalink
Bug 1863497 - sccache: update the doc r=glandium
Browse files Browse the repository at this point in the history
Depends on D192932

Differential Revision: https://phabricator.services.mozilla.com/D193704
  • Loading branch information
sylvestre committed Nov 27, 2023
1 parent 96a565d commit a244780
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/docs/sccache-dist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ Distributed sccache (sccache-dist)
==================================

`sccache <https://github.com/mozilla/sccache>`_ is a ccache-like tool written in
Rust by Mozilla.
Rust by Mozilla and many contributors.

sccache-dist, its distributed variant, elevates this functionality by enabling
the distribution and caching of Rust compilations across multiple machines.
Please consider using sccache-dist when you have several machines
compiling Firefox on the same network.

The steps for setting up your machine as an sccache-dist server are detailed below.

Expand Down
6 changes: 6 additions & 0 deletions docs/contributing/contribution_quickref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ Once the System is bootstrapped, run:
which will check for dependencies and start the build.
This will take a while; a few minutes to a few hours depending on your hardware.

.. note::

If you build Firefox often, add `ac_add_options --with-ccache=sccache` to .mozconfig.
sccache will significantly speed up your builds by caching compilation results.
The Firefox build system will download sccache automatically.

.. note::

The default build is a compiled build with optimizations. Check out the
Expand Down
11 changes: 11 additions & 0 deletions docs/setup/configuring_build_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ supports `distributed compilation
In order to enable ``sccache`` for Firefox builds, you can use
``ac_add_options --with-ccache=sccache``.

From version 0.7.4, sccache local builds are using the ``preprocessor cache mode``
by default. With a hot cache, it decreases the build time by a factor of 2 to 3
compared the previous method. This feature works like the `direct mode in ccache
<https://ccache.dev/manual/3.7.9.html#_the_direct_mode>`__,
using a similar way to handle caching and dependencies.

.. note::

When using sccache, because of the operation on the files and storage,
the initial build of Firefox will be slower.

Optimization
^^^^^^^^^^^^

Expand Down

0 comments on commit a244780

Please sign in to comment.