From 020e88e1eaaf276e005f5e81f27b1712892e63e1 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 12 Apr 2018 13:18:33 +0100 Subject: [PATCH 1/6] Travis: Only do a build in the first stage Tests are run, otherwise using the very same configuration as the primary build, in the second stage. As all tasks within one stage run in parallel, the ~20mins that test execution takes will pass while also doing other work rather than blocking progress to the next stage. Via ccache we will avoid spending time for re-building. --- .travis.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f3ece1d07b..618e3faee03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ jobs: include: - &formatting-stage - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test + stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build env: NAME="clang-format" addons: apt: @@ -32,20 +32,20 @@ jobs: before_cache: - &linter-stage - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test + stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build env: NAME="CPP-LINT" install: script: scripts/travis_lint.sh before_cache: - &string-table-check - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test + stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build env: NAME="string-table" install: script: scripts/string_table_check.sh before_cache: - - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test + - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build env: NAME: "DOXYGEN-CHECK" DOXYGEN_VERSION: "1.8.14" @@ -87,7 +87,30 @@ jobs: - scripts/publish_doc.sh # Ubuntu Linux with glibc using g++-5 - - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 test + - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + os: linux + sudo: false + compiler: gcc + cache: ccache + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libwww-perl + - g++-5 + - libubsan0 + - parallel + before_install: + - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc + # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" + env: + - COMPILER="ccache /usr/bin/g++-5" + - EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG" + script: echo "Tests are run in the next stage." + + # Ubuntu Linux with glibc using g++-5 + - stage: Test different OS/CXX/Flags os: linux sudo: false compiler: gcc From d0fd2a93ed5c691acbd983f80120ea87e9e2f42d Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 12 Apr 2018 19:28:31 +0100 Subject: [PATCH 2/6] Travis: Perform the CMake build (but not the tests) in the first stage --- .travis.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.travis.yml b/.travis.yml index 618e3faee03..f9503302898 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,6 +109,28 @@ jobs: - EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG" script: echo "Tests are run in the next stage." + # cmake build using g++-5 + - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + os: linux + compiler: gcc + cache: ccache + env: + - BUILD_SYSTEM=cmake + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + before_install: + - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc + install: + - ccache -z + - ccache --max-size=1G + - cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=/usr/bin/g++-5' + - cmake --build build -- -j4 + script: echo "Tests are run in the next stage." + # Ubuntu Linux with glibc using g++-5 - stage: Test different OS/CXX/Flags os: linux From 2caa469bd02ef2fdb94563a2a68cbd1fe38358a4 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 12 Apr 2018 12:27:26 +0100 Subject: [PATCH 3/6] Do not mix configuration options Test configuration options in parallel rather than combining them to make diagnosing problems easier. Don't squash the build matrix as #1706 suggested earlier. Fixes: #1706 --- .travis.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9503302898..47b6afe28ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -184,6 +184,7 @@ jobs: - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" env: + - NAME="DEBUG" - COMPILER="ccache /usr/bin/g++-5" - EXTRA_CXXFLAGS="-DDEBUG" script: echo "Not running any tests for a debug build." @@ -215,7 +216,7 @@ jobs: - EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DNDEBUG" - CCACHE_CPP2=yes - # Ubuntu Linux with glibc using clang++-3.7, debug mode, disable USE_DSTRING + # Ubuntu Linux with glibc using clang++-3.7, debug mode - stage: Test different OS/CXX/Flags os: linux sudo: false @@ -237,8 +238,9 @@ jobs: - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: + - NAME="DEBUG" - COMPILER="ccache /usr/bin/clang++-3.7" - - EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DDEBUG -DUSE_STD_STRING" + - EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DDEBUG" - CCACHE_CPP2=yes script: echo "Not running any tests for a debug build." @@ -282,6 +284,28 @@ jobs: - cmake --build build -- -j4 script: (cd build; ctest -V -L CORE -j2) + # Ubuntu Linux with glibc using g++-5, disable USE_DSTRING + - stage: Test different OS/CXX/Flags + os: linux + sudo: false + compiler: gcc + cache: ccache + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libwww-perl + - g++-5 + - libubsan0 + - parallel + before_install: + - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc + # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" + env: + - NAME="USE_STD_STRING" + - COMPILER="ccache /usr/bin/g++-5" + - EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG -DUSE_STD_STRING" # Run Coverity - stage: Test different OS/CXX/Flags From 8d37bc40bcad631a9b2c1901c962ade27d702a72 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Thu, 12 Apr 2018 19:32:38 +0100 Subject: [PATCH 4/6] Travis: Move the clang (incl OSX) build to the first stage as well We can run up to 10 jobs in parallel - make use of that! --- .travis.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47b6afe28ff..f1ec91d893d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ jobs: include: - &formatting-stage - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + stage: Linter + Doxygen + non-debug builds env: NAME="clang-format" addons: apt: @@ -32,20 +32,20 @@ jobs: before_cache: - &linter-stage - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + stage: Linter + Doxygen + non-debug builds env: NAME="CPP-LINT" install: script: scripts/travis_lint.sh before_cache: - &string-table-check - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + stage: Linter + Doxygen + non-debug builds env: NAME="string-table" install: script: scripts/string_table_check.sh before_cache: - - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + - stage: Linter + Doxygen + non-debug builds env: NAME: "DOXYGEN-CHECK" DOXYGEN_VERSION: "1.8.14" @@ -87,7 +87,7 @@ jobs: - scripts/publish_doc.sh # Ubuntu Linux with glibc using g++-5 - - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + - stage: Linter + Doxygen + non-debug builds os: linux sudo: false compiler: gcc @@ -110,7 +110,7 @@ jobs: script: echo "Tests are run in the next stage." # cmake build using g++-5 - - stage: Linter + Doxygen + non-debug Ubuntu/gcc-5 build + - stage: Linter + Doxygen + non-debug builds os: linux compiler: gcc cache: ccache @@ -131,8 +131,48 @@ jobs: - cmake --build build -- -j4 script: echo "Tests are run in the next stage." + # OS X using clang++ + - stage: Linter + Doxygen + non-debug builds + os: osx + sudo: false + compiler: clang + cache: ccache + before_install: + - HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache parallel + - export PATH=$PATH:/usr/local/opt/ccache/libexec + env: COMPILER="ccache clang++" + script: echo "Tests are run in the next stage." + + # Ubuntu Linux with glibc using clang++-3.7, no-debug mode + - stage: Linter + Doxygen + non-debug builds + os: linux + sudo: false + compiler: clang + cache: ccache + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + packages: + - libwww-perl + - clang-3.7 + - libstdc++-5-dev + - libubsan0 + - parallel + - libc6-dev-i386 + before_install: + - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc + - export CCACHE_CPP2=yes + # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" + env: + - COMPILER="ccache /usr/bin/clang++-3.7" + - EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DNDEBUG" + - CCACHE_CPP2=yes + script: echo "Tests are run in the next stage." + # Ubuntu Linux with glibc using g++-5 - - stage: Test different OS/CXX/Flags + - stage: Linter + Doxygen + non-debug builds os: linux sudo: false compiler: gcc @@ -153,6 +193,24 @@ jobs: env: - COMPILER="ccache /usr/bin/g++-5" - EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG" + script: echo "Tests are run in the next stage." + + - stage: Linter + Doxygen + non-debug builds + os: osx + compiler: clang + cache: ccache + before_install: + - HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache + - export PATH=$PATH:/usr/local/opt/ccache/libexec + env: + - BUILD_SYSTEM=cmake + - CCACHE_CPP2=yes + install: + - ccache -z + - ccache --max-size=1G + - cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=x86_64' + - cmake --build build -- -j4 + script: echo "Tests are run in the next stage." # OS X using clang++ - stage: Test different OS/CXX/Flags From 210782e9ab057448fc936ec2045d79b4b0b390b1 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Tue, 5 Jun 2018 10:14:01 +0000 Subject: [PATCH 5/6] Remove build and preparation steps that are only required when running tests --- .travis.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1ec91d893d..30cb301d7ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,9 +100,6 @@ jobs: - libwww-perl - g++-5 - libubsan0 - - parallel - before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" env: - COMPILER="ccache /usr/bin/g++-5" @@ -122,8 +119,6 @@ jobs: - ubuntu-toolchain-r-test packages: - g++-5 - before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc install: - ccache -z - ccache --max-size=1G @@ -159,10 +154,7 @@ jobs: - clang-3.7 - libstdc++-5-dev - libubsan0 - - parallel - - libc6-dev-i386 before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: @@ -185,10 +177,6 @@ jobs: - libwww-perl - g++-5 - libubsan0 - - parallel - - libc6-dev-i386 - before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" env: - COMPILER="ccache /usr/bin/g++-5" @@ -237,9 +225,6 @@ jobs: - libwww-perl - g++-5 - libubsan0 - - libc6-dev-i386 - before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc # env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer" env: - NAME="DEBUG" @@ -290,9 +275,7 @@ jobs: - clang-3.7 - libstdc++-5-dev - libubsan0 - - libc6-dev-i386 before_install: - - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: From 219b430aca3a472766e806f4df7e075f8b74fdae Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Tue, 5 Jun 2018 10:14:29 +0000 Subject: [PATCH 6/6] Remove redundant setting of variable --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30cb301d7ce..9d1decf19d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -155,7 +155,6 @@ jobs: - libstdc++-5-dev - libubsan0 before_install: - - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: - COMPILER="ccache /usr/bin/clang++-3.7" @@ -252,7 +251,6 @@ jobs: - libc6-dev-i386 before_install: - mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc - - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: - COMPILER="ccache /usr/bin/clang++-3.7" @@ -276,7 +274,6 @@ jobs: - libstdc++-5-dev - libubsan0 before_install: - - export CCACHE_CPP2=yes # env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" env: - NAME="DEBUG"