From 1b54276bea6268131fca7c3f453284ca0aee4b9b Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Thu, 25 Jan 2024 22:29:05 +0000 Subject: [PATCH] docs(compilation): add sccache section --- docs/Compiling.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/Compiling.md b/docs/Compiling.md index 619b3ce9..236b295c 100644 --- a/docs/Compiling.md +++ b/docs/Compiling.md @@ -103,6 +103,23 @@ then add the following: rustflags = ["-C", "link-arg=-fuse-ld=mold"] ``` +## Caching + +To speed up subsequent rebuilds, Mozilla's [sccache](https://github.com/mozilla/sccache) tool can be used. +This provides a cache of Rust modules which can be re-used when compiling any other crate. + +Install the package for your distro, create/modify the `.cargo/config.toml` file inside the project dir, +then add the following: + +```toml +[build] +rustc-wrapper = "/usr/bin/sccache" +``` + +> [!TIP] +> To get the most of out `sccache`, +> you can add this to `$HOME/.cargo/config.toml` to enable caching for all Cargo builds. + ## Codegen Backend > [!WARNING]