diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..02638d606 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,639 @@ +# Copyright 2021-2026 Andrey Semashev +# +# 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) + +name: CI + +on: + pull_request: + push: + branches: + - master + - develop + - feature/** + +concurrency: + group: ${{format('{0}:{1}', github.repository, github.ref)}} + cancel-in-progress: true + +env: + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + DEFAULT_BUILD_VARIANT: debug,release + +jobs: + posix: + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + # Linux, gcc + - toolset: gcc-5 + cxxstd: "11,14,1z" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - g++-5 + - toolset: gcc-6 + cxxstd: "11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-6 + - toolset: gcc-7 + cxxstd: "11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-7 + - toolset: gcc-8 + cxxstd: "11,14,17,2a" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-8 + - toolset: gcc-9 + cxxstd: "11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-9 + - toolset: gcc-10 + cxxstd: "11,14,17,20" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-10 + - toolset: gcc-11 + cxxstd: "11,14,17,20,23" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-11 + - toolset: gcc-12 + cxxstd: "11,14,17,20,23" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12 + - toolset: gcc-13 + cxxstd: "11,14,17,20,23" + os: ubuntu-24.04 + install: + - g++-13 + - toolset: gcc-14 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-24.04 + install: + - g++-14 + - toolset: gcc-15 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - g++-15 + - toolset: gcc-16 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - g++-16 + - name: UBSAN + toolset: gcc-15 + cxxstd: "11,14,17,20,23,26" + ubsan: 1 + build_variant: debug + os: ubuntu-26.04 + install: + - g++-15 + + # Linux, clang + - toolset: clang + compiler: clang++-3.5 + cxxstd: "11" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.5 + - toolset: clang + compiler: clang++-3.6 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.6 + - toolset: clang + compiler: clang++-3.7 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.7 + - toolset: clang + compiler: clang++-3.8 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.8 + - toolset: clang + compiler: clang++-3.9 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-3.9 + - toolset: clang + compiler: clang++-4.0 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-4.0 + - toolset: clang + compiler: clang++-5.0 + cxxstd: "11,14,1z" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-5.0 + - toolset: clang + compiler: clang++-6.0 + cxxstd: "11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-6.0 + - toolset: clang + compiler: clang++-7 + cxxstd: "11,14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-7 + # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode + - toolset: clang + compiler: clang++-8 + cxxstd: "11,14,17,2a" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-8 + - g++-7 + gcc_toolchain: 7 + - toolset: clang + compiler: clang++-9 + cxxstd: "11,14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - clang-9 + - toolset: clang + compiler: clang++-10 + cxxstd: "11,14,17,20" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - clang-10 + - toolset: clang + compiler: clang++-11 + cxxstd: "11,14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-11 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-12 + cxxstd: "11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-12 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-13 + cxxstd: "11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-13 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-14 + cxxstd: "11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-14 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-15 + cxxstd: "11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-15 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-16 + cxxstd: "11,14,17,20,2b" + os: ubuntu-24.04 + install: + - clang-16 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-17 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-24.04 + install: + - clang-17 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-18 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-24.04 + install: + - clang-18 + - g++-13 + - toolset: clang + compiler: clang++-19 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-24.04 + install: + - clang-19 + - toolset: clang + compiler: clang++-20 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - clang-20 + - toolset: clang + compiler: clang++-21 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - clang-21 + - toolset: clang + compiler: clang++-22 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - clang-22 + - toolset: clang + compiler: clang++-22 + cxxstd: "11,14,17,20,23,26" + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + - name: UBSAN + toolset: clang + compiler: clang++-22 + cxxstd: "11,14,17,20,23,26" + cxxflags: -stdlib=libc++ + linkflags: "-stdlib=libc++ -lubsan" + ubsan: 1 + build_variant: debug + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + + - toolset: clang + os: macos-14 + cxxstd: "11,14,17,20,2b" + - toolset: clang + os: macos-15 + cxxstd: "11,14,17,20,23,26" + - toolset: clang + os: macos-26 + cxxstd: "11,14,17,20,23,26" + + - name: CMake tests + cmake_tests: 1 + os: ubuntu-24.04 + + timeout-minutes: 20 + runs-on: ${{matrix.os}} + container: ${{matrix.container}} + + 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}}" ] + then + echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV + if [ -f "/etc/debian_version" ] + then + # Use Azure APT mirrors in containers to avoid HTTP errors due to DDoS filters triggered by lots of CI jobs launching concurrently. + # Note that not all Ubuntu versions support "mirror+file:..." URIs in APT sources, so just use Azure mirrors exclusively. + # Note also that on recent Ubuntu versions DEB822 format is used for source files. + APT_SOURCES=() + if [ -d "/etc/apt/sources.list.d" ] + then + readarray -t APT_SOURCES < <(find "/etc/apt/sources.list.d" -type f -name '*.sources' -print) + fi + if [ -f "/etc/apt/sources.list" ] + then + APT_SOURCES+=("/etc/apt/sources.list") + fi + if [ "${#APT_SOURCES[@]}" -gt 0 ] + then + sed -i -E -e 's!([^ ]+) (http|https)://(archive|security)\.ubuntu\.com/ubuntu[^ ]*(.*)!\1 http://azure.archive.ubuntu.com/ubuntu/\4!' "${APT_SOURCES[@]}" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] + then + PYTHON_PACKAGE="python-is-python3" + else + PYTHON_PACKAGE="python" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake + fi + fi + git config --global pack.threads 0 + + - name: Install packages + if: matrix.install + run: | + declare -a SOURCE_KEYS SOURCES + if [ -n "${{join(matrix.source_keys, ' ')}}" ] + then + SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") + fi + if [ -n "${{join(matrix.sources, ' ')}}" ] + then + SOURCES=("${{join(matrix.sources, '" "')}}") + fi + for key in "${SOURCE_KEYS[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + echo "Adding key: $key" + wget -O - "$key" | sudo apt-key add - && break || sleep 2 + done + done + if [ ${#SOURCES[@]} -gt 0 ] + then + APT_ADD_REPO_COMMON_ARGS=("-y") + APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" + if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] + then + APT_ADD_REPO_COMMON_ARGS+=("-n") + fi + APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" + for source in "${SOURCES[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") + if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] + then + case "$source" in + "ppa:"*) + APT_ADD_REPO_ARGS+=("-P") + ;; + "deb "*) + APT_ADD_REPO_ARGS+=("-S") + ;; + *) + APT_ADD_REPO_ARGS+=("-U") + ;; + esac + fi + APT_ADD_REPO_ARGS+=("$source") + echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" + sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 + done + done + fi + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} + + - name: Setup GCC Toolchain + if: matrix.gcc_toolchain + run: | + GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" + echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV + MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + mkdir -p "$GCC_TOOLCHAIN_ROOT" + ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" + ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" + mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" + ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + echo BUILD_JOBS: $BUILD_JOBS + DEPINST_ARGS=() + GIT_VERSION="$(git --version | sed -e 's/git version //')" + GIT_HAS_JOBS=1 + if [ -f "/etc/debian_version" ] + then + if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) + then + GIT_HAS_JOBS=0 + fi + else + declare -a GIT_VER=(${GIT_VERSION//./ }) + declare -a GIT_MIN_VER=(2 8 0) + for ((i=0; i<${#GIT_VER[@]}; i++)) + do + if [ -z "${GIT_MIN_VER[i]}" ] + then + GIT_MIN_VER[i]=0 + fi + if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] + then + GIT_HAS_JOBS=0 + break + fi + done + fi + if [ "$GIT_HAS_JOBS" -ne 0 ] + then + DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") + fi + mkdir -p snapshot + cd snapshot + echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz" + if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ] + then + echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:" + ls -la + exit 1 + fi + rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz" + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs + rm -rf "libs/$LIBRARY" + mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY" + rm -rf "../snapshot" + git submodule update --init tools/boostdep + DEPINST_ARGS+=("$LIBRARY") + python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + + - name: Run tests + if: matrix.cmake_tests == '' + run: | + cd boost-root + ./bootstrap.sh + ./b2 headers + if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam + if [ -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam + fi + echo " ;" >> ~/user-config.jam + fi + B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}" + + - name: Run CMake tests + if: matrix.cmake_tests + run: | + if [ -n "${{matrix.macosx_version_min}}" ] + then + export MACOSX_DEPLOYMENT_TARGET="${{matrix.macosx_version_min}}" + fi + cd boost-root + mkdir __build_static__ && cd __build_static__ + cmake ../libs/$LIBRARY/test/test_cmake + cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS + cd .. + mkdir __build_shared__ && cd __build_shared__ + cmake -DBUILD_SHARED_LIBS=On ../libs/$LIBRARY/test/test_cmake + cmake --build . --target boost_${LIBRARY}_cmake_self_test -j $BUILD_JOBS + + windows: + defaults: + run: + shell: cmd + + strategy: + fail-fast: false + matrix: + include: + - toolset: msvc-14.3 + cxxstd: "14,17,20,latest" + addrmd: 32,64 + os: windows-2022 + - toolset: clang-win + cxxstd: "14,17,latest" + addrmd: 32,64 + os: windows-2022 + - toolset: gcc + cxxstd: "11,14,17,20,23" + addrmd: 64 + os: windows-2022 + + timeout-minutes: 20 + runs-on: ${{matrix.os}} + + steps: + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + mkdir snapshot + cd snapshot + echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip + curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip" + tar -xf "%LIBRARY%-%GITHUB_SHA%.zip" + if not exist "%LIBRARY%-%GITHUB_SHA%\" ( + echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%: + dir + exit /b 1 + ) + del /f "%LIBRARY%-%GITHUB_SHA%.zip" + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + if not exist "libs\" mkdir libs + if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%" + move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%" + rmdir /s /q "..\snapshot" + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY% + + - name: Run tests + run: | + cd boost-root + cmd /c bootstrap + b2 -d0 headers + if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}} + if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}} + if not "${{matrix.build_variant}}" == "" (set BUILD_VARIANT=variant=${{matrix.build_variant}}) else (set BUILD_VARIANT=variant=%DEFAULT_BUILD_VARIANT%) + b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} %CXXSTD% %ADDRMD% %BUILD_VARIANT% embed-manifest-via=linker diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c0e97f131..000000000 --- a/.travis.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2016, 2017 Peter Dimov -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) - -language: cpp - -sudo: false - -python: "2.7" - -branches: - only: - - master - - develop - - /feature\/.*/ - -env: - matrix: - - BOGUS_JOB=true - -matrix: - - exclude: - - env: BOGUS_JOB=true - - include: - - os: linux - compiler: g++ - env: TOOLSET=gcc CXXSTD=03,11 - - - os: linux - compiler: g++-5 - env: TOOLSET=gcc-5 CXXSTD=03,11,14,1z - addons: - apt: - packages: - - g++-5 - sources: - - ubuntu-toolchain-r-test - - - os: linux - compiler: g++-6 - env: TOOLSET=gcc-6 CXXSTD=03,11,14,1z - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test - - - os: linux - compiler: g++-7 - env: TOOLSET=gcc-7 CXXSTD=03,11,14,17 - addons: - apt: - packages: - - g++-7 - sources: - - ubuntu-toolchain-r-test - - - os: linux - compiler: clang++ - env: TOOLSET=clang CXXSTD=03,11,14,1z - - - os: osx - compiler: clang++ - env: TOOLSET=clang CXXSTD=03,11,14,1z - -install: - - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "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 --init tools/build - - git submodule update --init libs/config - - git submodule update --init tools/boostdep - - cp -r $TRAVIS_BUILD_DIR/* libs/iterator - - python tools/boostdep/depinst/depinst.py iterator - - ./bootstrap.sh - - ./b2 headers - -script: - - ./b2 -j3 libs/iterator/test toolset=$TOOLSET cxxstd=$CXXSTD - -notifications: - email: - on_success: always diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..d11edf8b6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 2018 Peter Dimov +# Copyright 2018 Andrey Semashev +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt + +cmake_minimum_required(VERSION 3.5...3.20) + +project(boost_iterator VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) + +add_library(boost_iterator INTERFACE) +add_library(Boost::iterator ALIAS boost_iterator) + +target_include_directories(boost_iterator INTERFACE include) + +target_link_libraries(boost_iterator + INTERFACE + Boost::assert + Boost::concept_check + Boost::config + Boost::core + Boost::detail + Boost::fusion + Boost::mpl + Boost::optional + Boost::type_traits + Boost::utility +) diff --git a/README.md b/README.md new file mode 100644 index 000000000..c5bf79ac5 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Boost.Iterator + +Boost.Iterator, part of collection of the [Boost C++ Libraries](https://github.com/boostorg), provides tools for building and working with iterators in C++. The library also provides a number of iterator classes that can be used out of the box. + +### Directories + +* **doc** - Documentation sources +* **include** - Interface headers of Boost.Iterator +* **test** - Boost.Iterator unit tests +* **example** - Boost.Iterator usage examples + +### More information + +* [Documentation](https://boost.org/libs/iterator) +* [Report bugs](https://github.com/boostorg/iterator/issues/new). Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well. +* Submit your patches as [pull requests](https://github.com/boostorg/iterator/compare) against **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt). + +### Build status + +Branch | GitHub Actions | AppVeyor | Test Matrix | Dependencies | +:-------------: | -------------- | -------- | ----------- | ------------ | +[`master`](https://github.com/boostorg/iterator/tree/master) | [![GitHub Actions](https://github.com/boostorg/iterator/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/iterator/actions?query=branch%3Amaster) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/ud8ug5aai8vd30hg/branch/master?svg=true)](https://ci.appveyor.com/project/Lastique/iterator/branch/master) | [![Tests](https://img.shields.io/badge/matrix-master-brightgreen.svg)](https://regression.boost.io/master/developer/iterator.html) | [![Dependencies](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/iterator.html) +[`develop`](https://github.com/boostorg/iterator/tree/develop) | [![GitHub Actions](https://github.com/boostorg/iterator/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/iterator/actions?query=branch%3Adevelop) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/ud8ug5aai8vd30hg/branch/develop?svg=true)](https://ci.appveyor.com/project/Lastique/iterator/branch/develop) | [![Tests](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://regression.boost.io/develop/developer/iterator.html) | [![Dependencies](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/iterator.html) + +### License + +Distributed under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt). diff --git a/appveyor.yml b/appveyor.yml index b236d12de..116eb3821 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ # Copyright 2017 Edward Diener +# Copyright 2019 Andrey Semashev # 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) @@ -14,30 +15,88 @@ branches: environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-14.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLSET: msvc-14.1 - CXXSTD: 14,17 + - TOOLSET: msvc-14.0 + CXXSTD: 14,latest + ADDRMD: 32,64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: msvc-14.1 + CXXSTD: 14,17,latest + ADDRMD: 32,64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: msvc-14.2 + ADDRMD: 32,64 + CXXSTD: 14,17,20,latest + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - TOOLSET: msvc-14.3 + ADDRMD: 32,64 + CXXSTD: 14,17,20,latest + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + - TOOLSET: clang-win + ADDRMD: 32 + CXXSTD: 14,17,latest + ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - TOOLSET: clang-win + ADDRMD: 64 + CXXSTD: 14,17,latest + ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - TOOLSET: gcc + CXXSTD: 11,14,1z + ADDPATH: C:\cygwin\bin; + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: gcc + CXXSTD: 11,14,1z + ADDPATH: C:\cygwin64\bin; + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: gcc + CXXSTD: 11,14,1z + ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: gcc + CXXSTD: 11,14,1z + ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin; + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TEST_CMAKE: 1 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 install: + - set GIT_FETCH_JOBS=8 - set BOOST_BRANCH=develop - if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master - cd .. - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - - git submodule update --init tools/build - - git submodule update --init libs/config - - git submodule update --init tools/boostdep + - git submodule init tools/build + - git submodule init tools/boostdep + - git submodule init tools/boost_install + - git submodule init libs/headers + - git submodule init libs/config + - git submodule update --jobs %GIT_FETCH_JOBS% - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\iterator - - python tools/boostdep/depinst/depinst.py iterator + - python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" iterator - cmd /c bootstrap - b2 -d0 headers build: off test_script: + - PATH=%ADDPATH%%PATH% + - if not "%ENV_SCRIPT%" == "" call "%ENV_SCRIPT%" - if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% - - b2 -j3 libs/iterator/test toolset=%TOOLSET% %CXXSTD% + - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% + - b2 -j %NUMBER_OF_PROCESSORS% libs/iterator/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% + +for: + - matrix: + only: [TEST_CMAKE: 1] + test_script: + - mkdir __build_static__ + - cd __build_static__ + - cmake ../libs/iterator/test/test_cmake + - cmake --build . --target boost_iterator_cmake_self_test -j %NUMBER_OF_PROCESSORS% + - cd .. + - mkdir __build_shared__ + - cd __build_shared__ + - cmake -DBUILD_SHARED_LIBS=On ../libs/iterator/test/test_cmake + - cmake --build . --target boost_iterator_cmake_self_test -j %NUMBER_OF_PROCESSORS% diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..5cdfb936d --- /dev/null +++ b/build.jam @@ -0,0 +1,32 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# 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) + +require-b2 5.2 ; + +constant boost_dependencies : + /boost/assert//boost_assert + /boost/concept_check//boost_concept_check + /boost/config//boost_config + /boost/core//boost_core + /boost/detail//boost_detail + /boost/fusion//boost_fusion + /boost/mpl//boost_mpl + /boost/optional//boost_optional + /boost/type_traits//boost_type_traits + /boost/utility//boost_utility ; + +project /boost/iterator + : common-requirements + include + ; + +explicit + [ alias boost_iterator : : : : $(boost_dependencies) ] + [ alias all : boost_iterator test ] + ; + +call-if : boost-library iterator + ; + diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 27ad9cd2b..c75d268f7 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -4,20 +4,20 @@ using quickbook ; -xml iterator - : - quickbook/iterator.qbk +xml iterator + : + quickbook/iterator.qbk ; boostbook standalone : iterator : - boost.root=../../../.. + "boost.root=../../../.." toc.max.depth=3 toc.section.depth=3 chunk.section.depth=2 - pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/libs/iterator/doc + pdf:"boost.url.prefix=http://www.boost.org/doc/libs/release/libs/iterator/doc/html" ; ############################################################################### diff --git a/doc/counting_iterator.rst b/doc/counting_iterator.rst index ff7da3cab..f0377de8b 100644 --- a/doc/counting_iterator.rst +++ b/doc/counting_iterator.rst @@ -11,7 +11,6 @@ :organization: `Boost Consulting`_, Indiana University `Open Systems Lab`_, University of Hanover `Institute for Transport Railway Operation and Construction`_ -:date: $Date$ :copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. .. _`Boost Consulting`: http://www.boost-consulting.com diff --git a/doc/default.css b/doc/default.css index 8c1e34258..a2c4195e7 100644 --- a/doc/default.css +++ b/doc/default.css @@ -1,8 +1,6 @@ /* :Author: David Goodger :Contact: goodger@users.sourceforge.net -:date: $Date$ -:version: $Revision$ :copyright: This stylesheet has been placed in the public domain. boostinspect:nolicense diff --git a/doc/docutils.sty b/doc/docutils.sty index a6fce3f0a..40e928d8e 100644 --- a/doc/docutils.sty +++ b/doc/docutils.sty @@ -4,7 +4,6 @@ %% %% o author: Alexander Schmolck (a.schmolck@gmx.net) %% o created: 2002-07-07 10:50:31+00:40 -%% o last modified: $Date: 2004/01/29 05:55:26 $ %% o keywords: %% o license: %XXX titlesec diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index 79d38a30a..db51147c7 100644 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -2622,7 +2622,7 @@

