sccache 类似ccache 的编译cache 工具,支持基于本地磁盘,或者云对象存储

特性

  • 基于c/c++ ,rust 编译
  • 支持增量编译

rust 集成使用

可以通过定义build.rustc-wrapper ,

  • 基于配置文件
    参考配置​​​$HOME/.cargo/config.toml​​, 注意需要1.40 版本的cargo

 

[build]
rustc-wrapper = "/path/to/sccache"
  • 基于环境变量
    RUSTC_WRAPPER

 

export RUSTC_WRAPPER=/path/to/sccache
cargo build

说明

对于rust 项目的快速构建sccache是一个不错的选择

参考资料

​https://github.com/mozilla/sccache​​​
​​​https://ccache.dev/​​​
​​​https://github.com/mozilla/sccache/blob/main/docs/DistributedQuickstart.md​​​
​​​https://github.com/mozilla/sccache/blob/main/docs/Jenkins.md​