Skip to content

Commit

Permalink
Load sccache from S3 on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Dec 18, 2018
1 parent b403268 commit 7a0d937
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
10 changes: 10 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ environment:
CARGO_HOME: $(RUST_DIR)\cargo
RUSTUP_HOME: $(RUST_DIR)\rustup
RUST_BACKTRACE: 1
SCCACHE_BUCKET: deno-sccache
AWS_ACCESS_KEY_ID: AKIAIPOYFUDOPCMWRVZA
AWS_SECRET_ACCESS_KEY:
secure: hJTikmTx6ycPqajFnj59WzOaF4xUe8M96+ECcskSIqT0s6BCIrwxZgFTT70Qma1o


# Appveyor uses 7zip to pack cache directories. We use these options:
# -t7z : Use '7z' format.
Expand Down Expand Up @@ -245,6 +250,11 @@ init:
- git config --global core.symlinks true

install:
# Download and install sccache
- appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc
- mv 2018-04-26-sccache-x86_64-pc-windows-msvc sccache.exe
- set PATH=%PATH%;%CD%

# Clone the third_party submodule.
- ps: |-
try {
Expand Down
46 changes: 14 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,23 @@ env:
- CARGO_HOME=$HOME/.cargo/
- RUSTUP_HOME=$HOME/.rustup/
- RUST_BACKTRACE=1
- HOMEBREW_PATH=$HOME/homebrew/
- CARGO_TARGET_DIR=$HOME/target
- PATH=$TRAVIS_BUILD_DIR/third_party/llvm-build/Release+Asserts/bin:$CARGO_HOME/bin:$PATH
- CCACHE_CPP2=yes
- CCACHE_SLOPPINESS=time_macros
- SCCACHE_DIR=$HOME/.sccache/
- SCCACHE_CACHE_SIZE=1G
- SCCACHE_IDLE_TIMEOUT=0
- RUSTC_WRAPPER=sccache
- SCCACHE_BUCKET=deno-sccache
- AWS_ACCESS_KEY_ID=AKIAIPOYFUDOPCMWRVZA
# AWS_SECRET_ACCESS_KEY=...
- secure: "hlQoMNDWgsdFPDAIwE4VCr21w6ftD8BGLNE8w23+9wCqMs8TXCGzdzpTYzSePmToUfF1WjGQTF3advifzg7pdrUp41ThWzRkEjiRoXEORkKFuZENgLdi4ZZsvOYIfX5dfTcw7wkLEuGkywy1D9s/4uJydiVqYYM3fWI7U2ax8+wpenRH59moUeHqGGzPk8Hy4wcD7SoP+fvuOYJ+KjU2urbddwrVus9jnmXbx0Srq/L/ayBr0aLpZXcYZ3nSMnXpc9mo3YuVZQR42+ARHI5R7V1wrCa/025/O4kpSry/bipyN7Oyry/WY+9Hu3EDdlIUosJsWVHhv5s8ZuZWJG/0VITUP+MnDexGNkbbbDzzwk/7dDhTo1DRpT7fmSFVzr6J9bw4JEU9k//znLuCOnRLoWagysQUVUZQXDh7TTfMmGP0wdsUggfr8azrkZF3hjg+g+aOlz0ZpVtYQ8hdhvLQRp4pmxyQlsKygf0fFXWJvAp40KXIkrKXJ6hXIGdfWirZ3dgc8rCgVdOKi6Hy39EKOiIdP3j2J2tv3NTPkUi7z+BaDc5cPCaarR8ZvLLkv1lvYTFap/fk+TXpM3AS0hs1o91fyJ0l/P0KKTp7V8MoNC7iXhzCK/InNgpcs0rK7w7QOlEHihRlY3Ya4m3KvSRbL/P55TneX5xwr6yP719ARs4="
cache:
ccache: true
directories:
- "$CARGO_HOME"
- "$RUSTUP_HOME"
- "$HOMEBREW_PATH"
- "$SCCACHE_DIR"
- third_party/v8/build/linux/debian_sid_amd64-sysroot/
- third_party/v8/third_party/llvm-build/
install:
- nvm install v8
- nvm use --delete-prefix v8
- node -v
- |-
# OS X: install a private copy of homebrew.
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export BREW="${HOMEBREW_PATH}bin/brew"
export PATH="${HOMEBREW_PATH}bin:$PATH"
if [[ ! -x "$BREW" ]]; then
git clone git:https://github.com/homebrew/brew "$HOMEBREW_PATH"
fi
"$BREW" --version
fi
- |-
# Install ccache (if necessary) and set it up.
if [[ "$TRAVIS_OS_NAME" == "osx" && ! $(which ccache) ]]; then
"$BREW" install ccache
fi
ccache --version | head -n 1
ccache --max-size=1G
- |-
# Install Rust.
# TODO(ry) Include rustc in third_party.
Expand All @@ -61,8 +40,15 @@ install:
cargo --version
- |-
# Install and start sccache.
mkdir -p $HOME/bin
export PATH="$HOME/bin:$PATH"
if [ ! $(which sccache) ]; then
cargo install sccache
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
curl -fo $HOME/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
else
curl -fo $HOME/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-unknown-linux-musl
fi
chmod +x $HOME/bin/sccache
fi
sccache --version
sccache --start-server
Expand Down Expand Up @@ -104,17 +90,13 @@ script:
- |-
# Release build and test
bash -c "sleep 2100; pkill ninja; pkill cargo" &
./tools/build.py -C target/release -j2
DENO_BUILD_MODE=release ./tools/test.py
- |-
# Cargo check
RUSTC_WRAPPER=sccache cargo check -j2 --release
cargo check -j2 --release
after_script:
- ccache --show-stats
- sccache --stop-server
after_success:
- |
# Run benchmarks and publish the result to github pages.
Expand Down
2 changes: 1 addition & 1 deletion tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def generate_gn_args(mode):
out += os.environ["DENO_BUILD_ARGS"].split()

# Check if ccache or sccache are in the path, and if so we set cc_wrapper.
cc_wrapper = find_executable("ccache") or find_executable("sccache")
cc_wrapper = find_executable("sccache") or find_executable("ccache")
if cc_wrapper:
# The gn toolchain does not shell escape cc_wrapper, so do it here.
out += ['cc_wrapper=%s' % gn_string(shell_quote(cc_wrapper))]
Expand Down

0 comments on commit 7a0d937

Please sign in to comment.