Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Created June 25, 2025 14:36
Show Gist options
  • Save yoshuawuyts/0a878fff697188ed47c1c8fb0da4e0c4 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/0a878fff697188ed47c1c8fb0da4e0c4 to your computer and use it in GitHub Desktop.
created daily tags origin similar to opposite of leads to
2025-04-01
[[2025-04-01, Wk 14 - Tue]]
”notes”
[[31.22.30 Build Systems]]

1.0 Summary

sccache is a modular build cache for compiled languages. It supports different programming languages and different storage backends. This makes it a particularly flexible tool.

2.0 Installation

brew install sccache
mkdir -p "$HOME/.cargo/"
touch "$HOME/.cargo/config.toml"

Then add this to $HOME/.cargo/config.toml:

[build]
rustc-wrapper = "/path/to/sccache"

3.0 Overriding the cache

Caches can fail or get stale. To force a cache reset run:

SCCACHE_RECACHE=1 cargo build

4.0 GitHub Actions

- name: Run sccache-cache only on non-release runs
  if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
  uses: mozilla-actions/[email protected]

- name: Set Rust caching env vars only on non-release runs
  if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
  run: |
    echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
    echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment