From 9566342d28fedf3bf90c1a5ee4cc8e6246585ed8 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Wed, 16 Sep 2015 11:10:24 -0700 Subject: [PATCH] Build gflags from source for Travis Summary: Unfortunately it is not easily possible to install gflags as a package on Travis. Change the Travis script to download and build gflags. This patch avoids "sudo make install" so that we can continue to use Travis' container-based infrastructure. Test Plan: Run tests on Travis. Reviewers: sdong, igor Reviewed By: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D47037 --- .travis.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98004feb6..25404905c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,23 @@ matrix: addons: apt: sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6'] - packages: ['clang-3.6', 'zlib1g-dev', 'libbz2-dev', 'libsnappy-dev', 'libgflags-dev'] + packages: ['clang-3.6', 'zlib1g-dev', 'libbz2-dev', 'libsnappy-dev', 'curl'] - os: osx compiler: clang +install: + # Build gflags + # TODO(noetzli): Remove when gflags available through Travis + - pushd /tmp/ && curl -L https://github.com/gflags/gflags/archive/v2.1.2.tar.gz -o gflags.tar.gz && tar xfz gflags.tar.gz && cd gflags-2.1.2 && cmake && make && popd + before_script: - - if [ -n "${COMPILER}" ]; then CXX=${COMPILER}; fi - - if [[ $(uname -s) == 'Darwin' ]]; then brew install gflags snappy; fi - - ulimit -n 2000 || true + # Add gflags to include/library paths + # TODO(noetzli): Remove when gflags available through Travis + - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/tmp/gflags-2.1.2/lib" + - export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/tmp/gflags-2.1.2/include" + - if [ -n "${COMPILER}" ]; then CXX=${COMPILER}; fi + - if [[ $(uname -s) == 'Darwin' ]]; then brew install gflags snappy; fi + - ulimit -n 2000 || true # Lousy hack to disable use and testing of fallocate, which doesn't behave quite # as EnvPosixTest::AllocateTest expects within the Travis OpenVZ environment.