From a2447809e0ea684ce935abfffc72dd69b6b5b5a6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 27 Nov 2023 16:59:49 +0000 Subject: [PATCH] Bug 1863497 - sccache: update the doc r=glandium Depends on D192932 Differential Revision: https://phabricator.services.mozilla.com/D193704 --- build/docs/sccache-dist.rst | 7 ++++++- docs/contributing/contribution_quickref.rst | 6 ++++++ docs/setup/configuring_build_options.rst | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/build/docs/sccache-dist.rst b/build/docs/sccache-dist.rst index f915b18df42d8..edd9ead909040 100644 --- a/build/docs/sccache-dist.rst +++ b/build/docs/sccache-dist.rst @@ -5,7 +5,12 @@ Distributed sccache (sccache-dist) ================================== `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. diff --git a/docs/contributing/contribution_quickref.rst b/docs/contributing/contribution_quickref.rst index ccdfc857f8f26..3b1056b3f3426 100644 --- a/docs/contributing/contribution_quickref.rst +++ b/docs/contributing/contribution_quickref.rst @@ -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 diff --git a/docs/setup/configuring_build_options.rst b/docs/setup/configuring_build_options.rst index 1a4eec639e57d..bffd9d377fbb3 100644 --- a/docs/setup/configuring_build_options.rst +++ b/docs/setup/configuring_build_options.rst @@ -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 +`__, +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 ^^^^^^^^^^^^