Sccache

Article description::helps avoid repeated recompilation for the same C, C++ and Rust object files by fetching result from a cache directory.

Compiler cache is typically useful for:


 * Developers who rebuild the same/similar codebase multiple times and use to test patches.
 * Users who frequently play with USE-flag changes and end up rebuilding the same packages multiple times.
 * Users who use live ebuilds extensively.
 * Installing very big ebuilds, such as or, without fear of losing multiple hours of code compilation due to a failure.

Initial setup
Create the cache directory:

Allow write access to cache directory when running under sandbox:

Enable support in :

Done! From now on all builds utilizing Rust compiler will try to reuse object files from cache.

General notes
You can also enable for your current user and reuse the same cache directory:

Useful variables and commands
Some variables:


 * Variable SCCACHE_DIR points to cache root directory.

Some commands:


 * Command shows cache hit statistics: