Skip to content

Commit

Permalink
Try to fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
biddisco committed Jan 14, 2021
1 parent 269a269 commit dc018eb
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 30 deletions.
62 changes: 32 additions & 30 deletions .travis.yml
@@ -1,53 +1,55 @@
sudo: false
language: cpp
dist: bionic
os: linux

# NB. boost installation/vars copied from main rippled travis config

env:
global:
- LLVM_VERSION=3.8.0
# Maintenance note: to move to a new version
# of boost, update both BOOST_ROOT and BOOST_URL.
# Note that for simplicity, BOOST_ROOT's final
# namepart must match the folder name internal
# to boost's .tar.gz.
- LCOV_ROOT=$HOME/lcov
- BOOST_ROOT=$HOME/boost_1_67_0
- BOOST_URL='http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz'
- LLVM_VERSION=6.0.0
- CACHE_DIR=${TRAVIS_HOME}/_cache
- BOOST_ROOT=${CACHE_DIR}/boost_1_71_0
# this is NOT used by linux container based builds (which already have boost installed)
- BOOST_URL='https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2'
# Alternate dowload location
- BOOST_URL2='https://downloads.sourceforge.net/project/boost/boost/1.71.0/boost_1_71_0.tar.bz2?r=&ts=1594393912&use_mirror=newcontinuum'
# Travis downloader doesn't seem to have updated certs. Using this option
# introduces obvious security risks, but they're Travis's risks.
# Note that this option is only used if the "normal" build fails.
- BOOST_WGET_OPTIONS='--no-check-certificate'

addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages:
- gcc-5
- g++-5
- python-software-properties
- protobuf-compiler
- libprotobuf-dev
- gcc-8
- g++-8
- libssl-dev
- libstdc++6
- binutils-gold
- cmake
- lcov
- gdb

matrix:
include:
- compiler: gcc
env:
- GCC_VER=5
- compiler: gcc-8
env:
- CC=/usr/bin/gcc-8
- CXX=/usr/bin/g++-8
- GCC_VER=8
- BUILD_TYPE=Debug
- PARALLEL_TESTS='false'
- CMAKE_EXTRA_ARGS='-Werr=ON -Dcoverage=ON -DLIBPPDEMO_DOWNLOAD_RIPPLED=ON'
- CMAKE_EXTRA_ARGS='-Werr=ON -Dcoverage=ON'
- PATH=$PWD/cmake/bin:$PATH
- APP=ripplelibppdemo

cache:
timeout: 10
directories:
- $BOOST_ROOT

notifications:
email:
false
irc:
channels:
- "chat.freenode.net#ripple-dev"
- $CACHE_DIR

install:
- travis_wait ${MAX_TIME_MIN} ./scripts/install_boost.sh

script:
- cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_DEBUG=ON -DBOOST_ROOT=$BOOST_ROOT -DLIBPPDEMO_DOWNLOAD_RIPPLED=ON $CMAKE_EXTRA_ARGS .
- cmake --build build --config $BUILD_TYPE .

93 changes: 93 additions & 0 deletions scripts/install_boost.sh
@@ -0,0 +1,93 @@
#!/usr/bin/env bash
# Assumptions:
# 1) BOOST_ROOT and BOOST_URL are already defined,
# and contain valid values. BOOST_URL2 may be defined
# as a fallback. BOOST_WGET_OPTIONS may be defined with
# retry options if the download(s) fail on the first try.
# 2) The last namepart of BOOST_ROOT matches the
# folder name internal to boost's .tar.gz
# When testing you can force a boost build by clearing travis caches:
# https://travis-ci.org/ripple/rippled/caches
set -exu

odir=$(pwd)
: ${BOOST_TOOLSET:=msvc-14.1}

if [[ -d "$BOOST_ROOT/lib" || -d "${BOOST_ROOT}/stage/lib" ]] ; then
echo "Using cached boost at $BOOST_ROOT"
exit
fi

#fetch/unpack:
fn=$(basename -- "$BOOST_URL")
ext="${fn##*.}"
wopt="--quiet"
wget ${wopt} $BOOST_URL -O /tmp/boost.tar.${ext} || \
( [ -n "${BOOST_URL2}" ] && \
wget ${wopt} $BOOST_URL2 -O /tmp/boost.tar.${ext} ) || \
( [ -n "${BOOST_WGET_OPTIONS}" ] &&
( wget ${wopt} ${BOOST_WGET_OPTIONS} $BOOST_URL -O /tmp/boost.tar.${ext} || \
( [ -n "${BOOST_URL2}" ] && \
wget ${wopt} ${BOOST_WGET_OPTIONS} $BOOST_URL2 -O /tmp/boost.tar.${ext} )
)
)
cd $(dirname $BOOST_ROOT)
rm -fr ${BOOST_ROOT}
mkdir ${BOOST_ROOT}
tar xf /tmp/boost.tar.${ext} -C ${BOOST_ROOT} --strip-components 1
cd $BOOST_ROOT

BLDARGS=()
if [[ ${BOOST_BUILD_ALL:-false} == "true" ]]; then
# we never need boost-python...so even for ALL
# option we can skip it
BLDARGS+=(--without-python)
else
BLDARGS+=(--with-chrono)
BLDARGS+=(--with-container)
BLDARGS+=(--with-context)
BLDARGS+=(--with-coroutine)
BLDARGS+=(--with-date_time)
BLDARGS+=(--with-filesystem)
BLDARGS+=(--with-program_options)
BLDARGS+=(--with-regex)
BLDARGS+=(--with-system)
BLDARGS+=(--with-atomic)
BLDARGS+=(--with-thread)
fi
BLDARGS+=(-j$((2*${NUM_PROCESSORS:-2})))
BLDARGS+=(--prefix=${BOOST_ROOT}/_INSTALLED_)
BLDARGS+=(-d0) # suppress messages/output

if [[ -z ${COMSPEC:-} ]]; then
if [[ "$(uname)" == "Darwin" ]] ; then
BLDARGS+=(cxxflags="-std=c++14 -fvisibility=default")
else
BLDARGS+=(cxxflags="-std=c++14")
BLDARGS+=(runtime-link="static,shared")
fi
BLDARGS+=(--layout=tagged)
./bootstrap.sh
./b2 "${BLDARGS[@]}" stage
./b2 "${BLDARGS[@]}" install
else
BLDARGS+=(runtime-link="static,shared")
BLDARGS+=(--layout=versioned)
BLDARGS+=(--toolset="${BOOST_TOOLSET}")
BLDARGS+=(address-model=64)
BLDARGS+=(architecture=x86)
BLDARGS+=(link=static)
BLDARGS+=(threading=multi)
cmd /E:ON /D /S /C"bootstrap.bat"
./b2.exe "${BLDARGS[@]}" stage
./b2.exe "${BLDARGS[@]}" install
fi

if [[ ${CI:-false} == "true" ]]; then
# save some disk space...these are mostly
# obj files and don't need to be kept in CI contexts
rm -rf bin.v2
fi

cd $odir

0 comments on commit dc018eb

Please sign in to comment.