Travis install clang from tar file:

The llvm apt repos are offline. This is a workaround to install clang
directly from a tar file.
This commit is contained in:
seelabs
2016-06-16 15:09:50 -04:00
committed by Miguel Portilla
parent da18f7c053
commit d46c21cc5f
3 changed files with 25 additions and 35 deletions

View File

@@ -3,6 +3,7 @@ language: cpp
env: env:
global: global:
- LLVM_VERSION=3.8.0
# Maintenance note: to move to a new version # Maintenance note: to move to a new version
# of boost, update both BOOST_ROOT and BOOST_URL. # of boost, update both BOOST_ROOT and BOOST_URL.
# Note that for simplicity, BOOST_ROOT's final # Note that for simplicity, BOOST_ROOT's final
@@ -24,18 +25,6 @@ packages: &gcc5_pkgs
# Provides a backtrace if the unittests crash # Provides a backtrace if the unittests crash
- gdb - gdb
packages: &clang36_pkgs
- clang-3.6
- g++-5
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- libssl-dev
- libstdc++6
- binutils-gold
# Provides a backtrace if the unittests crash
- gdb
matrix: matrix:
include: include:
- compiler: gcc - compiler: gcc
@@ -50,25 +39,17 @@ matrix:
addons: *ao_gcc5 addons: *ao_gcc5
- compiler: clang - compiler: clang
env: GCC_VER=5 TARGET=debug CLANG_VER=3.6 env: GCC_VER=5 TARGET=debug CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
addons: &ao_clang36 addons: *ao_gcc5
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: *clang36_pkgs
- compiler: clang - compiler: clang
env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.6 env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
addons: *ao_clang36 addons: *ao_gcc5
# Temporary workaround while the llvm apt repository is down.
# TODO: REMOVE THIS if/when clang builds become reliable again.
allow_failures:
- env: GCC_VER=5 TARGET=debug CLANG_VER=3.6
- env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.6
cache: cache:
directories: directories:
- $BOOST_ROOT - $BOOST_ROOT
- llvm-$LLVM_VERSION
before_install: before_install:
- bin/ci/ubuntu/install-dependencies.sh - bin/ci/ubuntu/install-dependencies.sh

View File

@@ -9,20 +9,27 @@ do
test -x $( type -p ${g}-$GCC_VER ) test -x $( type -p ${g}-$GCC_VER )
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g} ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
done done
for c in clang clang++
do if [[ -n ${CLANG_VER:-} ]]; then
test -x $( type -p ${c}-$CLANG_VER ) # There are cases where the directory exists, but the exe is not available.
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c} # Use this workaround for now.
done if [[ ! -x llvm-${LLVM_VERSION}/bin/llvm-config ]] && [[ -d llvm-${LLVM_VERSION} ]]; then
export PATH=$PWD/bin:$PATH rm -fr llvm-${LLVM_VERSION}
fi
if [[ ! -d llvm-${LLVM_VERSION} ]]; then
mkdir llvm-${LLVM_VERSION}
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
wget -O - ${LLVM_URL} | tar -Jxvf - --strip 1 -C llvm-${LLVM_VERSION}
fi
llvm-${LLVM_VERSION}/bin/llvm-config --version;
export LLVM_CONFIG="llvm-${LLVM_VERSION}/bin/llvm-config";
fi
# What versions are we ACTUALLY running? # What versions are we ACTUALLY running?
if [ -x $HOME/bin/g++ ]; then if [ -x $HOME/bin/g++ ]; then
$HOME/bin/g++ -v $HOME/bin/g++ -v
fi fi
if [ -x $HOME/bin/clang ]; then
$HOME/bin/clang -v
fi
# Avoid `spurious errors` caused by ~/.npm permission issues # Avoid `spurious errors` caused by ~/.npm permission issues
# Does it already exist? Who owns? What permissions? # Does it already exist? Who owns? What permissions?
ls -lah ~/.npm || mkdir ~/.npm ls -lah ~/.npm || mkdir ~/.npm

View File

@@ -7,6 +7,7 @@
# When testing you can force a boost build by clearing travis caches: # When testing you can force a boost build by clearing travis caches:
# https://travis-ci.org/ripple/rippled/caches # https://travis-ci.org/ripple/rippled/caches
set -e set -e
if [ ! -d "$BOOST_ROOT/lib" ] if [ ! -d "$BOOST_ROOT/lib" ]
then then
wget $BOOST_URL -O /tmp/boost.tar.gz wget $BOOST_URL -O /tmp/boost.tar.gz
@@ -15,7 +16,8 @@ then
tar xzf /tmp/boost.tar.gz tar xzf /tmp/boost.tar.gz
cd $BOOST_ROOT && \ cd $BOOST_ROOT && \
./bootstrap.sh --prefix=$BOOST_ROOT && \ ./bootstrap.sh --prefix=$BOOST_ROOT && \
./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 && ./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install ./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 -j${NUM_PROCESSORS:-2} &&\
./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
else else
echo "Using cached boost at $BOOST_ROOT" echo "Using cached boost at $BOOST_ROOT"
fi fi