-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Description
I'm compiling with multiple gcc version like:
compiler: - gcc - clang env: - GCC_VERSION=5 - GCC_VERSION=6 script: - if [[ "${TRAVIS_OS_NAME}" == 'linux' && "${CXX}" == 'clang++' ]]; then export MYSQL_BUILD_CC=/usr/bin/clang-3.8 MYSQL_BUILD_CXX=/usr/bin/clang++-3.8; fi - if [[ "${TRAVIS_OS_NAME}" == 'linux' && "${CXX}" == 'g++' ]]; then export MYSQL_BUILD_CC=/usr/bin/gcc-${GCC_VERSION} MYSQL_BUILD_CXX=/usr/bin/g++-${GCC_VERSION}; fi - ....
I'm trying to work out how to set CACHE_NAME so each GCC version gets a unique name. This is to solve the problem that the builds are concurrent and will override each others ccache rather than aggregating them or separating them.
As the cache is retrieved before the before_install
phase (https://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecycle) it can't be scripted.
The following did appear to work.
env: - GCC_VERSION=5 CACHE_NAME=${TRAVIS_OS_NAME}-${CC}-${GCC_VERSION} - GCC_VERSION=6
Setting environment variables from .travis.yml $ export GCC_VERSION=5 $ export CACHE_NAME=${TRAVIS_OS_NAME}-${CC}-${GCC_VERSION} $ export CXX=clang++ $ export CC=clang $ export PATH=/usr/lib/ccache:$PATH cache.1 Setting up build cache $ export CASHER_DIR=$HOME/.casher $ Installing caching utilities attempting to download cache archive fetching 10.2-travis-clang/cache-linux-trusty-a16944a9cbbaae897e8d1989ff7a3a8a7e71250b5c80f0949f1755d4f7bdf8ab--compiler-clang.tgz found cache
Is this how CACHE_NAME meant to be used?
Metadata
Metadata
Assignees
Labels
No labels