docs: condense sccache section to reduce verbosity
All checks were successful
GBCI / build (push) Successful in 12s
All checks were successful
GBCI / build (push) Successful in 12s
This commit is contained in:
parent
f68ad31168
commit
6f7044d97d
1 changed files with 11 additions and 44 deletions
|
|
@ -178,58 +178,25 @@ git submodule update --init --recursive
|
||||||
|
|
||||||
## Build Cache with sccache
|
## Build Cache with sccache
|
||||||
|
|
||||||
sccache (Shared Compilation Cache) dramatically speeds up rebuilds by caching compilation artifacts. Highly recommended for development.
|
sccache caches compilation artifacts for faster rebuilds.
|
||||||
|
|
||||||
### Install sccache
|
Install and configure:
|
||||||
|
|
||||||
#### Linux
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo install sccache
|
cargo install sccache
|
||||||
```
|
mkdir -p ~/.cargo
|
||||||
|
echo '[build]
|
||||||
#### macOS
|
compiler = "sccache"' >> ~/.cargo/config.toml
|
||||||
|
|
||||||
```bash
|
|
||||||
brew install sccache
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Windows
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
cargo install sccache
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configure Cargo to Use sccache
|
|
||||||
|
|
||||||
Add to `~/.cargo/config.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[build]
|
|
||||||
compiler = "sccache"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Verify sccache is Working
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export RUSTC_WRAPPER=sccache
|
export RUSTC_WRAPPER=sccache
|
||||||
cargo build --release
|
```
|
||||||
|
|
||||||
|
Verify cache hits:
|
||||||
|
|
||||||
|
```bash
|
||||||
sccache --show-stats
|
sccache --show-stats
|
||||||
```
|
```
|
||||||
|
|
||||||
Expected output shows cache hits/misses:
|
Clear cache if needed:
|
||||||
|
|
||||||
```
|
|
||||||
Compile requests 45
|
|
||||||
Compile requests executed 12
|
|
||||||
Cache hits 8
|
|
||||||
Cache misses 4
|
|
||||||
Cache hit rate 66.67%
|
|
||||||
```
|
|
||||||
|
|
||||||
### Clear sccache
|
|
||||||
|
|
||||||
If you need to clear the cache:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sccache --zero-stats
|
sccache --zero-stats
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue