summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2019-04-29 15:03:07 -0700
committerVictor Costan <pwnall@chromium.org>2019-04-29 15:38:15 -0700
commit3724030179716fd8d95cf79339884c49afade8f9 (patch)
tree2faf420d92a9aea78d86006bf64f95180e303fcd
parent3dc9202f78a3eb30ee8c0267e4e4be2e3f986e45 (diff)
downloadleveldb-3724030179716fd8d95cf79339884c49afade8f9.tar.gz
Update Travis CI configuration.
The Travis configuration: 1) Installs recent versions of clang and GCC. 2) Sets up the environment so that CMake picks up the installed compilers. Previously, the pre-installed clang compiler was used instead. 3) Requests a modern macOS image that has all the headers needed by GCC. The CL also removes now-unnecessary old workarounds from the Travis configuration. PiperOrigin-RevId: 245831188
-rw-r--r--.travis.yml55
1 files changed, 29 insertions, 26 deletions
diff --git a/.travis.yml b/.travis.yml
index 0e1ad6a..436e037 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,35 +1,29 @@
-# Build matrix / environment variable are explained on:
+# Build matrix / environment variables are explained on:
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on: http://lint.travis-ci.org/
-dist: xenial
language: cpp
+dist: xenial
+osx_image: xcode10.2
compiler:
- - gcc
- - clang
+- gcc
+- clang
os:
- - linux
- - osx
+- linux
+- osx
env:
- - BUILD_TYPE=Debug
- - BUILD_TYPE=RelWithDebInfo
-
-matrix:
- exclude:
- # GCC fails on recent Travis OSX images.
- # https://github.com/travis-ci/travis-ci/issues/9640
- - compiler: gcc
- os: osx
+- BUILD_TYPE=Debug
+- BUILD_TYPE=RelWithDebInfo
addons:
apt:
sources:
- - llvm-toolchain-xenial-7
+ - llvm-toolchain-xenial-8
- ubuntu-toolchain-r-test
packages:
- - clang-7
+ - clang-8
- cmake
- gcc-8
- g++-8
@@ -40,24 +34,33 @@ addons:
- ninja-build
homebrew:
packages:
+ - cmake
- crc32c
+ - gcc@8
- gperftools
- kyotocabinet
- - gcc@7
+ - llvm@8
- ninja
- snappy
- sqlite3
-
-before_install:
-# The Travis VM image for Mac already has a link at /usr/local/include/c++,
-# causing Homebrew's gcc installation to error out. This was reported to
-# Homebrew maintainers at https://github.com/Homebrew/brew/issues/1742 and
-# removing the link emerged as a workaround.
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then rm -f /usr/local/include/c++ ; fi
+ update: true
install:
-# /usr/bin/gcc is stuck to old versions on both Linux and OSX.
+# The following Homebrew packages aren't linked by default, and need to be
+# prepended to the path explicitly.
+- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+ export PATH="$(brew --prefix llvm)/bin:$PATH";
+ fi
+# /usr/bin/gcc points to an older compiler on both Linux and macOS.
- if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
+# /usr/bin/clang points to an older compiler on both Linux and macOS.
+#
+# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
+# below don't work on macOS. Fortunately, the path change above makes the
+# default values (clang and clang++) resolve to the correct compiler on macOS.
+- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+ if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi;
+ fi
- echo ${CC}
- echo ${CXX}
- ${CXX} --version