From c789630270db2915c7d6dd08d53bf4e73f01affe Mon Sep 17 00:00:00 2001 From: Sayan Date: Wed, 23 Sep 2026 17:34:01 -0400 Subject: [PATCH 01/15] Flatten test/Jamfile.v2 so boost_test_jamfile() sees the tests --- test/Jamfile.v2 | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 5f62e02..d35a1dc 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -21,28 +21,30 @@ project # bring in rules for testing import testing ; -{ - test-suite numeric/interval : - [ compile integer.cpp ] +# One test per line, in the flat form understood both by B2 and by the +# superproject's boost_test_jamfile() CMake helper (the bracketed test-suite +# form was silently ignored by the latter, so the CMake build had no tests). - [ run add.cpp ] - [ run det.cpp ] - [ run fmod.cpp ] - [ run msvc_x64_flags.cpp : : : no msvc:yes ] - [ run mul.cpp ] - [ run overflow.cpp ] - [ run pi.cpp ] - [ run pow.cpp ] +compile integer.cpp ; - [ run cmp.cpp ] - [ run cmp_exn.cpp : : : /boost/logic//boost_logic ] - [ run cmp_exp.cpp ] - [ run cmp_lex.cpp ] - [ run cmp_set.cpp ] - # https://github.com/boostorg/interval/issues/15 - # [ run cmp_tribool.cpp ] - [ run test_float.cpp - : : : yes msvc-10.0:no ] - # https://github.com/boostorg/interval/issues/17 - ; -} +run add.cpp ; +run det.cpp ; +run fmod.cpp ; +run msvc_x64_flags.cpp + : : : no msvc:yes ; +run mul.cpp ; +run overflow.cpp ; +run pi.cpp ; +run pow.cpp ; + +run cmp.cpp ; +run cmp_exn.cpp + : : : /boost/logic//boost_logic ; +run cmp_exp.cpp ; +run cmp_lex.cpp ; +run cmp_set.cpp ; +# https://github.com/boostorg/interval/issues/15 +# run cmp_tribool.cpp ; +run test_float.cpp + : : : yes msvc-10.0:no ; + # https://github.com/boostorg/interval/issues/17 From 4cb7e22d4ecbac661e0f0b11b498fcd376f1369c Mon Sep 17 00:00:00 2001 From: Sayan Date: Wed, 23 Sep 2026 17:34:01 -0400 Subject: [PATCH 02/15] Flatten test/Jamfile.v2 so the CMake build runs the tests test/CMakeLists.txt feeds Jamfile.v2 to the superproject's boost_test_jamfile() helper, but that parser only recognises flat 'run foo.cpp ;' lines. This Jamfile wrapped every test in 'test-suite numeric/interval : [ run foo.cpp ] ... ;', so each line was silently ignored and a CMake build with BUILD_TESTING=ON configured no interval tests at all ("No tests were found!!!"). Rewrite the Jamfile in the flat form: same targets, same per-test requirements, same two entries left disabled (#15, #17). B2 behaviour is unchanged. Also pass the Jamfile's strict-FP flags (-frounding-math / /fp:strict) through boost_test_jamfile(COMPILE_OPTIONS): the library switches the rounding mode at run time, and without them pi.cpp fails in optimised CMake builds. --- test/CMakeLists.txt | 14 ++++++++++++- test/Jamfile.v2 | 48 +++++++++++++++++++++++---------------------- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 93c0293..5995415 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,6 +7,18 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) if(HAVE_BOOST_TEST) -boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::numeric_interval Boost::core Boost::logic) +# The library relies on changing the FPU rounding mode at run time, which the +# compiler is only required to honour under strict FP semantics. Jamfile.v2 sets +# these per toolset; mirror them here. +set(interval_test_options) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(interval_test_options -frounding-math) +elseif(MSVC) + set(interval_test_options /fp:strict) +endif() + +boost_test_jamfile(FILE Jamfile.v2 + LINK_LIBRARIES Boost::numeric_interval Boost::core Boost::logic + COMPILE_OPTIONS ${interval_test_options}) endif() diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 5f62e02..d35a1dc 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -21,28 +21,30 @@ project # bring in rules for testing import testing ; -{ - test-suite numeric/interval : - [ compile integer.cpp ] +# One test per line, in the flat form understood both by B2 and by the +# superproject's boost_test_jamfile() CMake helper (the bracketed test-suite +# form was silently ignored by the latter, so the CMake build had no tests). - [ run add.cpp ] - [ run det.cpp ] - [ run fmod.cpp ] - [ run msvc_x64_flags.cpp : : : no msvc:yes ] - [ run mul.cpp ] - [ run overflow.cpp ] - [ run pi.cpp ] - [ run pow.cpp ] +compile integer.cpp ; - [ run cmp.cpp ] - [ run cmp_exn.cpp : : : /boost/logic//boost_logic ] - [ run cmp_exp.cpp ] - [ run cmp_lex.cpp ] - [ run cmp_set.cpp ] - # https://github.com/boostorg/interval/issues/15 - # [ run cmp_tribool.cpp ] - [ run test_float.cpp - : : : yes msvc-10.0:no ] - # https://github.com/boostorg/interval/issues/17 - ; -} +run add.cpp ; +run det.cpp ; +run fmod.cpp ; +run msvc_x64_flags.cpp + : : : no msvc:yes ; +run mul.cpp ; +run overflow.cpp ; +run pi.cpp ; +run pow.cpp ; + +run cmp.cpp ; +run cmp_exn.cpp + : : : /boost/logic//boost_logic ; +run cmp_exp.cpp ; +run cmp_lex.cpp ; +run cmp_set.cpp ; +# https://github.com/boostorg/interval/issues/15 +# run cmp_tribool.cpp ; +run test_float.cpp + : : : yes msvc-10.0:no ; + # https://github.com/boostorg/interval/issues/17 From 2ac2560b30177256016b4efd7963493d4f3266e9 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 13:22:21 -0400 Subject: [PATCH 03/15] test/add.cpp: free expr nodes via an owning pool; drop obsolete LSan suppression --- test/add.cpp | 38 ++++++++++++++++++++++++++------------ test/suppressions.txt | 1 - 2 files changed, 26 insertions(+), 13 deletions(-) delete mode 100644 test/suppressions.txt diff --git a/test/add.cpp b/test/add.cpp index 62b23dc..8554a86 100644 --- a/test/add.cpp +++ b/test/add.cpp @@ -16,6 +16,8 @@ #include #include #include +#include +#include #include "bugs.hpp" typedef enum { EXPR_VAR, EXPR_NEG, EXPR_UP, EXPR_DOWN, EXPR_ADD, EXPR_SUB } e_type; @@ -34,9 +36,26 @@ struct expr { pexpr e1, e2; }; +// Every expr node is owned by this pool and released at program exit, +// so sanitizer builds do not report the symbolic trees as leaks. +struct expr_pool { + std::vector nodes; + ~expr_pool() { + for (std::size_t i = 0; i < nodes.size(); ++i) delete nodes[i]; + } +}; + +static expr_pool pool; + +static pexpr new_expr(e_type t) { + expr *p = new expr; + p->type = t; + pool.nodes.push_back(p); + return p; +} + pexpr var(int v) { - pexpr e = new expr; - e->type = EXPR_VAR; + pexpr e = new_expr(EXPR_VAR); e->var = v; return e; } @@ -49,8 +68,7 @@ pexpr operator+(pexpr a, pexpr b) { if (a->type == EXPR_NEG) return b - a->e; if (b->type == EXPR_NEG) return a - b->e; if (a->type == EXPR_VAR && b->type == EXPR_VAR && a->var > b->var) return b + a; - pexpr c = new expr; - c->type = EXPR_ADD; + pexpr c = new_expr(EXPR_ADD); c->e1 = a; c->e2 = b; return c; @@ -58,23 +76,20 @@ pexpr operator+(pexpr a, pexpr b) { pexpr operator-(pexpr a, pexpr b) { if (b->type == EXPR_NEG) return a + b->e; - pexpr c = new expr; - c->type = EXPR_SUB; + pexpr c = new_expr(EXPR_SUB); c->e1 = a; c->e2 = b; return c; } pexpr down(pexpr a) { - pexpr e = new expr; - e->type = EXPR_DOWN; + pexpr e = new_expr(EXPR_DOWN); e->e = a; return e; } pexpr up(pexpr a) { - pexpr e = new expr; - e->type = EXPR_UP; + pexpr e = new_expr(EXPR_UP); e->e = a; return e; } @@ -85,8 +100,7 @@ pexpr operator-(pexpr a) { if (a->type == EXPR_DOWN) return up(-a->e); if (a->type == EXPR_SUB) return a->e2 - a->e1; if (a->type == EXPR_ADD) return -a->e1 - a->e2; - pexpr e = new expr; - e->type = EXPR_NEG; + pexpr e = new_expr(EXPR_NEG); e->e = a; return e; } diff --git a/test/suppressions.txt b/test/suppressions.txt deleted file mode 100644 index 5a4bd0c..0000000 --- a/test/suppressions.txt +++ /dev/null @@ -1 +0,0 @@ -leak:add From 5e55de246021534981afa82b18d30bad017684b9 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 13:49:02 -0400 Subject: [PATCH 04/15] test/Jamfile.v2: restore test-suite form; add strict FP for clang-win and intel --- test/Jamfile.v2 | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d35a1dc..2ad27eb 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -16,35 +16,35 @@ project gcc:-frounding-math clang:-frounding-math msvc:/fp\:strict + clang-win:/fp\:strict + intel:-fp-model=strict ; # bring in rules for testing import testing ; -# One test per line, in the flat form understood both by B2 and by the -# superproject's boost_test_jamfile() CMake helper (the bracketed test-suite -# form was silently ignored by the latter, so the CMake build had no tests). +{ + test-suite numeric/interval : + [ compile integer.cpp ] -compile integer.cpp ; + [ run add.cpp ] + [ run det.cpp ] + [ run fmod.cpp ] + [ run msvc_x64_flags.cpp : : : no msvc:yes ] + [ run mul.cpp ] + [ run overflow.cpp ] + [ run pi.cpp ] + [ run pow.cpp ] -run add.cpp ; -run det.cpp ; -run fmod.cpp ; -run msvc_x64_flags.cpp - : : : no msvc:yes ; -run mul.cpp ; -run overflow.cpp ; -run pi.cpp ; -run pow.cpp ; - -run cmp.cpp ; -run cmp_exn.cpp - : : : /boost/logic//boost_logic ; -run cmp_exp.cpp ; -run cmp_lex.cpp ; -run cmp_set.cpp ; -# https://github.com/boostorg/interval/issues/15 -# run cmp_tribool.cpp ; -run test_float.cpp - : : : yes msvc-10.0:no ; - # https://github.com/boostorg/interval/issues/17 + [ run cmp.cpp ] + [ run cmp_exn.cpp : : : /boost/logic//boost_logic ] + [ run cmp_exp.cpp ] + [ run cmp_lex.cpp ] + [ run cmp_set.cpp ] + # https://github.com/boostorg/interval/issues/15 + # [ run cmp_tribool.cpp ] + [ run test_float.cpp + : : : yes msvc-10.0:no ] + # https://github.com/boostorg/interval/issues/17 + ; +} From 331940e722d5360fa11d50caa9e2790969f6288c Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 13:57:28 -0400 Subject: [PATCH 05/15] test/CMakeLists.txt: use explicit boost_test() instead of boost_test_jamfile() --- test/CMakeLists.txt | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5995415..9108d92 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,24 +1,41 @@ # Copyright 2018, 2019 Peter Dimov # Copyright 2025 James E. King III +# Copyright 2026 Sayan # Distributed under 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 -include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) +include(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) -if(HAVE_BOOST_TEST) +if(NOT HAVE_BOOST_TEST) + return() +endif() # The library relies on changing the FPU rounding mode at run time, which the # compiler is only required to honour under strict FP semantics. Jamfile.v2 sets -# these per toolset; mirror them here. -set(interval_test_options) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - set(interval_test_options -frounding-math) -elseif(MSVC) - set(interval_test_options /fp:strict) +# these per toolset; mirror them here. MSVC is tested first so that clang-cl +# gets /fp:strict rather than the GCC-style flag. +if(MSVC) + set(BOOST_TEST_COMPILE_OPTIONS /fp:strict) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") + set(BOOST_TEST_COMPILE_OPTIONS -fp-model=strict) +elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set(BOOST_TEST_COMPILE_OPTIONS -frounding-math) endif() -boost_test_jamfile(FILE Jamfile.v2 - LINK_LIBRARIES Boost::numeric_interval Boost::core Boost::logic - COMPILE_OPTIONS ${interval_test_options}) +set(BOOST_TEST_LINK_LIBRARIES Boost::numeric_interval Boost::core) + +boost_test(TYPE compile SOURCES integer.cpp) + +foreach(t add det fmod mul overflow pi pow cmp cmp_exp cmp_lex cmp_set test_float) + boost_test(TYPE run SOURCES ${t}.cpp) +endforeach() +boost_test(TYPE run SOURCES cmp_exn.cpp LINK_LIBRARIES Boost::logic) + +# MSVC-only regression test (b2: no msvc:yes). +if(MSVC) + boost_test(TYPE run SOURCES msvc_x64_flags.cpp) endif() + +# https://github.com/boostorg/interval/issues/15 +# boost_test(TYPE run SOURCES cmp_tribool.cpp) From ea9fc1450d84fee102958566142daeff4a631dd9 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 14:38:47 -0400 Subject: [PATCH 06/15] ci.yml: self-contained CI with the same jobs as Boost.CI --- .github/workflows/ci.yml | 607 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 586 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dededa..1b406eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,25 @@ -# # Copyright 2020-2021 Peter Dimov # Copyright 2021 Andrey Semashev -# Copyright 2021-2024 Alexander Grund +# Copyright 2021-2026 Alexander Grund # Copyright 2022-2025 James E. King III +# Copyright 2026 Sayan # # 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) # -# This workflow uses the Boost.CI reusable workflow which builds a variety of -# configurations of your project, runs tests, and generates code coverage reports. -# -# To use it, copy this file into your repository as `.github/workflows/ci.yml` and -# customize it appropriately. -# +# Self-contained CI. It runs the same jobs on the same platforms as the +# Boost.CI reusable workflow this repository used before, with the settings +# it passed to it: +# - MinGW disabled (https://github.com/boostorg/interval/issues/41) +# - clang before 11 excluded: clang < 10 does not support the necessary +# floating point options (-frounding-math) and clang 10 has a C++20 +# ambiguous operator resolution bug +# (https://github.com/llvm/llvm-project/issues/43110) --- -name: Boost.CI +name: CI + +permissions: + contents: read on: pull_request: @@ -31,18 +36,578 @@ on: - meta/** - README.md +concurrency: + group: ${{ github.ref }}:${{ github.workflow_ref }} + cancel-in-progress: true + +env: + SELF: numeric/interval + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + B2_LINK: shared,static + B2_VARIANT: debug,release + jobs: - call-boost-ci: - name: Run Boost.CI - uses: boostorg/boost-ci/.github/workflows/reusable.yml@master - with: - # https://github.com/boostorg/interval/issues/41 - # Boost.CI doesn't have a way to only disable MINGW32 at this time - enable_mingw: false - # clang before 10.0 does not support the necessary floating point options (-frounding-math) - # clang 10.0 has a C++20 ambiguous operator resolution bug: https://github.com/llvm/llvm-project/issues/43110 - exclude_compiler: 'clang-3.5,clang-3.6,clang-3.7,clang-3.8,clang-3.9,clang-4.0,clang-5.0,clang-6.0,clang-7,clang-8,clang-9,clang-10' - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + posix: + name: posix (${{ matrix.name || matrix.compiler }}, ${{ matrix.cxxstd }}, ${{ matrix.container || matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + # libstdc++ + - { compiler: gcc-4.7, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-4.8, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-4.9, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-5, cxxstd: "11,14,1z", os: ubuntu-latest, container: "ubuntu:18.04" } + - { compiler: gcc-6, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:18.04" } + - { compiler: gcc-7, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: gcc-8, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: gcc-9, cxxstd: "11,14,17,2a", os: ubuntu-22.04 } + - { compiler: gcc-10, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-11, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-12, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04 } + - { name: "Coverage w/ GCC on Linux", coverage: "yes", + compiler: gcc-13, cxxstd: "2b", os: ubuntu-24.04, install: "g++-13-multilib gcc-multilib", address-model: "32,64" } + - { name: "GCC w/ sanitizers", sanitize: "yes", + compiler: gcc-13, cxxstd: "11,14,17,20", os: ubuntu-24.04 } + - { compiler: gcc-14, cxxstd: "11,14,17,20,23", os: ubuntu-24.04 } + - { compiler: gcc-15, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: gcc-16, cxxstd: "11,14,17,20,23,26", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: clang-11, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: clang-13, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-14, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-15, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: ubuntu-latest, container: "ubuntu:24.04" } + - { compiler: clang-17, cxxstd: "11,14,17,20,23", os: ubuntu-latest, container: "ubuntu:24.04" } + - { compiler: clang-18, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } + - { compiler: clang-19, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } + - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:25.04" } + - { compiler: clang-21, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: clang-22, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: icpx-2025, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "intel/oneapi-hpckit:2025.2.2-0-devel-ubuntu24.04" } + # libc++ + - { name: "Clang w/ sanitizers", sanitize: "yes", stdlib: "libc++", + compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + # MacOS + - { name: "MacOS sanitize w/ clang", sanitize: "yes", + compiler: clang, cxxstd: "11,14,17,20,2b", os: macos-14 } + - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: macos-15, xcode_app: "Xcode_16.2" } + - { compiler: clang-18, cxxstd: "11,14,17,20,2b", os: macos-15 } + - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: macos-26 } + # Arm64 + - { name: "ARM64 w/ GCC", + compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04-arm } + # Big-Endian + - { name: "Big Endian w/ Clang on s390x", multiarch: "yes", + compiler: clang, cxxstd: "17", os: ubuntu-latest, distro: fedora, edition: "34", arch: s390x } + + container: + image: ${{ matrix.container }} + volumes: + - /node20_217:/node20_217:rw,rshared + - /node24_217:/node24_217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20_217:/__e/node20:ro,rshared' || ' ' }} + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node24_217:/__e/node24:ro,rshared' || ' ' }} + + steps: + - name: Setup environment + run: | + if [ -f "/etc/debian_version" ]; then + echo "DEBIAN_FRONTEND=noninteractive" >> "$GITHUB_ENV" + export DEBIAN_FRONTEND=noninteractive + fi + if [ -n "${{ matrix.container }}" ] && [ -f "/etc/debian_version" ]; then + echo "::group::Install core tools" + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install sudo software-properties-common curl + echo "::endgroup::" + echo "::group::Check & setup git version" + if ! git_version=$(git --version 2>/dev/null); then + git_version=0.0.0 + fi + # Extract version number from e.g. "git version 2.7.4" + version=${git_version##* } + echo "Git version: $version" + required_git_version="2.18" # actions/checkout requires git 2.18 + if [[ "$(printf '%s\n' "$required_git_version" "$version" | sort -V | head -n1)" != "$required_git_version" ]]; then + # Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80 + key_server="keyserver.boost.org" + echo "Downloading key from $key_server" + curl -sSL --retry ${NET_RETRY_COUNT:-5} "https://$key_server/pks/lookup?op=get&search=0xF911AB184317630C59970973E363C90F8F1B6217" | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg + VERSION_CODENAME=$(grep -ioP '^VERSION_CODENAME=\K.+' /etc/os-release || true) + echo "VERSION_CODENAME is ${VERSION_CODENAME}" + echo "deb http://ppa.launchpadcontent.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" | sudo tee /etc/apt/sources.list.d/git-core-ppa.list > /dev/null + fi + echo "::endgroup::" + echo "::group::Update APT cache" + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + echo "::endgroup::" + pkgs="g++ git xz-utils" + osver=$(lsb_release -sr | cut -f1 -d.) + echo "OS version: $osver" + # Ubuntu 22+ has only Python 3 in the repos + if [ -n "$osver" ] && [ "$osver" -ge "20" ]; then + pkgs+=" python-is-python3 libpython3-dev" + else + pkgs+=" python libpython-dev" + fi + echo "::group::Install $pkgs" + apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs + echo "::endgroup::" + fi + git config --global pack.threads 0 + if [[ "${{ matrix.container }}" == "ubuntu:1"* ]]; then + echo "::group::Update node" + # Install a node version that works with the glibc 2.17 of Ubuntu 16/18: https://github.com/actions/checkout/issues/1590 + curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20_217 + # Node 24 triggers a bug in GLIBC 2.17 inside libnss_files.so.2 leading to a SIGSEGV, use Node 20 for both + mkdir -p /node24_217 + cp -r /node20_217/* /node24_217/ + echo "::endgroup::" + fi + + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # For coverage builds fetch the whole history, else only 1 commit + fetch-depth: ${{ matrix.coverage && '0' || '1' }} + + - name: Install packages + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [[ -z "${{ matrix.install }}" ]]; then + if [[ ! "${{ matrix.compiler }}" =~ icpx ]]; then + compiler="${{ matrix.compiler }}" + pkgs="${compiler/gcc-/g++-}" + if [[ "${{ matrix.stdlib }}" == "libc++" && $compiler == "clang-"* ]]; then + ver=${compiler#*-} + pkgs+=" libc++-${ver}-dev libc++abi-${ver}-dev" + fi + fi + else + pkgs="${{ matrix.install }}" + fi + if [ -n "${pkgs}" ]; then + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install $pkgs + fi + + - name: Setup multiarch + if: matrix.multiarch + run: | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install binfmt-support qemu-user-static + git clone --depth=1 https://github.com/jeking3/bdde.git ../bdde + sudo ../bdde/bin/linux/bdde-multiarch + sudo ../bdde/bin/linux/bdde-multiarch --version + echo "$(cd ../bdde/bin/linux && pwd)" >> "$GITHUB_PATH" + echo "B2_WRAPPER=bdde" >> "$GITHUB_ENV" + env: + BDDE_DISTRO: ${{ matrix.distro }} + BDDE_EDITION: ${{ matrix.edition }} + BDDE_ARCH: ${{ matrix.arch }} + + - name: Setup Boost + run: | + set -x + # Required because inside a container the owner is root so git commands would fail. + git config --global --add safe.directory "$GITHUB_WORKSPACE" || true + if [ -n "${{ matrix.xcode_app }}" ]; then + sudo xcode-select -switch "/Applications/${{ matrix.xcode_app }}.app" + fi + + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF##*/} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep + rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" + cp -r "$GITHUB_WORKSPACE"/* "libs/$SELF/" + $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" + echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" + + # Toolset and compiler for user-config.jam + compiler="${{ matrix.compiler }}" + if [[ "$compiler" =~ clang ]]; then + B2_TOOLSET=clang + CXX="${compiler/clang/clang++}" + # On macOS use the system clang if it is the requested version, else the HomeBrew one + if [[ "$RUNNER_OS" == "macOS" ]] && [[ "$compiler" == clang-* ]] && ! command -v "$CXX"; then + ver=${compiler#clang-} + if [[ "$(clang --version)" == *"clang version ${ver}."* ]]; then + CXX=clang++ + else + CXX="$(brew --prefix "llvm@$ver")/bin/clang++" + fi + fi + elif [[ "$compiler" =~ icpx ]]; then + B2_TOOLSET=intel-linux + CXX=icpx + else + B2_TOOLSET=gcc + CXX="${compiler/gcc/g++}" + fi + command -v "$CXX" + "$CXX" --version + echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam + cat ~/user-config.jam + echo "B2_TOOLSET=$B2_TOOLSET" >> "$GITHUB_ENV" + # CXX in the environment would override B2's toolset + echo "CXX=" >> "$GITHUB_ENV" + + ${B2_WRAPPER:-} ./bootstrap.sh + ${B2_WRAPPER:-} ./b2 -d0 headers + env: + BDDE_DISTRO: ${{ matrix.distro }} + BDDE_EDITION: ${{ matrix.edition }} + BDDE_ARCH: ${{ matrix.arch }} + + - name: Run tests + if: '!matrix.coverage' + run: | + set -x + cd "$BOOST_ROOT" + ARGS=(toolset=$B2_TOOLSET cxxstd=${{ matrix.cxxstd }} link=$B2_LINK variant=$B2_VARIANT -j$(( $(getconf _NPROCESSORS_ONLN) + 1 ))) + [ -z "${{ matrix.address-model }}" ] || ARGS+=(address-model=${{ matrix.address-model }}) + [ -z "${{ matrix.stdlib }}" ] || ARGS+=(stdlib=${{ matrix.stdlib }}) + [ "${{ matrix.sanitize }}" != "yes" ] || ARGS+=(address-sanitizer=norecover undefined-sanitizer=norecover) + ${B2_WRAPPER:-} ./b2 libs/$SELF/test "${ARGS[@]}" + env: + UBSAN_OPTIONS: print_stacktrace=1,report_error_type=1 + BDDE_DISTRO: ${{ matrix.distro }} + BDDE_EDITION: ${{ matrix.edition }} + BDDE_ARCH: ${{ matrix.arch }} + + - name: Run tests with coverage + if: matrix.coverage + run: | + set -x + cd "$BOOST_ROOT" + ./b2 libs/$SELF/test toolset=$B2_TOOLSET cxxstd=${{ matrix.cxxstd }} link=$B2_LINK variant=debug \ + address-model=${{ matrix.address-model }} "cxxflags=-fkeep-static-functions --coverage" linkflags=--coverage \ + -j$(( $(getconf _NPROCESSORS_ONLN) + 1 )) + + - name: Show config.log + if: always() + run: cat "$BOOST_ROOT/bin.v2/config.log" || true + + - name: Collect coverage + if: matrix.coverage + run: | + set -x + GCOV=gcov-${{ matrix.compiler }} + GCOV=${GCOV/gcc-/} + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install \ + libcapture-tiny-perl libdatetime-perl libjson-xs-perl || true + LCOV_OPTIONS=(--rc branch_coverage=1 --ignore-errors inconsistent,mismatch,unused) + rm -rf /tmp/lcov + git clone --depth 1 -b v2.3 https://github.com/linux-test-project/lcov.git /tmp/lcov + export PATH=/tmp/lcov/bin:$PATH + lcov --version + lcov "${LCOV_OPTIONS[@]}" --gcov-tool="$GCOV" --directory "$BOOST_ROOT" --capture --output-file all.info + lcov "${LCOV_OPTIONS[@]}" --list all.info + # Limit to this library: its headers and libs/$SELF + for f in $(for h in include/boost/*; do echo "$h"; done | cut -f2- -d/); do echo "*/$f*"; done > /tmp/interesting + cat /tmp/interesting + xargs --verbose -L 999999 -a /tmp/interesting lcov "${LCOV_OPTIONS[@]}" --extract all.info "*/libs/$SELF/*" --output-file coverage.info + lcov "${LCOV_OPTIONS[@]}" --list coverage.info + + - name: Upload coverage + if: matrix.coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + fail_ci_if_error: true + disable_search: true + files: coverage.info + name: Github Actions (POSIX) + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + + coverity: + name: Coverity Scan w/ Clang on Linux + if: github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'master') + runs-on: ubuntu-22.04 + timeout-minutes: 120 + + defaults: + run: + shell: bash + + env: COVERITY_SCAN_NOTIFICATION_EMAIL: ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }} COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + if: env.COVERITY_SCAN_TOKEN + + - name: Install packages + if: env.COVERITY_SCAN_TOKEN + run: | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install clang-12 + + - name: Setup Boost + if: env.COVERITY_SCAN_TOKEN + run: | + set -x + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF##*/} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep + rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" + cp -r "$GITHUB_WORKSPACE"/* "libs/$SELF/" + $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" + echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" + echo "using clang : : clang++-12 ;" > ~/user-config.jam + ./bootstrap.sh + ./b2 -d0 headers + + - name: Run coverity + if: env.COVERITY_SCAN_TOKEN + run: | + set -x + pushd /tmp + rm -rf coverity_tool.tgz cov-analysis* + curl -L -d "token=${COVERITY_SCAN_TOKEN}&project=${GITHUB_REPOSITORY}" -X POST https://scan.coverity.com/download/cxx/linux64 -o coverity_tool.tgz + tar xzf coverity_tool.tgz + export PATH=$(echo "$(pwd)"/cov-analysis*/bin):$PATH + popd + RESULTS_DIR="$(pwd)/cov-int" + mkdir "${RESULTS_DIR}" + cov-configure --template --compiler clang++-12 --comptype clangcxx + (cd "$BOOST_ROOT" && cov-build --dir "${RESULTS_DIR}" ./b2 libs/$SELF/test toolset=clang cxxstd=20 link=$B2_LINK variant=$B2_VARIANT -j3) + tail -50 "${RESULTS_DIR}/build-log.txt" + tar czf cov-int.tgz cov-int + curl --form token="${COVERITY_SCAN_TOKEN}" \ + --form email="${COVERITY_SCAN_NOTIFICATION_EMAIL}" \ + --form file=@cov-int.tgz \ + --form version="${GITHUB_REF_NAME}" \ + --form description="${GITHUB_REPOSITORY}:${GITHUB_REF}:${GITHUB_SHA}:${GITHUB_RUN_NUMBER}" \ + https://scan.coverity.com/builds?project="${GITHUB_REPOSITORY}" + + windows: + name: windows (${{ matrix.name || matrix.toolset }}, ${{ matrix.cxxstd }}, ${{ matrix.address-model }}, ${{ matrix.os }}${{ matrix.target-os && ', cygwin' || '' }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: cmd + + strategy: + fail-fast: false + matrix: + include: + - { toolset: msvc-14.3, bootstrap: vc143, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } + - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } + - { toolset: msvc-14.3, bootstrap: vc143, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } + - { name: "Collect coverage w/ VS 2022", coverage: "yes", + toolset: msvc-14.3, bootstrap: vc143, cxxstd: "latest", address-model: "64", os: windows-2022 } + - { name: "Collect coverage w/ VS 2026", coverage: "yes", + toolset: msvc-14.5, cxxstd: "latest", address-model: "64", os: windows-2025-vs2026 } + - { toolset: clang-win, bootstrap: clang-win, cxxstd: "14,17,latest", address-model: "32,64", os: windows-2025, b2_flags: "embed-manifest-via=linker" } + - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2022 } + - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "32", os: windows-2025, target-os: cygwin } + - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2025, target-os: cygwin } + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup cygwin + if: ${{ matrix.target-os == 'cygwin' }} + uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1 + with: + site: ${{ matrix.address-model == '64' && 'https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin' || 'https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin-archive/20221123' }} + packages: coreutils, gcc-g++, libstdc++6, make, moreutils, openssl, libbz2-devel, libgmp-devel, libicu-devel, libjpeg-devel, libmpfr-devel, libpng-devel, libssl-devel, libtiff-devel, libxslt-devel, libzstd-devel + platform: ${{ matrix.address-model == '64' && 'x86_64' || 'x86' }} + + - name: Setup Boost + run: | + set BOOST_BRANCH=develop + if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) + for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. || exit /b 1 + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 + cd boost-root || exit /b 1 + git submodule update -q --init tools/boostdep || exit /b 1 + xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 + echo BOOST_ROOT=%cd%>> %GITHUB_ENV% + cmd /c bootstrap ${{ matrix.bootstrap }} + if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) + b2 -d0 headers + + - name: Run tests + if: '!matrix.coverage' + run: | + cd /d %BOOST_ROOT% + b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} + + - name: Collect coverage + if: matrix.coverage + shell: powershell + run: | + choco install opencppcoverage + $env:Path += ";C:\Program Files\OpenCppCoverage" + mkdir __out + $cmd = 'OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} + $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " + $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " + $exclusions = @( + # Lines marked with LCov or coverity exclusion comments + '.*// LCOV_EXCL_LINE' + '.*// coverity\[dead_error_line\]' + # Lines containing only braces + '\s*[}{]*\s*' + # Lines containing only else (and opt. braces) + '\s*(\} )?else( \{)?\s*' + ) + $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " + $cmd += " --cover_children -- cmd.exe /c `"cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3`"" + $cmd + Invoke-Expression $cmd + + - name: Upload coverage + if: matrix.coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + disable_search: true + files: __out/cobertura.xml + name: Github Actions (Windows) + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + + cmake: + name: cmake (${{ matrix.name && format('{0}, ', matrix.name) || '' }}${{ matrix.os }}, ${{ matrix.build_shared }}, ${{ matrix.build_type }}, ${{ matrix.generator }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + - { os: ubuntu-latest, build_shared: "OFF", build_type: Debug, generator: "Unix Makefiles" } + - { os: windows-2022, build_shared: "ON", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2022, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2025-vs2026, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 18 2026" } + - { name: "Min. CMake", cmake_version: "3.16", + os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + + steps: + - name: Cache CMake + if: matrix.cmake_version + id: cache-cmake + uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 + with: + path: /tmp/cmake + key: ${{ runner.os }}-cmake-${{ matrix.cmake_version }} + + - name: Install CMake dependencies + if: matrix.cmake_version + run: | + sudo apt-get -o Acquire::Retries=3 update + sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev + echo /tmp/cmake/bin >> "$GITHUB_PATH" + + - name: Build CMake + if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' + run: | + version=${{ matrix.cmake_version }} + [[ ${version} =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || version+=".0" + filename="cmake-$version.tar.gz" + cd "$(mktemp -d)" + wget https://cmake.org/files/v${version%.*}/$filename + tar -xf $filename --strip-components=1 + flags=( + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" + "-B" "__build" + "-Wno-dev" # Make configuring more silent + "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 + "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 + ) + cmake "${flags[@]}" . + cmake --build __build -- -j 3 + cmake --build __build --target install + + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup Boost + run: | + set -x + SRC=$(pwd) + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF##*/} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep + rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" + # Through tar so symlinks are restored as-is on Windows + tar -C "$SRC" -cf - . | tar -C "libs/$SELF" -xf - + $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" + echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" + + - name: Run CMake tests + run: | + cd "$BOOST_ROOT" + mkdir __build_cmake_test__ && cd __build_cmake_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON .. + cmake --build . --target tests --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Run CMake subdir tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test" + mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__ + extra_args=() + # On Windows DLLs need to be either in PATH or in the same folder as the executable, so put all binaries into the same folder + if [[ "$RUNNER_OS" == "Windows" ]] && [[ "${{ matrix.build_shared }}" == "ON" ]]; then + extra_args+=("-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(cygpath -m "$(pwd)/bin")") + fi + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} "${extra_args[@]}" .. + cmake --build . --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Install Library + run: | + BCM_INSTALL_PATH=/tmp/boost_install + echo "BCM_INSTALL_PATH=$BCM_INSTALL_PATH" >> "$GITHUB_ENV" + cd "$BOOST_ROOT" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_INSTALL_PREFIX="$BCM_INSTALL_PATH" -DBoost_VERBOSE=ON -DBoost_DEBUG=ON .. + cmake --build . --target install --config ${{ matrix.build_type }} -j3 + + - name: Run CMake install tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_install_test" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + unset BOOST_ROOT # Make sure CMake finds the installed config, not the source tree + cmake -G "${{ matrix.generator }}" -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$BCM_INSTALL_PATH" -DCMAKE_VERBOSE_MAKEFILE=ON .. + cmake --build . --config ${{ matrix.build_type }} -j3 + if [ "$RUNNER_OS" == "Windows" ]; then + export PATH="$BCM_INSTALL_PATH/bin:$PATH" + else + export LD_LIBRARY_PATH="$BCM_INSTALL_PATH/lib:${LD_LIBRARY_PATH:-}" + fi + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} From c23012bbf2feb817cab0299e5c3b060a0dc91039 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 14:44:46 -0400 Subject: [PATCH 07/15] test/cmp_exn.cpp: cast BOOST_C_EXN operand to void to silence -Wunused-comparison --- test/cmp_exn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmp_exn.cpp b/test/cmp_exn.cpp index 0873fc5..92f237f 100644 --- a/test/cmp_exn.cpp +++ b/test/cmp_exn.cpp @@ -32,7 +32,7 @@ typedef boost::numeric::interval_lib::policies< empty_class, my_checking > typedef boost::numeric::interval I; #define BOOST_C_EXN(e) \ - BOOST_TEST_THROWS(e, boost::numeric::interval_lib::comparison_error) + BOOST_TEST_THROWS((void)(e), boost::numeric::interval_lib::comparison_error) static void test_cer() { From aadc712c2fbee69598611b747403c37a5d2ae308 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 15:22:12 -0400 Subject: [PATCH 08/15] CI: split into posix/windows/cmake workflows; fix Windows bootstrap, coverage and subdir test --- .github/workflows/cmake.yml | 165 ++++++++++++++++++ .github/workflows/{ci.yml => posix.yml} | 216 +----------------------- .github/workflows/windows.yml | 144 ++++++++++++++++ 3 files changed, 310 insertions(+), 215 deletions(-) create mode 100644 .github/workflows/cmake.yml rename .github/workflows/{ci.yml => posix.yml} (62%) create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..f772a01 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,165 @@ +# Copyright 2020-2021 Peter Dimov +# Copyright 2021 Andrey Semashev +# Copyright 2021-2026 Alexander Grund +# Copyright 2022-2025 James E. King III +# Copyright 2026 Sayan +# +# 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) +# +# Self-contained CI. It runs the same jobs on the same platforms as the +# Boost.CI reusable workflow this repository used before, with the settings +# it passed to it: +# - MinGW disabled (https://github.com/boostorg/interval/issues/41) +# - clang before 11 excluded: clang < 10 does not support the necessary +# floating point options (-frounding-math) and clang 10 has a C++20 +# ambiguous operator resolution bug +# (https://github.com/llvm/llvm-project/issues/43110) +--- +name: CMake + +permissions: + contents: read + +on: + pull_request: + push: + branches: + - master + - develop + - bugfix/** + - feature/** + - fix/** + - pr/** + paths-ignore: + - LICENSE + - meta/** + - README.md + +concurrency: + group: ${{ github.ref }}:${{ github.workflow_ref }} + cancel-in-progress: true + +env: + SELF: numeric/interval + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + B2_LINK: shared,static + B2_VARIANT: debug,release + +jobs: + cmake: + name: cmake (${{ matrix.name && format('{0}, ', matrix.name) || '' }}${{ matrix.os }}, ${{ matrix.build_shared }}, ${{ matrix.build_type }}, ${{ matrix.generator }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + - { os: ubuntu-latest, build_shared: "OFF", build_type: Debug, generator: "Unix Makefiles" } + - { os: windows-2022, build_shared: "ON", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2022, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2025-vs2026, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 18 2026" } + - { name: "Min. CMake", cmake_version: "3.16", + os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + + steps: + - name: Cache CMake + if: matrix.cmake_version + id: cache-cmake + uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 + with: + path: /tmp/cmake + key: ${{ runner.os }}-cmake-${{ matrix.cmake_version }} + + - name: Install CMake dependencies + if: matrix.cmake_version + run: | + sudo apt-get -o Acquire::Retries=3 update + sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev + echo /tmp/cmake/bin >> "$GITHUB_PATH" + + - name: Build CMake + if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' + run: | + version=${{ matrix.cmake_version }} + [[ ${version} =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || version+=".0" + filename="cmake-$version.tar.gz" + cd "$(mktemp -d)" + wget https://cmake.org/files/v${version%.*}/$filename + tar -xf $filename --strip-components=1 + flags=( + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" + "-B" "__build" + "-Wno-dev" # Make configuring more silent + "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 + "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 + ) + cmake "${flags[@]}" . + cmake --build __build -- -j 3 + cmake --build __build --target install + + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup Boost + run: | + set -x + SRC=$(pwd) + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF##*/} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep + rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" + # Through tar so symlinks are restored as-is on Windows + tar -C "$SRC" -cf - . | tar -C "libs/$SELF" -xf - + $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" + echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" + + - name: Run CMake tests + run: | + cd "$BOOST_ROOT" + mkdir __build_cmake_test__ && cd __build_cmake_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON .. + cmake --build . --target tests --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Run CMake subdir tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test" + mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} .. + cmake --build . --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Install Library + run: | + BCM_INSTALL_PATH=/tmp/boost_install + echo "BCM_INSTALL_PATH=$BCM_INSTALL_PATH" >> "$GITHUB_ENV" + cd "$BOOST_ROOT" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_INSTALL_PREFIX="$BCM_INSTALL_PATH" -DBoost_VERBOSE=ON -DBoost_DEBUG=ON .. + cmake --build . --target install --config ${{ matrix.build_type }} -j3 + + - name: Run CMake install tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_install_test" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + unset BOOST_ROOT # Make sure CMake finds the installed config, not the source tree + cmake -G "${{ matrix.generator }}" -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$BCM_INSTALL_PATH" -DCMAKE_VERBOSE_MAKEFILE=ON .. + cmake --build . --config ${{ matrix.build_type }} -j3 + if [ "$RUNNER_OS" == "Windows" ]; then + export PATH="$BCM_INSTALL_PATH/bin:$PATH" + else + export LD_LIBRARY_PATH="$BCM_INSTALL_PATH/lib:${LD_LIBRARY_PATH:-}" + fi + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/ci.yml b/.github/workflows/posix.yml similarity index 62% rename from .github/workflows/ci.yml rename to .github/workflows/posix.yml index 1b406eb..2ccfada 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/posix.yml @@ -16,7 +16,7 @@ # ambiguous operator resolution bug # (https://github.com/llvm/llvm-project/issues/43110) --- -name: CI +name: POSIX permissions: contents: read @@ -397,217 +397,3 @@ jobs: --form version="${GITHUB_REF_NAME}" \ --form description="${GITHUB_REPOSITORY}:${GITHUB_REF}:${GITHUB_SHA}:${GITHUB_RUN_NUMBER}" \ https://scan.coverity.com/builds?project="${GITHUB_REPOSITORY}" - - windows: - name: windows (${{ matrix.name || matrix.toolset }}, ${{ matrix.cxxstd }}, ${{ matrix.address-model }}, ${{ matrix.os }}${{ matrix.target-os && ', cygwin' || '' }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 120 - - defaults: - run: - shell: cmd - - strategy: - fail-fast: false - matrix: - include: - - { toolset: msvc-14.3, bootstrap: vc143, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } - - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } - - { toolset: msvc-14.3, bootstrap: vc143, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } - - { name: "Collect coverage w/ VS 2022", coverage: "yes", - toolset: msvc-14.3, bootstrap: vc143, cxxstd: "latest", address-model: "64", os: windows-2022 } - - { name: "Collect coverage w/ VS 2026", coverage: "yes", - toolset: msvc-14.5, cxxstd: "latest", address-model: "64", os: windows-2025-vs2026 } - - { toolset: clang-win, bootstrap: clang-win, cxxstd: "14,17,latest", address-model: "32,64", os: windows-2025, b2_flags: "embed-manifest-via=linker" } - - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2022 } - - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "32", os: windows-2025, target-os: cygwin } - - { toolset: gcc, bootstrap: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2025, target-os: cygwin } - - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Setup cygwin - if: ${{ matrix.target-os == 'cygwin' }} - uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1 - with: - site: ${{ matrix.address-model == '64' && 'https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin' || 'https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin-archive/20221123' }} - packages: coreutils, gcc-g++, libstdc++6, make, moreutils, openssl, libbz2-devel, libgmp-devel, libicu-devel, libjpeg-devel, libmpfr-devel, libpng-devel, libssl-devel, libtiff-devel, libxslt-devel, libzstd-devel - platform: ${{ matrix.address-model == '64' && 'x86_64' || 'x86' }} - - - name: Setup Boost - run: | - set BOOST_BRANCH=develop - if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) - for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master - echo BOOST_BRANCH: %BOOST_BRANCH% - cd .. || exit /b 1 - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 - cd boost-root || exit /b 1 - git submodule update -q --init tools/boostdep || exit /b 1 - xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 - python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 - echo BOOST_ROOT=%cd%>> %GITHUB_ENV% - cmd /c bootstrap ${{ matrix.bootstrap }} - if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) - b2 -d0 headers - - - name: Run tests - if: '!matrix.coverage' - run: | - cd /d %BOOST_ROOT% - b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} - - - name: Collect coverage - if: matrix.coverage - shell: powershell - run: | - choco install opencppcoverage - $env:Path += ";C:\Program Files\OpenCppCoverage" - mkdir __out - $cmd = 'OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} - $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " - $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " - $exclusions = @( - # Lines marked with LCov or coverity exclusion comments - '.*// LCOV_EXCL_LINE' - '.*// coverity\[dead_error_line\]' - # Lines containing only braces - '\s*[}{]*\s*' - # Lines containing only else (and opt. braces) - '\s*(\} )?else( \{)?\s*' - ) - $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " - $cmd += " --cover_children -- cmd.exe /c `"cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3`"" - $cmd - Invoke-Expression $cmd - - - name: Upload coverage - if: matrix.coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - with: - disable_search: true - files: __out/cobertura.xml - name: Github Actions (Windows) - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true - - cmake: - name: cmake (${{ matrix.name && format('{0}, ', matrix.name) || '' }}${{ matrix.os }}, ${{ matrix.build_shared }}, ${{ matrix.build_type }}, ${{ matrix.generator }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 120 - - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - - { os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } - - { os: ubuntu-latest, build_shared: "OFF", build_type: Debug, generator: "Unix Makefiles" } - - { os: windows-2022, build_shared: "ON", build_type: Debug, generator: "Visual Studio 17 2022" } - - { os: windows-2022, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 17 2022" } - - { os: windows-2025-vs2026, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 18 2026" } - - { name: "Min. CMake", cmake_version: "3.16", - os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } - - steps: - - name: Cache CMake - if: matrix.cmake_version - id: cache-cmake - uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 - with: - path: /tmp/cmake - key: ${{ runner.os }}-cmake-${{ matrix.cmake_version }} - - - name: Install CMake dependencies - if: matrix.cmake_version - run: | - sudo apt-get -o Acquire::Retries=3 update - sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev - echo /tmp/cmake/bin >> "$GITHUB_PATH" - - - name: Build CMake - if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' - run: | - version=${{ matrix.cmake_version }} - [[ ${version} =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || version+=".0" - filename="cmake-$version.tar.gz" - cd "$(mktemp -d)" - wget https://cmake.org/files/v${version%.*}/$filename - tar -xf $filename --strip-components=1 - flags=( - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" - "-B" "__build" - "-Wno-dev" # Make configuring more silent - "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 - "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 - ) - cmake "${flags[@]}" . - cmake --build __build -- -j 3 - cmake --build __build --target install - - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Setup Boost - run: | - set -x - SRC=$(pwd) - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF##*/} - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - git submodule update -q --init tools/boostdep - rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" - # Through tar so symlinks are restored as-is on Windows - tar -C "$SRC" -cf - . | tar -C "libs/$SELF" -xf - - $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" - echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" - - - name: Run CMake tests - run: | - cd "$BOOST_ROOT" - mkdir __build_cmake_test__ && cd __build_cmake_test__ - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON .. - cmake --build . --target tests --config ${{ matrix.build_type }} -j3 - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} - - - name: Run CMake subdir tests - run: | - cd "$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test" - mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__ - extra_args=() - # On Windows DLLs need to be either in PATH or in the same folder as the executable, so put all binaries into the same folder - if [[ "$RUNNER_OS" == "Windows" ]] && [[ "${{ matrix.build_shared }}" == "ON" ]]; then - extra_args+=("-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(cygpath -m "$(pwd)/bin")") - fi - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} "${extra_args[@]}" .. - cmake --build . --config ${{ matrix.build_type }} -j3 - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} - - - name: Install Library - run: | - BCM_INSTALL_PATH=/tmp/boost_install - echo "BCM_INSTALL_PATH=$BCM_INSTALL_PATH" >> "$GITHUB_ENV" - cd "$BOOST_ROOT" - mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_INSTALL_PREFIX="$BCM_INSTALL_PATH" -DBoost_VERBOSE=ON -DBoost_DEBUG=ON .. - cmake --build . --target install --config ${{ matrix.build_type }} -j3 - - - name: Run CMake install tests - run: | - cd "$BOOST_ROOT/libs/$SELF/test/cmake_install_test" - mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ - unset BOOST_ROOT # Make sure CMake finds the installed config, not the source tree - cmake -G "${{ matrix.generator }}" -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$BCM_INSTALL_PATH" -DCMAKE_VERBOSE_MAKEFILE=ON .. - cmake --build . --config ${{ matrix.build_type }} -j3 - if [ "$RUNNER_OS" == "Windows" ]; then - export PATH="$BCM_INSTALL_PATH/bin:$PATH" - else - export LD_LIBRARY_PATH="$BCM_INSTALL_PATH/lib:${LD_LIBRARY_PATH:-}" - fi - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..a772e7d --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,144 @@ +# Copyright 2020-2021 Peter Dimov +# Copyright 2021 Andrey Semashev +# Copyright 2021-2026 Alexander Grund +# Copyright 2022-2025 James E. King III +# Copyright 2026 Sayan +# +# 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) +# +# Self-contained CI. It runs the same jobs on the same platforms as the +# Boost.CI reusable workflow this repository used before, with the settings +# it passed to it: +# - MinGW disabled (https://github.com/boostorg/interval/issues/41) +# - clang before 11 excluded: clang < 10 does not support the necessary +# floating point options (-frounding-math) and clang 10 has a C++20 +# ambiguous operator resolution bug +# (https://github.com/llvm/llvm-project/issues/43110) +--- +name: Windows + +permissions: + contents: read + +on: + pull_request: + push: + branches: + - master + - develop + - bugfix/** + - feature/** + - fix/** + - pr/** + paths-ignore: + - LICENSE + - meta/** + - README.md + +concurrency: + group: ${{ github.ref }}:${{ github.workflow_ref }} + cancel-in-progress: true + +env: + SELF: numeric/interval + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + B2_LINK: shared,static + B2_VARIANT: debug,release + +jobs: + windows: + name: windows (${{ matrix.name || matrix.toolset }}, ${{ matrix.cxxstd }}, ${{ matrix.address-model }}, ${{ matrix.os }}${{ matrix.target-os && ', cygwin' || '' }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: cmd + + strategy: + fail-fast: false + matrix: + include: + - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } + - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } + - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } + - { name: "Collect coverage w/ VS 2022", coverage: "yes", + toolset: msvc-14.3, cxxstd: "latest", address-model: "64", os: windows-2022 } + - { name: "Collect coverage w/ VS 2026", coverage: "yes", + toolset: msvc-14.5, cxxstd: "latest", address-model: "64", os: windows-2025-vs2026 } + - { toolset: clang-win, cxxstd: "14,17,latest", address-model: "32,64", os: windows-2025, b2_flags: "embed-manifest-via=linker" } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2022 } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "32", os: windows-2025, target-os: cygwin } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2025, target-os: cygwin } + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup cygwin + if: ${{ matrix.target-os == 'cygwin' }} + uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1 + with: + site: ${{ matrix.address-model == '64' && 'https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin' || 'https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin-archive/20221123' }} + packages: coreutils, gcc-g++, libstdc++6, make, moreutils, openssl, libbz2-devel, libgmp-devel, libicu-devel, libjpeg-devel, libmpfr-devel, libpng-devel, libssl-devel, libtiff-devel, libxslt-devel, libzstd-devel + platform: ${{ matrix.address-model == '64' && 'x86_64' || 'x86' }} + + - name: Setup Boost + run: | + set BOOST_BRANCH=develop + if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) + for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. || exit /b 1 + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 + cd boost-root || exit /b 1 + git submodule update -q --init tools/boostdep || exit /b 1 + xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 + echo BOOST_ROOT=%cd%>> %GITHUB_ENV% + cmd /c bootstrap + if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) + b2 -d0 headers + + - name: Run tests + if: '!matrix.coverage' + run: | + cd /d %BOOST_ROOT% + b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} + + - name: Collect coverage + if: matrix.coverage + shell: powershell + run: | + choco install opencppcoverage + $env:Path += ";C:\Program Files\OpenCppCoverage" + mkdir __out + # Run b2 from a batch file: OpenCppCoverage quotes each argument, which breaks an inline "cd && b2" + Set-Content -Path __out\run_tests.bat -Value "cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3" + $cmd ='OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} + $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " + $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " + $exclusions = @( + # Lines marked with LCov or coverity exclusion comments + '.*// LCOV_EXCL_LINE' + '.*// coverity\[dead_error_line\]' + # Lines containing only braces + '\s*[}{]*\s*' + # Lines containing only else (and opt. braces) + '\s*(\} )?else( \{)?\s*' + ) + $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " + $cmd += " --cover_children -- cmd.exe /c ${PWD}\__out\run_tests.bat" + $cmd + Invoke-Expression $cmd + + - name: Upload coverage + if: matrix.coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + disable_search: true + files: __out/cobertura.xml + name: Github Actions (Windows) + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true From 8df0b422b2c0ef7888f642e1c6c883a9d1a20eb4 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 15:41:25 -0400 Subject: [PATCH 09/15] CI: use msvc-14.5 on windows-11-arm (image now has VS 2026 only) --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a772e7d..d2a0989 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -63,7 +63,7 @@ jobs: include: - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } - - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } + - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } - { name: "Collect coverage w/ VS 2022", coverage: "yes", toolset: msvc-14.3, cxxstd: "latest", address-model: "64", os: windows-2022 } - { name: "Collect coverage w/ VS 2026", coverage: "yes", From 50e5f9c58e2991d522f7c9a2148b293f37747f3d Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 15:42:08 -0400 Subject: [PATCH 10/15] CI: consistent formatting in workflow files --- .github/workflows/posix.yml | 72 +++++++++++++++++----------------- .github/workflows/windows.yml | 74 +++++++++++++++++------------------ 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index 2ccfada..42eac0f 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -62,53 +62,53 @@ jobs: matrix: include: # libstdc++ - - { compiler: gcc-4.7, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } - - { compiler: gcc-4.8, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } - - { compiler: gcc-4.9, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } - - { compiler: gcc-5, cxxstd: "11,14,1z", os: ubuntu-latest, container: "ubuntu:18.04" } - - { compiler: gcc-6, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:18.04" } - - { compiler: gcc-7, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:20.04" } - - { compiler: gcc-8, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: "ubuntu:20.04" } - - { compiler: gcc-9, cxxstd: "11,14,17,2a", os: ubuntu-22.04 } - - { compiler: gcc-10, cxxstd: "11,14,17,20", os: ubuntu-22.04 } - - { compiler: gcc-11, cxxstd: "11,14,17,20", os: ubuntu-22.04 } - - { compiler: gcc-12, cxxstd: "11,14,17,20", os: ubuntu-22.04 } - - { compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04 } + - { compiler: gcc-4.7, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-4.8, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-4.9, cxxstd: "11", os: ubuntu-latest, container: "ubuntu:16.04" } + - { compiler: gcc-5, cxxstd: "11,14,1z", os: ubuntu-latest, container: "ubuntu:18.04" } + - { compiler: gcc-6, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:18.04" } + - { compiler: gcc-7, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: gcc-8, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: gcc-9, cxxstd: "11,14,17,2a", os: ubuntu-22.04 } + - { compiler: gcc-10, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-11, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-12, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04 } - { name: "Coverage w/ GCC on Linux", coverage: "yes", - compiler: gcc-13, cxxstd: "2b", os: ubuntu-24.04, install: "g++-13-multilib gcc-multilib", address-model: "32,64" } + compiler: gcc-13, cxxstd: "2b", os: ubuntu-24.04, install: "g++-13-multilib gcc-multilib", address-model: "32,64" } - { name: "GCC w/ sanitizers", sanitize: "yes", - compiler: gcc-13, cxxstd: "11,14,17,20", os: ubuntu-24.04 } - - { compiler: gcc-14, cxxstd: "11,14,17,20,23", os: ubuntu-24.04 } - - { compiler: gcc-15, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } - - { compiler: gcc-16, cxxstd: "11,14,17,20,23,26", os: ubuntu-latest, container: "ubuntu:26.04" } - - { compiler: clang-11, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } - - { compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } - - { compiler: clang-13, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } - - { compiler: clang-14, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } - - { compiler: clang-15, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } - - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: ubuntu-latest, container: "ubuntu:24.04" } - - { compiler: clang-17, cxxstd: "11,14,17,20,23", os: ubuntu-latest, container: "ubuntu:24.04" } - - { compiler: clang-18, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } - - { compiler: clang-19, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } - - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:25.04" } - - { compiler: clang-21, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } - - { compiler: clang-22, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + compiler: gcc-13, cxxstd: "11,14,17,20", os: ubuntu-24.04 } + - { compiler: gcc-14, cxxstd: "11,14,17,20,23", os: ubuntu-24.04 } + - { compiler: gcc-15, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: gcc-16, cxxstd: "11,14,17,20,23,26", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: clang-11, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + - { compiler: clang-13, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-14, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-15, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: ubuntu-latest, container: "ubuntu:24.04" } + - { compiler: clang-17, cxxstd: "11,14,17,20,23", os: ubuntu-latest, container: "ubuntu:24.04" } + - { compiler: clang-18, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } + - { compiler: clang-19, cxxstd: "11,14,17,20,23,2c", os: ubuntu-24.04 } + - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:25.04" } + - { compiler: clang-21, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } + - { compiler: clang-22, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "ubuntu:26.04" } - { compiler: icpx-2025, cxxstd: "11,14,17,20,23,2c", os: ubuntu-latest, container: "intel/oneapi-hpckit:2025.2.2-0-devel-ubuntu24.04" } # libc++ - { name: "Clang w/ sanitizers", sanitize: "yes", stdlib: "libc++", - compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } + compiler: clang-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:20.04" } # MacOS - { name: "MacOS sanitize w/ clang", sanitize: "yes", - compiler: clang, cxxstd: "11,14,17,20,2b", os: macos-14 } - - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: macos-15, xcode_app: "Xcode_16.2" } - - { compiler: clang-18, cxxstd: "11,14,17,20,2b", os: macos-15 } - - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: macos-26 } + compiler: clang, cxxstd: "11,14,17,20,2b", os: macos-14 } + - { compiler: clang-16, cxxstd: "11,14,17,20,2b", os: macos-15, xcode_app: "Xcode_16.2" } + - { compiler: clang-18, cxxstd: "11,14,17,20,2b", os: macos-15 } + - { compiler: clang-20, cxxstd: "11,14,17,20,23,2c", os: macos-26 } # Arm64 - { name: "ARM64 w/ GCC", - compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04-arm } + compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04-arm } # Big-Endian - { name: "Big Endian w/ Clang on s390x", multiarch: "yes", - compiler: clang, cxxstd: "17", os: ubuntu-latest, distro: fedora, edition: "34", arch: s390x } + compiler: clang, cxxstd: "17", os: ubuntu-latest, distro: fedora, edition: "34", arch: s390x } container: image: ${{ matrix.container }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d2a0989..80b4e7d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -86,52 +86,52 @@ jobs: - name: Setup Boost run: | - set BOOST_BRANCH=develop - if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) - for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master - echo BOOST_BRANCH: %BOOST_BRANCH% - cd .. || exit /b 1 - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 - cd boost-root || exit /b 1 - git submodule update -q --init tools/boostdep || exit /b 1 - xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 - python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 - echo BOOST_ROOT=%cd%>> %GITHUB_ENV% - cmd /c bootstrap - if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) - b2 -d0 headers + set BOOST_BRANCH=develop + if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) + for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. || exit /b 1 + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 + cd boost-root || exit /b 1 + git submodule update -q --init tools/boostdep || exit /b 1 + xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 + echo BOOST_ROOT=%cd%>> %GITHUB_ENV% + cmd /c bootstrap + if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) + b2 -d0 headers - name: Run tests if: '!matrix.coverage' run: | - cd /d %BOOST_ROOT% - b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} + cd /d %BOOST_ROOT% + b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} - name: Collect coverage if: matrix.coverage shell: powershell run: | - choco install opencppcoverage - $env:Path += ";C:\Program Files\OpenCppCoverage" - mkdir __out - # Run b2 from a batch file: OpenCppCoverage quotes each argument, which breaks an inline "cd && b2" - Set-Content -Path __out\run_tests.bat -Value "cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3" - $cmd ='OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} - $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " - $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " - $exclusions = @( - # Lines marked with LCov or coverity exclusion comments - '.*// LCOV_EXCL_LINE' - '.*// coverity\[dead_error_line\]' - # Lines containing only braces - '\s*[}{]*\s*' - # Lines containing only else (and opt. braces) - '\s*(\} )?else( \{)?\s*' - ) - $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " - $cmd += " --cover_children -- cmd.exe /c ${PWD}\__out\run_tests.bat" - $cmd - Invoke-Expression $cmd + choco install opencppcoverage + $env:Path += ";C:\Program Files\OpenCppCoverage" + mkdir __out + # Run b2 from a batch file: OpenCppCoverage quotes each argument, which breaks an inline "cd && b2" + Set-Content -Path __out\run_tests.bat -Value "cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3" + $cmd ='OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} + $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " + $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " + $exclusions = @( + # Lines marked with LCov or coverity exclusion comments + '.*// LCOV_EXCL_LINE' + '.*// coverity\[dead_error_line\]' + # Lines containing only braces + '\s*[}{]*\s*' + # Lines containing only else (and opt. braces) + '\s*(\} )?else( \{)?\s*' + ) + $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " + $cmd += " --cover_children -- cmd.exe /c ${PWD}\__out\run_tests.bat" + $cmd + Invoke-Expression $cmd - name: Upload coverage if: matrix.coverage From 9d85bda7fc6be9221b69b8176a128fa453c1e76d Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 18:34:13 -0400 Subject: [PATCH 11/15] CI: use unversioned msvc on windows-11-arm (image varies between VS 2022 and VS 2026) --- .github/workflows/windows.yml | 2 +- CMakeLists.txt | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 80b4e7d..56a8e9a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -63,7 +63,7 @@ jobs: include: - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } - - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } + - { toolset: msvc, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } - { name: "Collect coverage w/ VS 2022", coverage: "yes", toolset: msvc-14.3, cxxstd: "latest", address-model: "64", os: windows-2022 } - { name: "Collect coverage w/ VS 2026", coverage: "yes", diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e366c5..e795287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,6 @@ target_link_libraries(boost_numeric_interval ) if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") - add_subdirectory(test) - endif() From 329626bf763628be2abd4d0be43aa7261bad0ec8 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 18:35:50 -0400 Subject: [PATCH 12/15] Restore blank lines in CMakeLists.txt --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e795287..9e366c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,8 @@ target_link_libraries(boost_numeric_interval ) if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") + add_subdirectory(test) + endif() From fc134f4760af28d90ce776bd7d3710a978a92dd8 Mon Sep 17 00:00:00 2001 From: Sayan Date: Fri, 25 Sep 2026 19:03:53 -0400 Subject: [PATCH 13/15] CI: merge workflows back into a single ci.yml --- .github/workflows/{posix.yml => ci.yml} | 213 +++++++++++++++++++++++- .github/workflows/cmake.yml | 165 ------------------ .github/workflows/windows.yml | 144 ---------------- 3 files changed, 212 insertions(+), 310 deletions(-) rename .github/workflows/{posix.yml => ci.yml} (63%) delete mode 100644 .github/workflows/cmake.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/posix.yml b/.github/workflows/ci.yml similarity index 63% rename from .github/workflows/posix.yml rename to .github/workflows/ci.yml index 42eac0f..bdf69f5 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ # ambiguous operator resolution bug # (https://github.com/llvm/llvm-project/issues/43110) --- -name: POSIX +name: CI permissions: contents: read @@ -397,3 +397,214 @@ jobs: --form version="${GITHUB_REF_NAME}" \ --form description="${GITHUB_REPOSITORY}:${GITHUB_REF}:${GITHUB_SHA}:${GITHUB_RUN_NUMBER}" \ https://scan.coverity.com/builds?project="${GITHUB_REPOSITORY}" + + windows: + name: windows (${{ matrix.name || matrix.toolset }}, ${{ matrix.cxxstd }}, ${{ matrix.address-model }}, ${{ matrix.os }}${{ matrix.target-os && ', cygwin' || '' }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: cmd + + strategy: + fail-fast: false + matrix: + include: + - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } + - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } + - { toolset: msvc, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } + - { name: "Collect coverage w/ VS 2022", coverage: "yes", + toolset: msvc-14.3, cxxstd: "latest", address-model: "64", os: windows-2022 } + - { name: "Collect coverage w/ VS 2026", coverage: "yes", + toolset: msvc-14.5, cxxstd: "latest", address-model: "64", os: windows-2025-vs2026 } + - { toolset: clang-win, cxxstd: "14,17,latest", address-model: "32,64", os: windows-2025, b2_flags: "embed-manifest-via=linker" } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2022 } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "32", os: windows-2025, target-os: cygwin } + - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2025, target-os: cygwin } + + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup cygwin + if: ${{ matrix.target-os == 'cygwin' }} + uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1 + with: + site: ${{ matrix.address-model == '64' && 'https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin' || 'https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin-archive/20221123' }} + packages: coreutils, gcc-g++, libstdc++6, make, moreutils, openssl, libbz2-devel, libgmp-devel, libicu-devel, libjpeg-devel, libmpfr-devel, libpng-devel, libssl-devel, libtiff-devel, libxslt-devel, libzstd-devel + platform: ${{ matrix.address-model == '64' && 'x86_64' || 'x86' }} + + - name: Setup Boost + run: | + set BOOST_BRANCH=develop + if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) + for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. || exit /b 1 + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 + cd boost-root || exit /b 1 + git submodule update -q --init tools/boostdep || exit /b 1 + xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 + echo BOOST_ROOT=%cd%>> %GITHUB_ENV% + cmd /c bootstrap + if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) + b2 -d0 headers + + - name: Run tests + if: '!matrix.coverage' + run: | + cd /d %BOOST_ROOT% + b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} + + - name: Collect coverage + if: matrix.coverage + shell: powershell + run: | + choco install opencppcoverage + $env:Path += ";C:\Program Files\OpenCppCoverage" + mkdir __out + # Run b2 from a batch file: OpenCppCoverage quotes each argument, which breaks an inline "cd && b2" + Set-Content -Path __out\run_tests.bat -Value "cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3" + $cmd ='OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} + $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " + $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " + $exclusions = @( + # Lines marked with LCov or coverity exclusion comments + '.*// LCOV_EXCL_LINE' + '.*// coverity\[dead_error_line\]' + # Lines containing only braces + '\s*[}{]*\s*' + # Lines containing only else (and opt. braces) + '\s*(\} )?else( \{)?\s*' + ) + $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " + $cmd += " --cover_children -- cmd.exe /c ${PWD}\__out\run_tests.bat" + $cmd + Invoke-Expression $cmd + + - name: Upload coverage + if: matrix.coverage + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 + with: + disable_search: true + files: __out/cobertura.xml + name: Github Actions (Windows) + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + + cmake: + name: cmake (${{ matrix.name && format('{0}, ', matrix.name) || '' }}${{ matrix.os }}, ${{ matrix.build_shared }}, ${{ matrix.build_type }}, ${{ matrix.generator }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + - { os: ubuntu-latest, build_shared: "OFF", build_type: Debug, generator: "Unix Makefiles" } + - { os: windows-2022, build_shared: "ON", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2022, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 17 2022" } + - { os: windows-2025-vs2026, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 18 2026" } + - { name: "Min. CMake", cmake_version: "3.16", + os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } + + steps: + - name: Cache CMake + if: matrix.cmake_version + id: cache-cmake + uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 + with: + path: /tmp/cmake + key: ${{ runner.os }}-cmake-${{ matrix.cmake_version }} + + - name: Install CMake dependencies + if: matrix.cmake_version + run: | + sudo apt-get -o Acquire::Retries=3 update + sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev + echo /tmp/cmake/bin >> "$GITHUB_PATH" + + - name: Build CMake + if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' + run: | + version=${{ matrix.cmake_version }} + [[ ${version} =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || version+=".0" + filename="cmake-$version.tar.gz" + cd "$(mktemp -d)" + wget https://cmake.org/files/v${version%.*}/$filename + tar -xf $filename --strip-components=1 + flags=( + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" + "-B" "__build" + "-Wno-dev" # Make configuring more silent + "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 + "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 + ) + cmake "${flags[@]}" . + cmake --build __build -- -j 3 + cmake --build __build --target install + + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Setup Boost + run: | + set -x + SRC=$(pwd) + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF##*/} + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + git submodule update -q --init tools/boostdep + rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" + # Through tar so symlinks are restored as-is on Windows + tar -C "$SRC" -cf - . | tar -C "libs/$SELF" -xf - + $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" + echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" + + - name: Run CMake tests + run: | + cd "$BOOST_ROOT" + mkdir __build_cmake_test__ && cd __build_cmake_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON .. + cmake --build . --target tests --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Run CMake subdir tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test" + mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} .. + cmake --build . --config ${{ matrix.build_type }} -j3 + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} + + - name: Install Library + run: | + BCM_INSTALL_PATH=/tmp/boost_install + echo "BCM_INSTALL_PATH=$BCM_INSTALL_PATH" >> "$GITHUB_ENV" + cd "$BOOST_ROOT" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_INSTALL_PREFIX="$BCM_INSTALL_PATH" -DBoost_VERBOSE=ON -DBoost_DEBUG=ON .. + cmake --build . --target install --config ${{ matrix.build_type }} -j3 + + - name: Run CMake install tests + run: | + cd "$BOOST_ROOT/libs/$SELF/test/cmake_install_test" + mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ + unset BOOST_ROOT # Make sure CMake finds the installed config, not the source tree + cmake -G "${{ matrix.generator }}" -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$BCM_INSTALL_PATH" -DCMAKE_VERBOSE_MAKEFILE=ON .. + cmake --build . --config ${{ matrix.build_type }} -j3 + if [ "$RUNNER_OS" == "Windows" ]; then + export PATH="$BCM_INSTALL_PATH/bin:$PATH" + else + export LD_LIBRARY_PATH="$BCM_INSTALL_PATH/lib:${LD_LIBRARY_PATH:-}" + fi + ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index f772a01..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,165 +0,0 @@ -# Copyright 2020-2021 Peter Dimov -# Copyright 2021 Andrey Semashev -# Copyright 2021-2026 Alexander Grund -# Copyright 2022-2025 James E. King III -# Copyright 2026 Sayan -# -# 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) -# -# Self-contained CI. It runs the same jobs on the same platforms as the -# Boost.CI reusable workflow this repository used before, with the settings -# it passed to it: -# - MinGW disabled (https://github.com/boostorg/interval/issues/41) -# - clang before 11 excluded: clang < 10 does not support the necessary -# floating point options (-frounding-math) and clang 10 has a C++20 -# ambiguous operator resolution bug -# (https://github.com/llvm/llvm-project/issues/43110) ---- -name: CMake - -permissions: - contents: read - -on: - pull_request: - push: - branches: - - master - - develop - - bugfix/** - - feature/** - - fix/** - - pr/** - paths-ignore: - - LICENSE - - meta/** - - README.md - -concurrency: - group: ${{ github.ref }}:${{ github.workflow_ref }} - cancel-in-progress: true - -env: - SELF: numeric/interval - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - B2_LINK: shared,static - B2_VARIANT: debug,release - -jobs: - cmake: - name: cmake (${{ matrix.name && format('{0}, ', matrix.name) || '' }}${{ matrix.os }}, ${{ matrix.build_shared }}, ${{ matrix.build_type }}, ${{ matrix.generator }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 120 - - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - include: - - { os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } - - { os: ubuntu-latest, build_shared: "OFF", build_type: Debug, generator: "Unix Makefiles" } - - { os: windows-2022, build_shared: "ON", build_type: Debug, generator: "Visual Studio 17 2022" } - - { os: windows-2022, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 17 2022" } - - { os: windows-2025-vs2026, build_shared: "OFF", build_type: Debug, generator: "Visual Studio 18 2026" } - - { name: "Min. CMake", cmake_version: "3.16", - os: ubuntu-latest, build_shared: "ON", build_type: Debug, generator: "Unix Makefiles" } - - steps: - - name: Cache CMake - if: matrix.cmake_version - id: cache-cmake - uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 - with: - path: /tmp/cmake - key: ${{ runner.os }}-cmake-${{ matrix.cmake_version }} - - - name: Install CMake dependencies - if: matrix.cmake_version - run: | - sudo apt-get -o Acquire::Retries=3 update - sudo apt-get -o Acquire::Retries=3 -y -q --no-install-suggests --no-install-recommends install curl libcurl4-openssl-dev libarchive-dev - echo /tmp/cmake/bin >> "$GITHUB_PATH" - - - name: Build CMake - if: matrix.cmake_version && steps.cache-cmake.outputs.cache-hit != 'true' - run: | - version=${{ matrix.cmake_version }} - [[ ${version} =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || version+=".0" - filename="cmake-$version.tar.gz" - cd "$(mktemp -d)" - wget https://cmake.org/files/v${version%.*}/$filename - tar -xf $filename --strip-components=1 - flags=( - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_PREFIX=/tmp/cmake" - "-B" "__build" - "-Wno-dev" # Make configuring more silent - "-DCMAKE_USE_SYSTEM_CURL=1" # Avoid failures caused by newer (system) OpenSSL in CMake < 3.10 - "-DCMAKE_CXX_FLAGS='-include cstdint -include limits'" # Fix missing includes in CMake < 3.10 - ) - cmake "${flags[@]}" . - cmake --build __build -- -j 3 - cmake --build __build --target install - - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Setup Boost - run: | - set -x - SRC=$(pwd) - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF##*/} - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - git submodule update -q --init tools/boostdep - rm -rf "libs/$SELF" && mkdir -p "libs/$SELF" - # Through tar so symlinks are restored as-is on Windows - tar -C "$SRC" -cf - . | tar -C "libs/$SELF" -xf - - $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" - echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" - - - name: Run CMake tests - run: | - cd "$BOOST_ROOT" - mkdir __build_cmake_test__ && cd __build_cmake_test__ - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DBUILD_TESTING=ON -DBoost_VERBOSE=ON .. - cmake --build . --target tests --config ${{ matrix.build_type }} -j3 - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} - - - name: Run CMake subdir tests - run: | - cd "$BOOST_ROOT/libs/$SELF/test/cmake_subdir_test" - mkdir __build_cmake_subdir_test__ && cd __build_cmake_subdir_test__ - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} .. - cmake --build . --config ${{ matrix.build_type }} -j3 - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} - - - name: Install Library - run: | - BCM_INSTALL_PATH=/tmp/boost_install - echo "BCM_INSTALL_PATH=$BCM_INSTALL_PATH" >> "$GITHUB_ENV" - cd "$BOOST_ROOT" - mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ - cmake -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBOOST_INCLUDE_LIBRARIES=$SELF -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_INSTALL_PREFIX="$BCM_INSTALL_PATH" -DBoost_VERBOSE=ON -DBoost_DEBUG=ON .. - cmake --build . --target install --config ${{ matrix.build_type }} -j3 - - - name: Run CMake install tests - run: | - cd "$BOOST_ROOT/libs/$SELF/test/cmake_install_test" - mkdir __build_cmake_install_test__ && cd __build_cmake_install_test__ - unset BOOST_ROOT # Make sure CMake finds the installed config, not the source tree - cmake -G "${{ matrix.generator }}" -DBUILD_SHARED_LIBS=${{ matrix.build_shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH="$BCM_INSTALL_PATH" -DCMAKE_VERBOSE_MAKEFILE=ON .. - cmake --build . --config ${{ matrix.build_type }} -j3 - if [ "$RUNNER_OS" == "Windows" ]; then - export PATH="$BCM_INSTALL_PATH/bin:$PATH" - else - export LD_LIBRARY_PATH="$BCM_INSTALL_PATH/lib:${LD_LIBRARY_PATH:-}" - fi - ctest --output-on-failure --no-tests=error --build-config ${{ matrix.build_type }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 56a8e9a..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,144 +0,0 @@ -# Copyright 2020-2021 Peter Dimov -# Copyright 2021 Andrey Semashev -# Copyright 2021-2026 Alexander Grund -# Copyright 2022-2025 James E. King III -# Copyright 2026 Sayan -# -# 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) -# -# Self-contained CI. It runs the same jobs on the same platforms as the -# Boost.CI reusable workflow this repository used before, with the settings -# it passed to it: -# - MinGW disabled (https://github.com/boostorg/interval/issues/41) -# - clang before 11 excluded: clang < 10 does not support the necessary -# floating point options (-frounding-math) and clang 10 has a C++20 -# ambiguous operator resolution bug -# (https://github.com/llvm/llvm-project/issues/43110) ---- -name: Windows - -permissions: - contents: read - -on: - pull_request: - push: - branches: - - master - - develop - - bugfix/** - - feature/** - - fix/** - - pr/** - paths-ignore: - - LICENSE - - meta/** - - README.md - -concurrency: - group: ${{ github.ref }}:${{ github.workflow_ref }} - cancel-in-progress: true - -env: - SELF: numeric/interval - GIT_FETCH_JOBS: 8 - NET_RETRY_COUNT: 5 - B2_LINK: shared,static - B2_VARIANT: debug,release - -jobs: - windows: - name: windows (${{ matrix.name || matrix.toolset }}, ${{ matrix.cxxstd }}, ${{ matrix.address-model }}, ${{ matrix.os }}${{ matrix.target-os && ', cygwin' || '' }}) - runs-on: ${{ matrix.os }} - timeout-minutes: 120 - - defaults: - run: - shell: cmd - - strategy: - fail-fast: false - matrix: - include: - - { toolset: msvc-14.3, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2022 } - - { toolset: msvc-14.5, cxxstd: "14,17,20,latest", address-model: "32,64", os: windows-2025-vs2026 } - - { toolset: msvc, cxxstd: "14,17,20,latest", address-model: "64", os: windows-11-arm } - - { name: "Collect coverage w/ VS 2022", coverage: "yes", - toolset: msvc-14.3, cxxstd: "latest", address-model: "64", os: windows-2022 } - - { name: "Collect coverage w/ VS 2026", coverage: "yes", - toolset: msvc-14.5, cxxstd: "latest", address-model: "64", os: windows-2025-vs2026 } - - { toolset: clang-win, cxxstd: "14,17,latest", address-model: "32,64", os: windows-2025, b2_flags: "embed-manifest-via=linker" } - - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2022 } - - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "32", os: windows-2025, target-os: cygwin } - - { toolset: gcc, cxxstd: "11,14,17,2a", address-model: "64", os: windows-2025, target-os: cygwin } - - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Setup cygwin - if: ${{ matrix.target-os == 'cygwin' }} - uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.1 - with: - site: ${{ matrix.address-model == '64' && 'https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin' || 'https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin-archive/20221123' }} - packages: coreutils, gcc-g++, libstdc++6, make, moreutils, openssl, libbz2-devel, libgmp-devel, libicu-devel, libjpeg-devel, libmpfr-devel, libpng-devel, libssl-devel, libtiff-devel, libxslt-devel, libzstd-devel - platform: ${{ matrix.address-model == '64' && 'x86_64' || 'x86' }} - - - name: Setup Boost - run: | - set BOOST_BRANCH=develop - if "%GITHUB_BASE_REF%" == "" (set TARGET_BRANCH=%GITHUB_REF%) else (set TARGET_BRANCH=%GITHUB_BASE_REF%) - for /f %%i in ("%TARGET_BRANCH%") do if "%%~nxi" == "master" set BOOST_BRANCH=master - echo BOOST_BRANCH: %BOOST_BRANCH% - cd .. || exit /b 1 - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root || exit /b 1 - cd boost-root || exit /b 1 - git submodule update -q --init tools/boostdep || exit /b 1 - xcopy /s /e /q /I %GITHUB_WORKSPACE% libs\numeric\interval || exit /b 1 - python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs %GIT_FETCH_JOBS%" %SELF% || exit /b 1 - echo BOOST_ROOT=%cd%>> %GITHUB_ENV% - cmd /c bootstrap - if not %ERRORLEVEL% == 0 (type bootstrap.log & exit /b 1) - b2 -d0 headers - - - name: Run tests - if: '!matrix.coverage' - run: | - cd /d %BOOST_ROOT% - b2 --abbreviate-paths libs/%SELF%/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} ${{ matrix.target-os && format('target-os={0}', matrix.target-os) || '' }} link=%B2_LINK% variant=%B2_VARIANT% -j3 ${{ matrix.b2_flags }} - - - name: Collect coverage - if: matrix.coverage - shell: powershell - run: | - choco install opencppcoverage - $env:Path += ";C:\Program Files\OpenCppCoverage" - mkdir __out - # Run b2 from a batch file: OpenCppCoverage quotes each argument, which breaks an inline "cd && b2" - Set-Content -Path __out\run_tests.bat -Value "cd /d ${env:BOOST_ROOT} && b2 --abbreviate-paths libs/${env:SELF}/test toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} address-model=${{ matrix.address-model }} link=${env:B2_LINK} variant=debug -j3" - $cmd ='OpenCppCoverage.exe --export_type cobertura:__out/cobertura.xml --modules "{0}" ' -f ${env:BOOST_ROOT} - $cmd += (Get-ChildItem -Name "${env:GITHUB_WORKSPACE}\include\boost").ForEach({'--sources "boost\{0}"' -f $_}) -join " " - $cmd += " --sources ${env:BOOST_ROOT}\libs\numeric\interval " - $exclusions = @( - # Lines marked with LCov or coverity exclusion comments - '.*// LCOV_EXCL_LINE' - '.*// coverity\[dead_error_line\]' - # Lines containing only braces - '\s*[}{]*\s*' - # Lines containing only else (and opt. braces) - '\s*(\} )?else( \{)?\s*' - ) - $cmd += $exclusions.ForEach({"--excluded_line_regex '{0}'" -f $_}) -join " " - $cmd += " --cover_children -- cmd.exe /c ${PWD}\__out\run_tests.bat" - $cmd - Invoke-Expression $cmd - - - name: Upload coverage - if: matrix.coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - with: - disable_search: true - files: __out/cobertura.xml - name: Github Actions (Windows) - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true From a43ed36567a56f26d69abbe9a18724a7326b418c Mon Sep 17 00:00:00 2001 From: Sayan Date: Sat, 26 Sep 2026 14:59:42 -0400 Subject: [PATCH 14/15] CI: run ubuntu-22.04 jobs in containers The ubuntu-22.04 runner image is deprecated. Run the gcc-9..12 jobs in ubuntu:22.04 containers on ubuntu-latest, and move the Coverity job to ubuntu-24.04 with clang-18 (clang-12 is not packaged there). --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdf69f5..33f7bc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,10 +69,10 @@ jobs: - { compiler: gcc-6, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:18.04" } - { compiler: gcc-7, cxxstd: "11,14,17", os: ubuntu-latest, container: "ubuntu:20.04" } - { compiler: gcc-8, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: "ubuntu:20.04" } - - { compiler: gcc-9, cxxstd: "11,14,17,2a", os: ubuntu-22.04 } - - { compiler: gcc-10, cxxstd: "11,14,17,20", os: ubuntu-22.04 } - - { compiler: gcc-11, cxxstd: "11,14,17,20", os: ubuntu-22.04 } - - { compiler: gcc-12, cxxstd: "11,14,17,20", os: ubuntu-22.04 } + - { compiler: gcc-9, cxxstd: "11,14,17,2a", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: gcc-10, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: gcc-11, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } + - { compiler: gcc-12, cxxstd: "11,14,17,20", os: ubuntu-latest, container: "ubuntu:22.04" } - { compiler: gcc-13, cxxstd: "11,14,17,20,2b", os: ubuntu-24.04 } - { name: "Coverage w/ GCC on Linux", coverage: "yes", compiler: gcc-13, cxxstd: "2b", os: ubuntu-24.04, install: "g++-13-multilib gcc-multilib", address-model: "32,64" } @@ -335,7 +335,7 @@ jobs: coverity: name: Coverity Scan w/ Clang on Linux if: github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'master') - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 120 defaults: @@ -354,7 +354,7 @@ jobs: if: env.COVERITY_SCAN_TOKEN run: | sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update - sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install clang-12 + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT -y -q --no-install-suggests --no-install-recommends install clang-18 - name: Setup Boost if: env.COVERITY_SCAN_TOKEN @@ -371,7 +371,7 @@ jobs: cp -r "$GITHUB_WORKSPACE"/* "libs/$SELF/" $(command -v python || command -v python3) tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools --git_args "--jobs $GIT_FETCH_JOBS" "$SELF" echo "BOOST_ROOT=$PWD" >> "$GITHUB_ENV" - echo "using clang : : clang++-12 ;" > ~/user-config.jam + echo "using clang : : clang++-18 ;" > ~/user-config.jam ./bootstrap.sh ./b2 -d0 headers @@ -387,7 +387,7 @@ jobs: popd RESULTS_DIR="$(pwd)/cov-int" mkdir "${RESULTS_DIR}" - cov-configure --template --compiler clang++-12 --comptype clangcxx + cov-configure --template --compiler clang++-18 --comptype clangcxx (cd "$BOOST_ROOT" && cov-build --dir "${RESULTS_DIR}" ./b2 libs/$SELF/test toolset=clang cxxstd=20 link=$B2_LINK variant=$B2_VARIANT -j3) tail -50 "${RESULTS_DIR}/build-log.txt" tar czf cov-int.tgz cov-int From 9b0af9521a09d51e377d94ca5aafb0f23ab8835a Mon Sep 17 00:00:00 2001 From: Sayan Date: Sat, 26 Sep 2026 15:19:19 -0400 Subject: [PATCH 15/15] test/add.cpp: make pexpr own its node instead of using a pool --- test/add.cpp | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/test/add.cpp b/test/add.cpp index 8554a86..581b44b 100644 --- a/test/add.cpp +++ b/test/add.cpp @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include "bugs.hpp" @@ -27,6 +26,9 @@ struct pexpr { expr *ptr; expr* operator->() const { return ptr; } pexpr(expr *p = NULL): ptr(p) { } + pexpr(const pexpr& o); + pexpr& operator=(pexpr o) { std::swap(ptr, o.ptr); return *this; } + ~pexpr(); }; struct expr { @@ -36,26 +38,13 @@ struct expr { pexpr e1, e2; }; -// Every expr node is owned by this pool and released at program exit, -// so sanitizer builds do not report the symbolic trees as leaks. -struct expr_pool { - std::vector nodes; - ~expr_pool() { - for (std::size_t i = 0; i < nodes.size(); ++i) delete nodes[i]; - } -}; - -static expr_pool pool; - -static pexpr new_expr(e_type t) { - expr *p = new expr; - p->type = t; - pool.nodes.push_back(p); - return p; -} +// Each pexpr owns its node, and copying one clones the subtree. +pexpr::pexpr(const pexpr& o): ptr(o.ptr ? new expr(*o.ptr) : NULL) { } +pexpr::~pexpr() { delete ptr; } pexpr var(int v) { - pexpr e = new_expr(EXPR_VAR); + pexpr e = new expr(); + e->type = EXPR_VAR; e->var = v; return e; } @@ -68,7 +57,8 @@ pexpr operator+(pexpr a, pexpr b) { if (a->type == EXPR_NEG) return b - a->e; if (b->type == EXPR_NEG) return a - b->e; if (a->type == EXPR_VAR && b->type == EXPR_VAR && a->var > b->var) return b + a; - pexpr c = new_expr(EXPR_ADD); + pexpr c = new expr(); + c->type = EXPR_ADD; c->e1 = a; c->e2 = b; return c; @@ -76,20 +66,23 @@ pexpr operator+(pexpr a, pexpr b) { pexpr operator-(pexpr a, pexpr b) { if (b->type == EXPR_NEG) return a + b->e; - pexpr c = new_expr(EXPR_SUB); + pexpr c = new expr(); + c->type = EXPR_SUB; c->e1 = a; c->e2 = b; return c; } pexpr down(pexpr a) { - pexpr e = new_expr(EXPR_DOWN); + pexpr e = new expr(); + e->type = EXPR_DOWN; e->e = a; return e; } pexpr up(pexpr a) { - pexpr e = new_expr(EXPR_UP); + pexpr e = new expr(); + e->type = EXPR_UP; e->e = a; return e; } @@ -100,7 +93,8 @@ pexpr operator-(pexpr a) { if (a->type == EXPR_DOWN) return up(-a->e); if (a->type == EXPR_SUB) return a->e2 - a->e1; if (a->type == EXPR_ADD) return -a->e1 - a->e2; - pexpr e = new_expr(EXPR_NEG); + pexpr e = new expr(); + e->type = EXPR_NEG; e->e = a; return e; }