diff options
author | Martin Nowack <martin_nowack@tu-dresden.de> | 2018-01-27 22:04:46 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-01-30 22:09:00 +0000 |
commit | c4a8b2901160568fba95b33d73a7792e0ba32c50 (patch) | |
tree | 895b08c9d65717d5ed5703a2e3f4175e3b19e26b | |
parent | e432297c3e43a476a6d97b6f1bf39bb2859816ce (diff) | |
download | klee-c4a8b2901160568fba95b33d73a7792e0ba32c50.tar.gz |
Enable caching for travis-ci
* Use ccache for building * Implement caching of locally build brew packages
-rw-r--r-- | .travis.yml | 3 | ||||
-rwxr-xr-x | .travis/install-llvm-and-runtime-compiler.sh | 18 |
2 files changed, 14 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index 01bac7a1..7f7d236c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,6 +100,7 @@ addons: - lcov cache: + ccache: true apt: true directories: - $HOME/Library/Caches/Homebrew @@ -110,7 +111,7 @@ before_install: ########################################################################### # Update package information - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew tap klee/klee; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew tap klee/klee && brew install ccache && export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi ########################################################################### # Set up out of source build directory ########################################################################### diff --git a/.travis/install-llvm-and-runtime-compiler.sh b/.travis/install-llvm-and-runtime-compiler.sh index 6c9bc009..bd34d843 100755 --- a/.travis/install-llvm-and-runtime-compiler.sh +++ b/.travis/install-llvm-and-runtime-compiler.sh @@ -8,12 +8,18 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 20 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 20 elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - # NOTE: We should not easily generalize, since we need the corresponding support of bottled formulas - if [ "${LLVM_VERSION}" == "3.4" ]; then - brew install llvm34 - else - echo "Error: Requested to install LLVM ${LLVM_VERSION} on macOS, which is not supported" - exit 1 + # We use our own local cache if possible + set +e + brew install $HOME/Library/Caches/Homebrew/llvm\@${LLVM_VERSION}*.bottle.tar.gz + RES=$? + set -ev + if [ ${RES} -ne 0 ]; then + # This might build the llvm package use a time out to avoid dumping log information + brew install -v --build-bottle "llvm@${LLVM_VERSION}" + # Now bottle the brew + brew bottle llvm\@${LLVM_VERSION} + # Not make sure it's cached + cp llvm\@${LLVM_VERSION}*.bottle.tar.gz $HOME/Library/Caches/Homebrew/ fi else echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\"" |