8000 Travis install clang from tar file: · github-cloud/rippled@d46c21c · GitHub
[go: up one dir, main page]

Skip to content

Commit d46c21c

Browse files
seelabsmiguelportilla
authored andcommitted
Travis install clang from tar file:
The llvm apt repos are offline. This is a workaround to install clang directly from a tar file.
1 parent da18f7c commit d46c21c

File tree

3 files changed

+25
-35
lines changed

3 files changed

+25
-35
lines changed

.travis.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: cpp
33

44
env:
55
global:
6+
- LLVM_VERSION=3.8.0
67
# Maintenance note: to move to a new version
78
# of boost, update both BOOST_ROOT and BOOST_URL.
89
# Note that for simplicity, BOOST_ROOT's final
@@ -24,18 +25,6 @@ packages: &gcc5_pkgs
2425
# Provides a backtrace if the unittests crash
2526
- gdb
2627

27-
packages: &clang36_pkgs
28-
- clang-3.6
29-
- g++-5
30-
- python-software-properties
31-
- protobuf-compiler
32-
- libprotobuf-dev
33-
- libssl-dev
34-
- libstdc++6
35-
- binutils-gold
36-
# Provides a backtrace if the unittests crash
37-
- gdb
38-
3928
matrix:
4029
include:
4130
- compiler: gcc
@@ -50,25 +39,17 @@ matrix:
5039
addons: *ao_gcc5
5140

5241
- compiler: clang
53-
env: GCC_VER=5 TARGET=debug CLANG_VER=3.6
54-
addons: &ao_clang36
55-
apt:
56-
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
57-
packages: *clang36_pkgs
42+
env: GCC_VER=5 TARGET=debug CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
43+
addons: *ao_gcc5
5844

5945
- compiler: clang
60-
env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.6
61-
addons: *ao_clang36
62-
63-
# Temporary workaround while the llvm apt repository is down.
64-
# TODO: REMOVE THIS if/when clang builds become reliable again.
65-
allow_failures:
66-
- env: GCC_VER=5 TARGET=debug CLANG_VER=3.6
67-
- env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.6
46+
env: GCC_VER=5 TARGET=debug.nounity CLANG_VER=3.8 PATH=$PWD/llvm-$LLVM_VERSION/bin:$PATH
47+
addons: *ao_gcc5
6848

6949
cache:
7050
directories:
7151
- $BOOST_ROOT
52+
- llvm-$LLVM_VERSION
7253

7354
before_install:
7455
- bin/ci/ubuntu/install-dependencies.sh

bin/ci/ubuntu/install-dependencies.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,27 @@ do
99
test -x $( type -p ${g}-$GCC_VER )
1010
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
1111
done
12-
for c in clang clang++
13-
do
14-
test -x $( type -p ${c}-$CLANG_VER )
15-
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c}
16-
done
17-
export PATH=$PWD/bin:$PATH
12+
13+
if [[ -n ${CLANG_VER:-} ]]; then
14+
# There are cases where the directory exists, but the exe is not available.
15+
# Use this workaround for now.
16+
if [[ ! -x llvm-${LLVM_VERSION}/bin/llvm-config ]] && [[ -d llvm-${LLVM_VERSION} ]]; then
17+
rm -fr llvm-${LLVM_VERSION}
18+
fi
19+
if [[ ! -d llvm-${LLVM_VERSION} ]]; then
20+
mkdir llvm-${LLVM_VERSION}
21+
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
22+
wget -O - ${LLVM_URL} | tar -Jxvf - --strip 1 -C llvm-${LLVM_VERSION}
23+
fi
24+
llvm-${LLVM_VERSION}/bin/llvm-config --version;
25+
export LLVM_CONFIG="llvm-${LLVM_VERSION}/bin/llvm-config";
26+
fi
1827

1928
# What versions are we ACTUALLY running?
2029
if [ -x $HOME/bin/g++ ]; then
2130
$HOME/bin/g++ -v
2231
fi
23-
if [ -x $HOME/bin/clang ]; then
24-
$HOME/bin/clang -v
25-
fi
32+
2633
# Avoid `spurious errors` caused by ~/.npm permission issues
2734
# Does it already exist? Who owns? What permissions?
2835
ls -lah ~/.npm || mkdir ~/.npm

bin/sh/install-boost.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# When testing you can force a boost build by clearing travis caches:
88
# https://travis-ci.org/ripple/rippled/caches
99
set -e
10+
1011
if [ ! -d "$BOOST_ROOT/lib" ]
1112
then
1213
wget $BOOST_URL -O /tmp/boost.tar.gz
@@ -15,7 +16,8 @@ then
1516
tar xzf /tmp/boost.tar.gz
1617
cd $BOOST_ROOT && \
1718
./bootstrap.sh --prefix=$BOOST_ROOT && \
18-
./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 && ./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
19+
./b2 -d1 define=_GLIBCXX_USE_CXX11_ABI=0 -j${NUM_PROCESSORS:-2} &&\
20+
./b2 -d0 define=_GLIBCXX_USE_CXX11_ABI=0 install
1921
else
2022
echo "Using cached boost at $BOOST_ROOT"
2123
fi

0 commit comments

Comments
 (0)
0