Class template

Header

-#include <boost/function_output_iterator.hpp>
+#include <boost/iterator/function_output_iterator.hpp>
 
 template <class UnaryFunction>
diff --git a/doc/facade-and-adaptor.rst b/doc/facade-and-adaptor.rst
index 6308de4c4..cdf6783b1 100644
--- a/doc/facade-and-adaptor.rst
+++ b/doc/facade-and-adaptor.rst
@@ -10,7 +10,6 @@
 :Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@styleadvisor.com
 :organization: `Boost Consulting`_, Indiana University `Open Systems
                Lab`_, `Zephyr Associates, Inc.`_
-:date: $Date$
 
 :Number: This is a revised version of N1530_\ =03-0113, which was
          accepted for Technical Report 1 by the C++ standard
diff --git a/doc/filter_iterator.rst b/doc/filter_iterator.rst
index cfa8642c8..d4e7a0448 100644
--- a/doc/filter_iterator.rst
+++ b/doc/filter_iterator.rst
@@ -11,7 +11,6 @@
 :organization: `Boost Consulting`_, Indiana University `Open Systems
                Lab`_, University of Hanover `Institute for Transport
                Railway Operation and Construction`_
-:date: $Date$
 :copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. 
 
 .. _`Boost Consulting`: http://www.boost-consulting.com
diff --git a/doc/func_output_iter_ref.rst b/doc/func_output_iter_ref.rst
index e00eab751..92854ff9c 100644
--- a/doc/func_output_iter_ref.rst
+++ b/doc/func_output_iter_ref.rst
@@ -7,7 +7,7 @@ Header
 
 ::
   
-  #include 
+  #include 
 
 ::
 
diff --git a/doc/function_output_iterator.html b/doc/function_output_iterator.html
index 1bae71b86..7eaa81cf0 100644
--- a/doc/function_output_iterator.html
+++ b/doc/function_output_iterator.html
@@ -68,7 +68,7 @@ 

Function Output Iterator