From 9c6ba4cad70de0e4a5ffdf1ca9225fba7eba174d Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 13:05:17 +0100 Subject: [PATCH 1/6] Drop a few compilers --- .travis.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1e0720a..017c301 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,24 +14,6 @@ matrix: include: - os: linux compiler: gcc # default version - - os: linux - addons: - apt: - sources: ubuntu-toolchain-r-test - packages: g++-4.9 - env: MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - os: linux - addons: - apt: - sources: ubuntu-toolchain-r-test - packages: g++-5 - env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - - os: linux - addons: - apt: - sources: ubuntu-toolchain-r-test - packages: g++-6 - env: MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - os: linux addons: apt: @@ -46,13 +28,6 @@ matrix: env: - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - CMAKE_COV="-DENABLE_COVERAGE:BOOL=ON" # coverage build - - os: linux - addons: - apt: - sources: llvm-toolchain-trusty-3.6 - packages: clang-3.6 - env: - - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" - os: linux addons: apt: @@ -63,28 +38,12 @@ matrix: - clang-8 - g++-8 env: MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-6.0 - - ubuntu-toolchain-r-test - packages: - - clang-6.0 - - g++-7 - env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" - os: osx osx_image: xcode10.3 compiler: clang - os: osx osx_image: xcode10.3 compiler: gcc - - os: osx - osx_image: xcode11.6 - compiler: clang - - os: osx - osx_image: xcode11.6 - compiler: gcc - os: osx osx_image: xcode12.5 compiler: clang From 384664d405573b5f64fdfc6673b210da23ca86c1 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 13:06:07 +0100 Subject: [PATCH 2/6] Bump gcc version --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 017c301..9b3940f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,20 +13,22 @@ env: matrix: include: - os: linux - compiler: gcc # default version + compiler: gcc-4.9 # old gcc - os: linux + dist: focal addons: apt: sources: ubuntu-toolchain-r-test - packages: g++-7 - env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + packages: g++-11 + env: MATRIX_EVAL="CC=gcc-11 && CXX=g++-11" - os: linux + dist: focal addons: apt: sources: ubuntu-toolchain-r-test - packages: g++-7 + packages: g++-11 env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - MATRIX_EVAL="CC=gcc-11 && CXX=g++-11" - CMAKE_COV="-DENABLE_COVERAGE:BOOL=ON" # coverage build - os: linux addons: From 415a5a8c93b0fb911f565cc2b604e5e58a3d2f5a Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 14:24:16 +0100 Subject: [PATCH 3/6] Workaround disallowed source alias in apt plugin On focal, the source alias ubuntu-toolchain-r-test no longer seems to work, despite being listed in https://github.com/travis-ci/apt-source-safelist/blob/master/ubuntu.json and `sourceline` works around that. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b3940f..def6a2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,16 @@ matrix: dist: focal addons: apt: - sources: ubuntu-toolchain-r-test + sources: # for some reason, travis doesn't like the src alias on focal + - sourceline: 'ppa:ubuntu-toolchain-r/test' packages: g++-11 env: MATRIX_EVAL="CC=gcc-11 && CXX=g++-11" - os: linux dist: focal addons: apt: - sources: ubuntu-toolchain-r-test + sources: # for some reason, travis doesn't like the src alias on focal + - sourceline: 'ppa:ubuntu-toolchain-r/test' packages: g++-11 env: - MATRIX_EVAL="CC=gcc-11 && CXX=g++-11" From c1bf144109f2c6a7661671f2042a4e4a2325f618 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 14:29:06 +0100 Subject: [PATCH 4/6] Group xenial jobs in CI --- .travis.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index def6a2e..95ffdec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,16 @@ matrix: include: - os: linux compiler: gcc-4.9 # old gcc + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-8 + - ubuntu-toolchain-r-test + packages: + - clang-8 + - g++-8 + env: MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" - os: linux dist: focal addons: @@ -32,16 +42,6 @@ matrix: env: - MATRIX_EVAL="CC=gcc-11 && CXX=g++-11" - CMAKE_COV="-DENABLE_COVERAGE:BOOL=ON" # coverage build - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-8 - - ubuntu-toolchain-r-test - packages: - - clang-8 - - g++-8 - env: MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" - os: osx osx_image: xcode10.3 compiler: clang From 9bc5d5f340fed87d786d30c81919c25298ab8d1c Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 15:36:04 +0100 Subject: [PATCH 5/6] Fix warnings in compilation tests due to `-j` --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95ffdec..55e80cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ git: env: global: - - MAKEFLAGS="-j2" + - NPROC=$(nproc) + - MAKEFLAGS="-j${NPROC}" - CATCH_DIR="~/catch" - CATCH_REMOTE="https://github.com/catchorg/Catch2.git" - CATCH_VERSION=v2.13.6 @@ -56,6 +57,7 @@ matrix: compiler: gcc before_install: + - echo ${NPROC} - eval "${MATRIX_EVAL}" # determine overriding compiler, if set install: @@ -75,7 +77,9 @@ script: - cd build - cmake -Wdev -Werror=dev -DCMAKE_BUILD_TYPE=Debug ${CMAKE_COV} .. - cmake --build . - - cmake --build . --target test + - unset MAKEFLAGS # drop MAKEFLAGS, (which would affect compilation tests) + - make test ARGS=-j$((${NPROC} * 2)) # but run twice as many compilation tests + # as the number of available `nproc` after_success: |- if [ ! -z "${CMAKE_COV}" ]; then From 2c553c05b438c5730d8f1a09b3fbe5ffe363287a Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Sun, 16 May 2021 17:22:53 +0100 Subject: [PATCH 6/6] Fix failing compilation tests in g++11 Request `-std=c++11` explicitly in tests meant to compile against that standard. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 260ad20..158f432 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,10 @@ set(CMAKE_REQUIRED_FLAGS "-std=c++1z") # only for this check CHECK_CXX_SYMBOL_EXISTS(__cpp_noexcept_function_type "" HAS_NOEXCEPT_IN_TYPE) unset(CMAKE_REQUIRED_FLAGS) +# request C++11 explicitly by default - works around newer compilers otherwise +# omitting `-std=c++11` despite 11 being requested with target_compile_features +set(CMAKE_CXX_STANDARD 11) + # compiler warnings if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(clang_warnings "-Weverything -pedantic -Wno-c++98-compat \