From 844796972acdcaf16e96a90e96ed354438f70a3a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 28 Jul 2015 16:26:30 +0200 Subject: [travis] Switch to container-based build using plain cmake and make --- .travis.yml | 58 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 15 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 9128c24e..03d5c720 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,32 +2,60 @@ # provides GNU GCC 4.6, which does not support -std=c++11 GNU GCC 4.8 is installed # NOTE: Please validate this file after editing it using -# Travis WebLint http://lint.travis-ci.org/ -# or travis-yaml https://github.com/travis-ci/travis-yaml +# Travis WebLint https://lint.travis-ci.org/ +# or travis-lint https://github.com/travis-ci/travis-lint language: cpp compiler: - clang - gcc +sudo: false +cache: + apt: true + +matrix: + include: + - os: linux + compiler: clang + - os: linux + compiler: g++-4.8 + - os: osx + compiler: clang + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + - boost-latest + packages: + - gcc-4.8 + - g++-4.8 + - libgmp-dev + - libmpfr-dev + - libedit-dev + - libboost1.55-dev + - libboost-test1.55-dev + - libboost-regex1.55-dev + - libboost-python1.55-dev + - libboost-system1.55-dev + - libboost-date-time1.55-dev + - libboost-iostreams1.55-dev + - libboost-filesystem1.55-dev + - libboost-serialization1.55-dev before_install: - # Add software package repositories with recent versions of gcc and boost - - sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes - - sudo add-apt-repository ppa:boost-latest/ppa --yes - - sudo apt-get update -qq - -install: - # Install GNU GCC 4.8 required by use of C++11 - - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8 gcc-4.8; fi - - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - # Install Ledger dependencies - - sudo apt-get install -qq libboost1.55 libgmp-dev libmpfr-dev libeditline-dev + - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew update; fi + +install: + - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then for formula in gmp mpfr boost boost-python; do brew outdated $formula || brew install $formula; done; fi before_script: - - ./acprep debug make --python + #- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi + - cmake . -DUSE_PYTHON=ON + - make script: - - ./acprep check --jobs $(nproc) -- --output-on-failure + - make test - PYTHONPATH=. python python/demo.py notifications: -- cgit v1.2.3 From f0f4d7e66f9adf5610aaf6d65c160621a79c10da Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 28 Jul 2015 20:35:56 +0200 Subject: [travis] Remove multi-os build configuration --- .travis.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 03d5c720..fee32bef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,15 +13,6 @@ sudo: false cache: apt: true -matrix: - include: - - os: linux - compiler: clang - - os: linux - compiler: g++-4.8 - - os: osx - compiler: clang - addons: apt: sources: @@ -43,14 +34,8 @@ addons: - libboost-filesystem1.55-dev - libboost-serialization1.55-dev -before_install: - - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew update; fi - -install: - - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then for formula in gmp mpfr boost boost-python; do brew outdated $formula || brew install $formula; done; fi - before_script: - #- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi + - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - cmake . -DUSE_PYTHON=ON - make -- cgit v1.2.3 From c4db52614e75e1c564ab4591e1dc5240d33a2293 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Tue, 28 Jul 2015 23:01:48 +0200 Subject: [travis] Run documentation checks as reports which are allowed to fail instead of strict tests. --- .travis.yml | 6 +++++- test/CMakeLists.txt | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index fee32bef..c573057d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,13 +36,17 @@ addons: before_script: - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - - cmake . -DUSE_PYTHON=ON + - cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON - make script: - make test - PYTHONPATH=. python python/demo.py +after_script: + - python test/CheckTexinfo.py -l ledger -s . + - python test/CheckManpage.py -l ledger -s . + notifications: email: on_success: change diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6eb9f956..0e7d5f2c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -47,7 +47,9 @@ if (PYTHONINTERP_FOUND) set_target_properties(check PROPERTIES DEPENDS ${_class}Test_${TestFile_Name}) endforeach() - list(APPEND CheckOptions CheckManpage CheckTexinfo CheckBaselineTests) + # CheckManpage and CheckTexinfo are disabled, since they do not work + # reliably yet, instead they are being run as a Travis CI report. + list(APPEND CheckOptions CheckBaselineTests) #CheckManpage CheckTexinfo foreach(_class ${CheckOptions}) add_test(NAME ${_class} COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/${_class}.py -- cgit v1.2.3 From 81ee98c17c96aed21d437457e4917fe6a3a8c47b Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 29 Jul 2015 00:21:08 +0200 Subject: [travis] Add multi-os build configuration and use a custom build of boost. --- .travis.yml | 66 ++++++++++++++++++++++++++++++++++-------- tools/travis-before_install.sh | 16 ++++++++++ tools/travis-install.sh | 22 ++++++++++++++ 3 files changed, 92 insertions(+), 12 deletions(-) create mode 100755 tools/travis-before_install.sh create mode 100755 tools/travis-install.sh (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index c573057d..abfa903b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,35 +7,75 @@ language: cpp compiler: - - clang - gcc + - clang +os: + - linux + - osx sudo: false cache: apt: true +env: + global: + # Boost version to use. + - BOOST_VERSION="1.58.0" + # List of required boost libraries to build + - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test" + # List of required Homebrew formulae to install + - BREWS="gmp,mpfr" + +matrix: + exclude: + - os: linux + compiler: clang + # Compiling ledger on Linux with clang + # either crashes clang or results in a ledger binary that crashes with SIGSEGV. + - os: osx + compiler: gcc + # On Mac OS X building ledger with GNU GCC 4.8 fails due to + # undefined symbols, maybe because boost was not being built with g++-4.8. + # Undefined symbols for architecture x86_64: + # "boost::re_detail::perl_matcher >, boost::regex_traits > >::construct_init(boost::basic_regex > > const&, boost::regex_constants::_match_flags)", referenced from: + # boost::re_detail::perl_matcher >, boost::regex_traits > >::perl_matcher(char const*, char const*, boost::match_results > >&, boost::basic_regex > > const&, boost::regex_constants::_match_flags, char const*) in main.cc.o + # boost::re_detail::perl_matcher >, boost::regex_traits > >::perl_matcher(char const*, char const*, boost::match_results > >&, boost::basic_regex > > const&, boost::regex_constants::_match_flags, char const*) in global.cc.o + # "boost::re_detail::perl_matcher >, boost::regex_traits > >::find()", referenced from: + # bool boost::regex_search > >(char const*, char const*, boost::basic_regex > > const&, boost::regex_constants::_match_flags) in main.cc.o + # bool boost::regex_search > >(char const*, char const*, boost::basic_regex > > const&, boost::regex_constants::_match_flags) in global.cc.o + addons: apt: sources: - ubuntu-toolchain-r-test - - boost-latest + #- boost-latest packages: - gcc-4.8 - g++-4.8 - libgmp-dev - libmpfr-dev - libedit-dev - - libboost1.55-dev - - libboost-test1.55-dev - - libboost-regex1.55-dev - - libboost-python1.55-dev - - libboost-system1.55-dev - - libboost-date-time1.55-dev - - libboost-iostreams1.55-dev - - libboost-filesystem1.55-dev - - libboost-serialization1.55-dev + #- libboost1.55-dev + #- libboost-test1.55-dev + #- libboost-regex1.55-dev + #- libboost-python1.55-dev + #- libboost-system1.55-dev + #- libboost-date-time1.55-dev + #- libboost-iostreams1.55-dev + #- libboost-filesystem1.55-dev + #- libboost-serialization1.55-dev + +before_install: + - if [ -n "${BOOST_VERSION}" ]; then export BOOST_ROOT="${TRAVIS_BUILD_DIR}/../boost-trunk"; export CMAKE_MODULE_PATH="${BOOST_ROOT}"; fi + - if [ "${CXX}" = "g++" ]; then export CXX="$(which g++-4.8)"; export CC="$(which gcc-4.8)"; fi + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export DYLD_LIBRARY_PATH="${BOOST_ROOT}/lib"; fi + # c++ is a symlink to clang++, but the compiler behaves differently when invoked as c++ + - if [ "${TRAVIS_OS_NAME}" = "osx" -a "${CXX}" = "clang++" ]; then export CXX="$(which c++)"; export CC="$(which cc)"; fi + - tools/travis-before_install.sh + +install: + - tools/travis-install.sh before_script: - - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON - make @@ -44,6 +84,8 @@ script: - PYTHONPATH=. python python/demo.py after_script: + # These scripts are run for informational purposes and + # should be reintegrated into CTest once they reliably verify the documentation. - python test/CheckTexinfo.py -l ledger -s . - python test/CheckManpage.py -l ledger -s . diff --git a/tools/travis-before_install.sh b/tools/travis-before_install.sh new file mode 100755 index 00000000..fe010945 --- /dev/null +++ b/tools/travis-before_install.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +#set -x +set -e +set -o pipefail + +if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + brew update +fi + +if [ -n "${BOOST_VERSION}" ]; then + mkdir -p $BOOST_ROOT + wget --no-verbose --output-document=- \ + http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION//./_}.tar.bz2/download \ + | tar jxf - --strip-components=1 -C "${BOOST_ROOT}" +fi diff --git a/tools/travis-install.sh b/tools/travis-install.sh new file mode 100755 index 00000000..4e8bdc48 --- /dev/null +++ b/tools/travis-install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +#set -x +set -e +set -o pipefail + +if [ "${TRAVIS_OS_NAME}" = "osx" ]; then + for formula in $(echo "${BREWS//,/ }"); do + echo "Checking ${formula} formula" + brew outdated "${formula}" \ + || (brew unlink "${formula}" + brew install "${formula}" + ) + done +fi + +if [ -d "${BOOST_ROOT}" ]; then + (cd "${BOOST_ROOT}" + ./bootstrap.sh --with-libraries="${BOOST_LIBS}" + ./b2 threading=multi --prefix="${BOOST_ROOT}" -d0 install + ) +fi -- cgit v1.2.3 From 523413d8f14d3896ed3ffc2cd4e3fcd585044fef Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 31 Jul 2015 13:00:10 +0200 Subject: [travis] Use boost 1.49.0 for master branch builds and boost 1.58.0 for all other branches. --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index abfa903b..06ead752 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,11 @@ cache: env: global: - # Boost version to use. - - BOOST_VERSION="1.58.0" + # Boost version to use: + # _MIN is used when building the master branch + # _MAX is used when building any other branch + - BOOST_VERSION_MIN="1.49.0" + - BOOST_VERSION_MAX="1.58.0" # List of required boost libraries to build - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test" # List of required Homebrew formulae to install @@ -65,6 +68,7 @@ addons: #- libboost-serialization1.55-dev before_install: + - if [ "${TRAVIS_BRANCH}" = "master" ]; then export BOOST_VERSION="${BOOST_VERSION_MIN}"; else export BOOST_VERSION="${BOOST_VERSION_MAX}"; fi - if [ -n "${BOOST_VERSION}" ]; then export BOOST_ROOT="${TRAVIS_BUILD_DIR}/../boost-trunk"; export CMAKE_MODULE_PATH="${BOOST_ROOT}"; fi - if [ "${CXX}" = "g++" ]; then export CXX="$(which g++-4.8)"; export CC="$(which gcc-4.8)"; fi - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then export DYLD_LIBRARY_PATH="${BOOST_ROOT}/lib"; fi -- cgit v1.2.3 From 80fa6e402aff4c123f4d54ba7e5db5682ef6ab0a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 5 Aug 2015 00:13:32 +0200 Subject: [travis] Configure coverity scan --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 06ead752..991cb755 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,8 @@ env: - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test" # List of required Homebrew formulae to install - BREWS="gmp,mpfr" + # Encrypted COVERITY_SCAN_TOKEN + - secure: "mYNxD1B8WNSvUeKzInehZ7syi2g1jH2ymeSQxoeKKD2duq3pvNWPdZdc4o9MlWQcAqcz58rhFZRIpuEWCnP0LbbJaG+MyuemMn9uAmg9Y4gFpMsBPHuTdf8pO3rDex+tkrr9puEJFgL+QV/TehxO6NDDpx7UdYvJb+4aZD/auYI=" matrix: exclude: @@ -47,6 +49,13 @@ matrix: # bool boost::regex_search > >(char const*, char const*, boost::basic_regex > > const&, boost::regex_constants::_match_flags) in global.cc.o addons: + coverity_scan: + project: + name: "ledger/ledger" + description: "Build submitted via Travis CI>" + build_command_prepend: "cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON -DCLANG_GCOV=ON" + build_command: "make" + branch_pattern: coverity_scan apt: sources: - ubuntu-toolchain-r-test -- cgit v1.2.3 From eff53dbf9d6ea6319a61c4c7905cdd51bbaa464a Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 5 Aug 2015 00:20:52 +0200 Subject: [travis] Rename coverity scan branch Fix typo --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 991cb755..6ae2d8d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,10 +52,10 @@ addons: coverity_scan: project: name: "ledger/ledger" - description: "Build submitted via Travis CI>" + description: "Build submitted via Travis CI" build_command_prepend: "cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON -DCLANG_GCOV=ON" build_command: "make" - branch_pattern: coverity_scan + branch_pattern: coverity apt: sources: - ubuntu-toolchain-r-test -- cgit v1.2.3 From b213372d9cf5fa18726d3496e53c1aa7a3c61243 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 5 Aug 2015 09:49:28 +0200 Subject: [travis] Enable verbose failures --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 6ae2d8d1..98b0ab82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,7 +93,7 @@ before_script: - make script: - - make test + - ctest --output-on-failure - PYTHONPATH=. python python/demo.py after_script: -- cgit v1.2.3