Skip to content

Commit

Permalink
Added sscache to improve compilation times
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Aug 11, 2019
1 parent ee1ca08 commit 28ebba4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .azure/install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ steps:
rustc -Vv
cargo -V
displayName: Install Rust
- bash: echo "##vso[task.setvariable variable=RUSTC_VERSION;]`rustc --version`"
displayName: Set rustc version in env var
41 changes: 41 additions & 0 deletions .azure/install-sccache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This template installs sccache (Shared Compilation Cache)
# More info: https://github.com/mozilla/sccache

steps:

- bash: |
set -e
curl -Lfo sccache.tar.gz https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-apple-darwin.tar.gz
tar -xzf sccache.tar.gz
cp sccache-*/sccache /usr/local/bin/
displayName: Install sccache (macOS)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: |
set -e
curl -Lfo sccache.tar.gz https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-unknown-linux-musl.tar.gz
tar -xzf sccache.tar.gz
sudo cp sccache-*/sccache /usr/local/bin/
displayName: Install sccache (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
curl -Lfo sccache.tar.gz https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-pc-windows-msvc.tar.gz
tar -xzf sccache.tar.gz
move sccache-* sccache
echo "##vso[task.prependpath]%CD%\sccache"
displayName: Install sccache (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- bash: |
set -ex
sccache -V
displayName: sccache version
- bash: |
set -ex
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]sccache"
SCCACHE_ERROR_LOG=`pwd`/sccache.log RUST_LOG=debug sscache --start-server
sscache -s
cat sccache.log
displayName: Start sccache
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- template: .azure/install-rust.yml
- template: .azure/install-cmake.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sscache.yml
- task: CacheBeta@0
inputs:
key: |
Expand Down

0 comments on commit 28ebba4

Please sign in to comment.