From 458594d43afb1eaa65c09862bec9606d918043df Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 1 Sep 2018 09:03:11 +0100 Subject: [PATCH 1/4] Add better Appveyor and Travis support. --- .travis.yml | 283 +++++++++++++++++++++++++++++++++++++++++---------- appveyor.yml | 62 +++++++++++ 2 files changed, 291 insertions(+), 54 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 07aa1b3b..60c604a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,65 +1,240 @@ -# Use, modification, and distribution are -# subject to the Boost Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# -# Mael Valais, 2016 -# This travis file has been inspired from boostorg/geometry/circle.yml. -# -# This file is intended to make use of travis-ci, a continuous integration -# service. The purpose is to build and run the tests on the graph module -# on every push, and be able to know if those commits are "clean" or if -# they break the build. -# - -# I think that we shouldn't restrict on branches: PRs must also be tested -# So for now, I disabled the "only on branches" feature -#branches: -# only: -# - master -# - develop -# - test +# Copyright 2016, 2017 Peter Dimov +# Copyright 2018 Joh Maddock +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) language: cpp -compiler: gcc + +sudo: false + +python: "2.7" + +os: + - linux + - osx + +branches: + only: + - master + - develop env: - global: - - BOOST_BRANCH=$([[ "$TRAVIS_BRANCH" = "master" ]] && echo master || echo develop) - - BOOST=boost-local # must be different from graph/boost dir name -addons: - apt: - sources: ubuntu-toolchain-r-test - packages: g++-4.8 + matrix: + - BOGUS_JOB=true -before_install: - # Clone boost repository - - cd - - mkdir $BOOST && cd $BOOST - - git init . - - git remote add --no-tags -t $BOOST_BRANCH origin https://github.com/boostorg/boost.git - - git fetch --depth=1 - - git checkout $BOOST_BRANCH - - git submodule update --init --merge - - git remote set-branches --add origin $BOOST_BRANCH - - git pull --recurse-submodules - - git submodule update --init - - git checkout $BOOST_BRANCH - - git submodule foreach "git reset --quiet --hard; git clean -fxd" - - git reset --hard; git clean -fxd - - git status +matrix: - # replace the content of the library with the currently tested repo - - cd && pwd && ls - - rm -rf $BOOST/libs/graph - - cd $TRAVIS_BUILD_DIR && cd .. - - mv graph $HOME/$BOOST/libs/ + exclude: + - env: BOGUS_JOB=true - # build b2 and create headers - - cd && cd $BOOST + include: + - os: linux + compiler: g++-4.4 + env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x + addons: + apt: + packages: + - g++-4.4 + sources: + - ubuntu-toolchain-r-test + + - os: linux + compiler: g++-4.6 + env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x + addons: + apt: + packages: + - g++-4.6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.8 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 + addons: + apt: + packages: + - g++-4.9 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14 + addons: + apt: + packages: + - g++-5 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - g++-6 + sources: + - ubuntu-toolchain-r-test + + - os: linux + dist: trusty + compiler: g++-7 + env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 + addons: + apt: + packages: + - g++-7 + sources: + - ubuntu-toolchain-r-test + + - os: linux + dist: trusty + compiler: g++-8 + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17 + addons: + apt: + packages: + - g++-8 + sources: + - ubuntu-toolchain-r-test + + - os: linux + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11 + addons: + apt: + packages: + - clang-3.5 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11 + addons: + apt: + packages: + - clang-3.6 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11 + addons: + apt: + packages: + - clang-3.7 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.8 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + + - os: linux + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-3.9 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.9 + + - os: linux + compiler: clang++-4.0 + env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-4.0 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-4.0 + + - os: linux + compiler: clang++-5.0 + env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z + addons: + apt: + packages: + - clang-5.0 + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-5.0 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode8.2 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode8.1 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode8.0 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode6.4 + + +install: + - cd .. + - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - git submodule update --init tools/boostdep + - cp -r $TRAVIS_BUILD_DIR/* libs/graph + - python tools/boostdep/depinst/depinst.py graph - ./bootstrap.sh - ./b2 headers -# This part is meant for unit tests script: - - cd $HOME/$BOOST/libs/graph/test - - ../../../b2 toolset=gcc-4.8 cxxflags=-std=c++11 + - |- + echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam + - IFS=',' + - for CXXLOCAL in $CXXSTD; do (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET cxxstd=$CXXLOCAL && ./config_info_travis && rm ./config_info_travis) done + - unset IFS + - ./b2 -j3 libs/graph/test toolset=$TOOLSET cxxstd=$CXXSTD + +notifications: + email: + on_success: always diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..27205224 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,62 @@ +# Copyright 2016 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +version: 1.0.{build}-{branch} + +shallow_clone: true + +branches: + only: + - master + - develop + +platform: + - x64 + +environment: + matrix: + - ARGS: --toolset=msvc-9.0 address-model=32 + - ARGS: --toolset=msvc-10.0 address-model=32 + - ARGS: --toolset=msvc-11.0 address-model=32 + - ARGS: --toolset=msvc-12.0 address-model=32 + - ARGS: --toolset=msvc-14.0 address-model=32 + - ARGS: --toolset=msvc-12.0 address-model=64 + - ARGS: --toolset=msvc-14.0 address-model=64 + - ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest + - ARGS: --toolset=gcc address-model=64 + PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH% + - ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z + PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH% + - ARGS: --toolset=gcc address-model=32 + PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH% + - ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition + PATH: C:\MinGW\bin;%PATH% + + +install: + - cd .. + - git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\graph + - git submodule update --init tools/boostdep + - python tools/boostdep/depinst/depinst.py graph + - bootstrap + - b2 headers + +build: off + +test_script: + - cd libs\config\test + - ..\..\..\b2 config_info_travis_install %ARGS% + - config_info_travis + - cd ..\..\graph\test + - ..\..\..\b2 -j3 --hash %ARGS% From f36a7bab16b88a236656f428a5ee35857bf78ec5 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 1 Sep 2018 09:39:12 +0100 Subject: [PATCH 2/4] Touch travis.yml. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 60c604a2..cf2dab62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -227,6 +227,7 @@ install: - ./bootstrap.sh - ./b2 headers + script: - |- echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam From 4aaf5307db661e595e00232c1166ac945a9efbdf Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 1 Sep 2018 13:05:23 +0100 Subject: [PATCH 3/4] CI: disable toolsets that fail for reasons unconnected to us. [CI SKIP] --- .travis.yml | 60 +++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf2dab62..ae2a925f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,15 +38,16 @@ matrix: sources: - ubuntu-toolchain-r-test - - os: linux - compiler: g++-4.6 - env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x - addons: - apt: - packages: - - g++-4.6 - sources: - - ubuntu-toolchain-r-test + # Fails in Boost.Range dependency: + #- os: linux + # compiler: g++-4.6 + # env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x + # addons: + # apt: + # packages: + # - g++-4.6 + # sources: + # - ubuntu-toolchain-r-test - os: linux env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 @@ -147,26 +148,27 @@ matrix: sources: - ubuntu-toolchain-r-test - llvm-toolchain-precise-3.7 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z - addons: - apt: - packages: - - clang-3.8 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z - addons: - apt: - packages: - - clang-3.9 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.9 + + # Fails to compile std lib headers (toolset issue): + #- os: linux + # env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z + # addons: + # apt: + # packages: + # - clang-3.8 + # sources: + # - ubuntu-toolchain-r-test + # - llvm-toolchain-precise-3.8 + # + #- os: linux + # env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z + # addons: + # apt: + # packages: + # - clang-3.9 + # sources: + # - ubuntu-toolchain-r-test + # - llvm-toolchain-precise-3.9 - os: linux compiler: clang++-4.0 From ab9299f9c630e84b0b0c02e4d2146f29f253c785 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 25 Sep 2018 11:05:31 +0300 Subject: [PATCH 4/4] fix visibility of exceptions within Boost.Graph --- include/boost/graph/bipartite.hpp | 2 +- include/boost/graph/dimacs.hpp | 2 +- include/boost/graph/exception.hpp | 12 ++++++------ include/boost/graph/graphml.hpp | 2 +- include/boost/graph/graphviz.hpp | 10 +++++----- include/boost/graph/loop_erased_random_walk.hpp | 2 +- include/boost/graph/metis.hpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/boost/graph/bipartite.hpp b/include/boost/graph/bipartite.hpp index 74316fd5..185196e9 100644 --- a/include/boost/graph/bipartite.hpp +++ b/include/boost/graph/bipartite.hpp @@ -32,7 +32,7 @@ namespace boost { */ template - struct bipartite_visitor_error: std::exception + struct BOOST_SYMBOL_VISIBLE bipartite_visitor_error: std::exception { std::pair witnesses; diff --git a/include/boost/graph/dimacs.hpp b/include/boost/graph/dimacs.hpp index 3e8407df..12adba81 100644 --- a/include/boost/graph/dimacs.hpp +++ b/include/boost/graph/dimacs.hpp @@ -21,7 +21,7 @@ namespace boost { namespace graph { -class dimacs_exception : public std::exception {}; +class BOOST_SYMBOL_VISIBLE dimacs_exception : public std::exception {}; class dimacs_basic_reader { public: diff --git a/include/boost/graph/exception.hpp b/include/boost/graph/exception.hpp index 382d6719..f1f13dcf 100644 --- a/include/boost/graph/exception.hpp +++ b/include/boost/graph/exception.hpp @@ -15,36 +15,36 @@ namespace boost { - struct bad_graph : public std::invalid_argument { + struct BOOST_SYMBOL_VISIBLE bad_graph : public std::invalid_argument { bad_graph(const std::string& what_arg) : std::invalid_argument(what_arg) { } }; - struct not_a_dag : public bad_graph { + struct BOOST_SYMBOL_VISIBLE not_a_dag : public bad_graph { not_a_dag() : bad_graph("The graph must be a DAG.") { } }; - struct negative_edge : public bad_graph { + struct BOOST_SYMBOL_VISIBLE negative_edge : public bad_graph { negative_edge() : bad_graph("The graph may not contain an edge with negative weight.") { } }; - struct negative_cycle : public bad_graph { + struct BOOST_SYMBOL_VISIBLE negative_cycle : public bad_graph { negative_cycle() : bad_graph("The graph may not contain negative cycles.") { } }; - struct not_connected : public bad_graph { + struct BOOST_SYMBOL_VISIBLE not_connected : public bad_graph { not_connected() : bad_graph("The graph must be connected.") { } }; - struct not_complete : public bad_graph { + struct BOOST_SYMBOL_VISIBLE not_complete : public bad_graph { not_complete() : bad_graph("The graph must be complete.") { } diff --git a/include/boost/graph/graphml.hpp b/include/boost/graph/graphml.hpp index a7faa647..c8e495c2 100644 --- a/include/boost/graph/graphml.hpp +++ b/include/boost/graph/graphml.hpp @@ -34,7 +34,7 @@ namespace boost ///////////////////////////////////////////////////////////////////////////// // Graph reader exceptions ///////////////////////////////////////////////////////////////////////////// -struct parse_error: public graph_exception +struct BOOST_SYMBOL_VISIBLE parse_error: public graph_exception { parse_error(const std::string& err) {error = err; statement = "parse error: " + error;} virtual ~parse_error() throw() {} diff --git a/include/boost/graph/graphviz.hpp b/include/boost/graph/graphviz.hpp index 1c8cb194..4ddf8b6c 100644 --- a/include/boost/graph/graphviz.hpp +++ b/include/boost/graph/graphviz.hpp @@ -616,12 +616,12 @@ namespace boost { ///////////////////////////////////////////////////////////////////////////// // Graph reader exceptions ///////////////////////////////////////////////////////////////////////////// -struct graph_exception : public std::exception { +struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception { virtual ~graph_exception() throw() {} virtual const char* what() const throw() = 0; }; -struct bad_parallel_edge : public graph_exception { +struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception { std::string from; std::string to; mutable std::string statement; @@ -639,7 +639,7 @@ struct bad_parallel_edge : public graph_exception { } }; -struct directed_graph_error : public graph_exception { +struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception { virtual ~directed_graph_error() throw() {} virtual const char* what() const throw() { return @@ -648,7 +648,7 @@ struct directed_graph_error : public graph_exception { } }; -struct undirected_graph_error : public graph_exception { +struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception { virtual ~undirected_graph_error() throw() {} virtual const char* what() const throw() { return @@ -657,7 +657,7 @@ struct undirected_graph_error : public graph_exception { } }; -struct bad_graphviz_syntax: public graph_exception { +struct BOOST_SYMBOL_VISIBLE bad_graphviz_syntax: public graph_exception { std::string errmsg; bad_graphviz_syntax(const std::string& errmsg) : errmsg(errmsg) {} diff --git a/include/boost/graph/loop_erased_random_walk.hpp b/include/boost/graph/loop_erased_random_walk.hpp index 712c45d7..5805c2e5 100644 --- a/include/boost/graph/loop_erased_random_walk.hpp +++ b/include/boost/graph/loop_erased_random_walk.hpp @@ -19,7 +19,7 @@ namespace boost { - struct loop_erased_random_walk_stuck : public std::exception { + struct BOOST_SYMBOL_VISIBLE loop_erased_random_walk_stuck : public std::exception { virtual ~loop_erased_random_walk_stuck() throw() {} inline virtual const char* what() const throw() { return "Loop-erased random walk found a vertex with no out-edges"; diff --git a/include/boost/graph/metis.hpp b/include/boost/graph/metis.hpp index 2ec2fc3e..f6a1425f 100644 --- a/include/boost/graph/metis.hpp +++ b/include/boost/graph/metis.hpp @@ -26,8 +26,8 @@ namespace boost { namespace graph { -class metis_exception : public std::exception {}; -class metis_input_exception : public metis_exception {}; +class BOOST_SYMBOL_VISIBLE metis_exception : public std::exception {}; +class BOOST_SYMBOL_VISIBLE metis_input_exception : public metis_exception {}; class metis_reader {