From 2712ae6aace627b7f6d5756f6072d82bc1e45b6f Mon Sep 17 00:00:00 2001 From: shenzhe Date: Thu, 8 Jan 2026 20:28:44 +0800 Subject: [PATCH 01/10] Fix CMake CMP0167 Warning When I was building the source code of msgpack-c, I encountered a CMP0167 warning. Although it did not affect the code building process, it was a minor flaw. I believed that adding CONFIG to `find_package(Boost REQUIRED)` could solve the issue. Therefore, I organized the code repository and fixed this minor issue. --- CMakeLists.txt | 2 +- example/boost/CMakeLists.txt | 2 +- example/cpp03/CMakeLists.txt | 2 +- example/x3/CMakeLists.txt | 2 +- fuzz/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9a733c1b..5b341954f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ IF (MSGPACK_USE_BOOST) SET (Boost_USE_STATIC_LIBS FALSE) ENDIF () - FIND_PACKAGE (Boost REQUIRED) + FIND_PACKAGE (Boost REQUIRED CONFIG) ELSE () TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_NO_BOOST) ENDIF () diff --git a/example/boost/CMakeLists.txt b/example/boost/CMakeLists.txt index 6464513b3..6870eca06 100644 --- a/example/boost/CMakeLists.txt +++ b/example/boost/CMakeLists.txt @@ -1,4 +1,4 @@ -FIND_PACKAGE (Boost REQUIRED) +FIND_PACKAGE (Boost REQUIRED CONFIG) FIND_PACKAGE (Threads REQUIRED) FIND_PACKAGE (ZLIB REQUIRED) diff --git a/example/cpp03/CMakeLists.txt b/example/cpp03/CMakeLists.txt index 90c493f04..6159c9b2e 100644 --- a/example/cpp03/CMakeLists.txt +++ b/example/cpp03/CMakeLists.txt @@ -1,6 +1,6 @@ FIND_PACKAGE (Threads REQUIRED) -FIND_PACKAGE (Boost COMPONENTS timer) +FIND_PACKAGE (Boost COMPONENTS timer CONFIG) LIST (APPEND exec_PROGRAMS class_intrusive.cpp diff --git a/example/x3/CMakeLists.txt b/example/x3/CMakeLists.txt index 963d6da4f..9d31a6f58 100644 --- a/example/x3/CMakeLists.txt +++ b/example/x3/CMakeLists.txt @@ -1,5 +1,5 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1) - FIND_PACKAGE (Boost REQUIRED COMPONENTS context) + FIND_PACKAGE (Boost REQUIRED COMPONENTS context CONFIG) FIND_PACKAGE (Threads REQUIRED) LIST (APPEND exec_PROGRAMS diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index 977968741..99193f94c 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -1,5 +1,5 @@ FIND_PACKAGE (Threads REQUIRED) -FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem unit_test_framework) +FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem unit_test_framework CONFIG) LIST (APPEND check_PROGRAMS regression_runner.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b29c07a2c..65e43de20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ FIND_PACKAGE (Threads REQUIRED) FIND_PACKAGE (ZLIB) -FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework) +FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework CONFIG) LIST (APPEND check_PROGRAMS array_ref.cpp From b1d494436be47e6601ddcbf3965b617823dc2543 Mon Sep 17 00:00:00 2001 From: shenzhe Date: Fri, 9 Jan 2026 16:32:10 +0800 Subject: [PATCH 02/10] fix ci error --- appveyor.yml | 10 +++++----- test-install/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3385097ad..f6804070f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,14 +2,14 @@ version: 7.0.0.{build} branches: only: - - cpp_master + - cpp_master environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 cpp11: -DMSGPACK_CXX11=ON msvc: '"Visual Studio 14 2015"' - boost_prefix: C:\Libraries\boost_1_69_0 + boost_prefix: C:\Libraries\boost_1_86_0 boost_subdir: lib32-msvc-14.0 build_script: - ps: | @@ -42,7 +42,7 @@ build_script: -D MSGPACK_BUILD_EXAMPLES=ON ` -D MSGPACK_BUILD_TESTS=ON ` -D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" ` - -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` + -D CMAKE_PREFIX_PATH="C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake\Boost-1.86.0;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` .. @@ -52,5 +52,5 @@ build_script: if ($LastExitCode -ne 0) { exit $LastExitCode } test_script: -- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir% -- ctest -VV -C Release + - set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir% + - ctest -VV -C Release diff --git a/test-install/CMakeLists.txt b/test-install/CMakeLists.txt index 874198b61..16ff9d38f 100644 --- a/test-install/CMakeLists.txt +++ b/test-install/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) +cmake_minimum_required(VERSION 3.5...4.0) project(test-install LANGUAGES CXX) From 12a2e07f3b27b2d28b4ab16a84e1acbac8d094e7 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 13:45:19 +0900 Subject: [PATCH 03/10] Temporary disabled. --- .github/workflows/coverage.yml | 77 ----------- .github/workflows/gha.yml | 244 --------------------------------- 2 files changed, 321 deletions(-) delete mode 100644 .github/workflows/coverage.yml delete mode 100644 .github/workflows/gha.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 30e5cea73..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: coverage - -on: - pull_request: - types: [opened, synchronize] - push: - branches: - - cpp_master - tags: - - '*' - -jobs: - codecov: - timeout-minutes: 30 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Install build dependencies - run: | - sudo apt-get update - sudo apt-get install g++-10 cmake lcov -y - ./ci/set_gcc_10.sh - - - name: Cache boost - id: cache-boost - uses: actions/cache@v3 - with: - path: ~/boost-prefix/ - key: ${{ runner.os }}-boost-1-85-0-2024-05-27 - - - name: Build boost - if: steps.cache-boost.outputs.cache-hit != 'true' - run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix - - - name: Cache zlib - id: cache-zlib - uses: actions/cache@v3 - with: - path: ~/zlib-prefix/ - key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09 - - - name: Build zlib - if: steps.cache-zlib.outputs.cache-hit != 'true' - run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix - - - name: Compile tests - run: | - mkdir build - cmake \ - -D MSGPACK_CXX20=ON \ - -D MSGPACK_32BIT=OFF \ - -D MSGPACK_CHAR_SIGN=signed \ - -D MSGPACK_USE_X3_PARSE=ON \ - -D MSGPACK_BUILD_EXAMPLES=ON \ - -D MSGPACK_BUILD_TESTS=ON \ - -D CMAKE_BUILD_TYPE=Debug \ - -D MSGPACK_GEN_COVERAGE=ON \ - -D MSGPACK_USE_STD_VARIANT_ADAPTOR=ON \ - -D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \ - -B build \ - -S . || exit 1 - cmake --build build --target all || exit 1 - ctest --test-dir build || exit 1 - - - name: Generate coverage - working-directory: build - run: | - # Create lcov report - lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch - lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files - lcov --list coverage.info # debug info - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 - with: - files: build/coverage.info - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml deleted file mode 100644 index 6015e17f1..000000000 --- a/.github/workflows/gha.yml +++ /dev/null @@ -1,244 +0,0 @@ -name: CI - -on: - pull_request: - types: [opened, synchronize] - push: - branches: - - cpp_master - tags: - - '*' - -jobs: - macos: - name: ${{ format('macOS (pattern {0})', matrix.pattern) }} - runs-on: macos-latest - strategy: - fail-fast: false - matrix: - pattern: [0, 1, 2, 3, 4] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Dependencies - run: | - brew update - brew install --force llvm - - - name: Cache boost - id: cache-boost - uses: actions/cache@v3 - with: - path: ~/boost-prefix/ - key: ${{ runner.os }}-boost-1-85-0-2024-05-27 - - - name: Build boost - if: steps.cache-boost.outputs.cache-hit != 'true' - run: ./.github/depends/boost.sh -b 64 -t clang -p $HOME/boost-prefix - - - name: Cache zlib - id: cache-zlib - uses: actions/cache@v3 - with: - path: ~/zlib-prefix/ - key: ${{ runner.os }}-zlib-1-2-13-2022-11-02 - - - name: Build zlib - if: steps.cache-zlib.outputs.cache-hit != 'true' - run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix - - - name: Build and test - shell: bash - run: | - # default configuration - overwrite its params later depending on matrix.pattern - export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" - export ARCH=64 - export API_VERSION=3 - export CHAR_SIGN="signed" - export X3_PARSE="OFF" - export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all" - - case ${{ matrix.pattern }} in - 0) - export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" - ;; - 1) - export API_VERSION=1 - ;; - 2) - export API_VERSION=2 - ;; - 3) - export X3_PARSE="ON" - ;; - 4) - export CHAR_SIGN="unsigned" - ;; - esac - - # build and test - export CXX="clang++" - CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1 - - cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 - - linux: - name: ${{ format('Linux (pattern {0})', matrix.pattern) }} - runs-on: ubuntu-24.04 - strategy: - fail-fast: false - matrix: - pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] - steps: - - uses: actions/checkout@v3 - - - name: Install build dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install g++-10 cmake valgrind -y - sudo apt-get install g++-10-multilib -y # for 32-bit compile - ./ci/set_gcc_10.sh - - - name: Cache boost - id: cache-boost - uses: actions/cache@v3 - with: - path: ~/boost-prefix/ - key: ${{ runner.os }}-boost-1-85-0-2024-05-27 - - - name: Build boost - if: steps.cache-boost.outputs.cache-hit != 'true' - run: ./.github/depends/boost.sh -b both -t gcc -p $HOME/boost-prefix - - - name: Cache zlib - id: cache-zlib - uses: actions/cache@v3 - with: - path: ~/zlib-prefix/ - key: ${{ runner.os }}-zlib-1-2-13-2022-11-02 - - - name: Build zlib - if: steps.cache-zlib.outputs.cache-hit != 'true' - run: ./.github/depends/zlib.sh -b both -p $HOME/zlib-prefix - - - name: Build and test - shell: bash - run: | - # default configuration - overwrite its params later depending on matrix.pattern - export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" - export ARCH=64 - export API_VERSION=3 - export CHAR_SIGN="signed" - export X3_PARSE="OFF" - export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all" - export ACTION="ci/build_cmake.sh" - - case ${{ matrix.pattern }} in - 0) - export CXX="clang++" - export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" - ;; - 1) - export CXX="g++-10" - export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" - ;; - 2) - export CXX="clang++" - export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON" - ;; - 3) - export CXX="g++-10" - export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON" - export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON" - ;; - 4) - export CXX="clang++" - export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" - export NO_BOOST="-DMSGPACK_NO_BOOST" - ;; - 5) - export CXX="g++-10" - export ARCH=32 - ;; - 6) - export CXX="clang++" - export API_VERSION=2 - ;; - 7) - export CXX="g++-10" - export API_VERSION=1 - ;; - 8) - export CXX="clang++" - export CHAR_SIGN="unsigned" - ;; - 9) - export CXX="g++-10" - export X3_PARSE="ON" - ;; - 10) - export CXX="clang++" - export ACTION="ci/build_regression.sh" - ;; - 11) - export CXX="g++-10" - export ARCH=32 - export CHAR_SIGN="unsigned" - export X3_PARSE="ON" - ;; - esac - - # build and test - CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE} ${NO_BOOST}" ci/build_cmake.sh || exit 1 - cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 - - windows: - name: ${{ format('Windows cxx{0}', matrix.cxx) }} - runs-on: windows-2022 - strategy: - fail-fast: false - matrix: - # MSVC2022 only supports /std:c++14, /std:c++17 and /std:c++latest - cxx: [14, 17, 20] - pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"] - steps: - - uses: actions/checkout@v3 - - - name: Cache vcpkg dependencies - id: cache-vcpkg - uses: actions/cache@v3 - with: - path: C:/vcpkg/installed/x64-windows - key: ${{ runner.os }}-vcpkg-2021-08-09 - - - name: Install vcpkg dependencies - if: steps.cache-vcpkg.outputs.cache-hit != 'true' - shell: powershell - run: | - vcpkg update - vcpkg install zlib:x64-windows - vcpkg install boost-assert:x64-windows boost-numeric-conversion:x64-windows boost-variant:x64-windows boost-utility:x64-windows boost-fusion:x64-windows boost-optional:x64-windows boost-predef:x64-windows boost-preprocessor:x64-windows boost-timer:x64-windows boost-test:x64-windows - - - name: Build and test - shell: powershell - run: | - $CPPVER="MSGPACK_CXX${{ matrix.cxx }}=ON" - - md build - cmake ` - -A x64 ` - -G "Visual Studio 17 2022" ` - -D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` - -D MSGPACK_BUILD_TESTS=ON ` - -D $CPPVER ` - -D CMAKE_CXX_FLAGS="${{ matrix.pp_flag }} /D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" ` - -B build ` - -S . - if ($LastExitCode -ne 0) { exit $LastExitCode } - - cmake --build build --config Release - if ($LastExitCode -ne 0) { exit $LastExitCode } - - ctest -VV --test-dir build -C Release - if ($LastExitCode -ne 0) { exit $LastExitCode } From 4b8967d95d608480efd35b505c556e6bf5f2af72 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 13:46:36 +0900 Subject: [PATCH 04/10] Add debug code. --- appveyor.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index f6804070f..bad8180b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,6 +36,34 @@ build_script: md prefix cd build + # Debug: Check Boost directories + Write-Host "=== Checking C:\Libraries for Boost installations ===" + dir C:\Libraries\boost* | Format-Table Name + + Write-Host "=== Checking if boost_1_86_0 exists ===" + if (Test-Path "C:\Libraries\boost_1_86_0") { + Write-Host "boost_1_86_0 found!" + dir C:\Libraries\boost_1_86_0 | Format-Table Name + + Write-Host "=== Checking lib32-msvc-14.0 ===" + if (Test-Path "C:\Libraries\boost_1_86_0\lib32-msvc-14.0") { + dir C:\Libraries\boost_1_86_0\lib32-msvc-14.0 + + Write-Host "=== Checking cmake directory ===" + if (Test-Path "C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake") { + dir C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake + } else { + Write-Host "cmake directory not found in lib32-msvc-14.0" + } + } else { + Write-Host "lib32-msvc-14.0 not found" + } + } else { + Write-Host "boost_1_86_0 NOT found!" + } + + Write-Host "=== Starting CMake configuration ===" + cmake ` -G $env:msvc ` $env:cpp11 ` From af68027bd010245adf6acb18d1f6725d5273f9f4 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 13:54:50 +0900 Subject: [PATCH 05/10] Pass old style boost search option to cmake only on appveyor. --- appveyor.yml | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bad8180b1..6971a8c9d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 cpp11: -DMSGPACK_CXX11=ON msvc: '"Visual Studio 14 2015"' - boost_prefix: C:\Libraries\boost_1_86_0 + boost_prefix: C:\Libraries\boost_1_69_0 boost_subdir: lib32-msvc-14.0 build_script: - ps: | @@ -37,29 +37,21 @@ build_script: cd build # Debug: Check Boost directories - Write-Host "=== Checking C:\Libraries for Boost installations ===" - dir C:\Libraries\boost* | Format-Table Name + Write-Host "=== Checking Boost installation at $env:boost_prefix ===" + if (Test-Path "$env:boost_prefix") { + Write-Host "Boost directory found!" + Write-Host "Top-level contents:" + dir $env:boost_prefix | Format-Table Name -AutoSize - Write-Host "=== Checking if boost_1_86_0 exists ===" - if (Test-Path "C:\Libraries\boost_1_86_0") { - Write-Host "boost_1_86_0 found!" - dir C:\Libraries\boost_1_86_0 | Format-Table Name - - Write-Host "=== Checking lib32-msvc-14.0 ===" - if (Test-Path "C:\Libraries\boost_1_86_0\lib32-msvc-14.0") { - dir C:\Libraries\boost_1_86_0\lib32-msvc-14.0 - - Write-Host "=== Checking cmake directory ===" - if (Test-Path "C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake") { - dir C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake - } else { - Write-Host "cmake directory not found in lib32-msvc-14.0" - } + Write-Host "=== Checking $env:boost_subdir ===" + if (Test-Path "$env:boost_prefix\$env:boost_subdir") { + Write-Host "Library directory found!" + dir "$env:boost_prefix\$env:boost_subdir" | Select-Object -First 10 } else { - Write-Host "lib32-msvc-14.0 not found" + Write-Host "$env:boost_subdir not found" } } else { - Write-Host "boost_1_86_0 NOT found!" + Write-Host "ERROR: Boost directory NOT found at $env:boost_prefix" } Write-Host "=== Starting CMake configuration ===" @@ -69,8 +61,9 @@ build_script: $env:cpp11 ` -D MSGPACK_BUILD_EXAMPLES=ON ` -D MSGPACK_BUILD_TESTS=ON ` + -D Boost_NO_BOOST_CMAKE=ON ` -D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" ` - -D CMAKE_PREFIX_PATH="C:\Libraries\boost_1_86_0\lib32-msvc-14.0\cmake\Boost-1.86.0;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` + -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` .. From 596a2fb84244bf7296d62e5d89d1f6254fd07a61 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 13:59:33 +0900 Subject: [PATCH 06/10] Another try. --- CMakeLists.txt | 6 ++++-- appveyor.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b341954f..8f6d54ca5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,9 @@ ENDIF () IF (MSGPACK_USE_BOOST) IF ((CMAKE_VERSION VERSION_GREATER 3.30) OR (CMAKE_VERSION VERSION_EQUAL 3.30)) - CMAKE_POLICY(SET CMP0167 NEW) + IF (NOT MSGPACK_BOOST_USE_OLD_CMAKE) + CMAKE_POLICY(SET CMP0167 NEW) + ENDIF () ENDIF () SET (Boost_USE_MULTITHREADED ON) @@ -79,7 +81,7 @@ IF (MSGPACK_USE_BOOST) SET (Boost_USE_STATIC_LIBS FALSE) ENDIF () - FIND_PACKAGE (Boost REQUIRED CONFIG) + FIND_PACKAGE (Boost REQUIRED) ELSE () TARGET_COMPILE_DEFINITIONS(msgpack-cxx INTERFACE MSGPACK_NO_BOOST) ENDIF () diff --git a/appveyor.yml b/appveyor.yml index 6971a8c9d..262b1c0a5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -61,7 +61,7 @@ build_script: $env:cpp11 ` -D MSGPACK_BUILD_EXAMPLES=ON ` -D MSGPACK_BUILD_TESTS=ON ` - -D Boost_NO_BOOST_CMAKE=ON ` + -D MSGPACK_BOOST_USE_OLD_CMAKE=ON ` -D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" ` -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` From 2ee083d777ba0b1dbf3bceb9a50c48390670a422 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 14:22:47 +0900 Subject: [PATCH 07/10] Add debug --- appveyor.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 262b1c0a5..828ecbc68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -66,8 +66,21 @@ build_script: -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` + --debug-find ` .. - if ($LastExitCode -ne 0) { exit $LastExitCode } + + if ($LastExitCode -ne 0) { + Write-Host "=== CMake configuration FAILED with exit code $LastExitCode ===" + Write-Host "=== Dumping CMakeOutput.log ===" + if (Test-Path "CMakeFiles/CMakeOutput.log") { + Get-Content "CMakeFiles/CMakeOutput.log" + } + Write-Host "=== Dumping CMakeError.log ===" + if (Test-Path "CMakeFiles/CMakeError.log") { + Get-Content "CMakeFiles/CMakeError.log" + } + exit $LastExitCode + } cmake --build . --config Release if ($LastExitCode -ne 0) { exit $LastExitCode } From 4782dddc88e1a56768b0cd8ef94550114f952f46 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 14:27:54 +0900 Subject: [PATCH 08/10] Add DEBUG --- appveyor.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 828ecbc68..1c57143e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,6 +56,8 @@ build_script: Write-Host "=== Starting CMake configuration ===" + $ErrorActionPreference = "Continue" + cmake ` -G $env:msvc ` $env:cpp11 ` @@ -66,19 +68,23 @@ build_script: -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` - --debug-find ` - .. + .. 2>&1 | Tee-Object -Variable cmakeOutput + + Write-Host "=== Full CMake output: ===" + Write-Host $cmakeOutput if ($LastExitCode -ne 0) { Write-Host "=== CMake configuration FAILED with exit code $LastExitCode ===" - Write-Host "=== Dumping CMakeOutput.log ===" - if (Test-Path "CMakeFiles/CMakeOutput.log") { - Get-Content "CMakeFiles/CMakeOutput.log" - } - Write-Host "=== Dumping CMakeError.log ===" - if (Test-Path "CMakeFiles/CMakeError.log") { - Get-Content "CMakeFiles/CMakeError.log" + Write-Host "=== Checking if CMakeLists.txt exists ===" + if (Test-Path "..\CMakeLists.txt") { + Write-Host "CMakeLists.txt found" + } else { + Write-Host "CMakeLists.txt NOT found!" } + Write-Host "=== Current directory: ===" + Get-Location + Write-Host "=== Directory contents: ===" + dir exit $LastExitCode } From 83db9ace71b89b9bdda5c4fd4922ca3de7fbd34b Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 14:33:12 +0900 Subject: [PATCH 09/10] Remove CONFIG from Boost. --- example/boost/CMakeLists.txt | 2 +- example/cpp03/CMakeLists.txt | 2 +- example/x3/CMakeLists.txt | 2 +- fuzz/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/boost/CMakeLists.txt b/example/boost/CMakeLists.txt index 6870eca06..6464513b3 100644 --- a/example/boost/CMakeLists.txt +++ b/example/boost/CMakeLists.txt @@ -1,4 +1,4 @@ -FIND_PACKAGE (Boost REQUIRED CONFIG) +FIND_PACKAGE (Boost REQUIRED) FIND_PACKAGE (Threads REQUIRED) FIND_PACKAGE (ZLIB REQUIRED) diff --git a/example/cpp03/CMakeLists.txt b/example/cpp03/CMakeLists.txt index 6159c9b2e..90c493f04 100644 --- a/example/cpp03/CMakeLists.txt +++ b/example/cpp03/CMakeLists.txt @@ -1,6 +1,6 @@ FIND_PACKAGE (Threads REQUIRED) -FIND_PACKAGE (Boost COMPONENTS timer CONFIG) +FIND_PACKAGE (Boost COMPONENTS timer) LIST (APPEND exec_PROGRAMS class_intrusive.cpp diff --git a/example/x3/CMakeLists.txt b/example/x3/CMakeLists.txt index 9d31a6f58..963d6da4f 100644 --- a/example/x3/CMakeLists.txt +++ b/example/x3/CMakeLists.txt @@ -1,5 +1,5 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1) - FIND_PACKAGE (Boost REQUIRED COMPONENTS context CONFIG) + FIND_PACKAGE (Boost REQUIRED COMPONENTS context) FIND_PACKAGE (Threads REQUIRED) LIST (APPEND exec_PROGRAMS diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index 99193f94c..977968741 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -1,5 +1,5 @@ FIND_PACKAGE (Threads REQUIRED) -FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem unit_test_framework CONFIG) +FIND_PACKAGE (Boost REQUIRED COMPONENTS filesystem unit_test_framework) LIST (APPEND check_PROGRAMS regression_runner.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 65e43de20..b29c07a2c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ FIND_PACKAGE (Threads REQUIRED) FIND_PACKAGE (ZLIB) -FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework CONFIG) +FIND_PACKAGE (Boost REQUIRED COMPONENTS unit_test_framework) LIST (APPEND check_PROGRAMS array_ref.cpp From 69c52e7779223928370127380dda9531f7716042 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 12 Jan 2026 14:44:07 +0900 Subject: [PATCH 10/10] Recovered. --- .github/workflows/coverage.yml | 77 +++++++++++ .github/workflows/gha.yml | 244 +++++++++++++++++++++++++++++++++ appveyor.yml | 49 +------ 3 files changed, 326 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/gha.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..30e5cea73 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,77 @@ +name: coverage + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - cpp_master + tags: + - '*' + +jobs: + codecov: + timeout-minutes: 30 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install g++-10 cmake lcov -y + ./ci/set_gcc_10.sh + + - name: Cache boost + id: cache-boost + uses: actions/cache@v3 + with: + path: ~/boost-prefix/ + key: ${{ runner.os }}-boost-1-85-0-2024-05-27 + + - name: Build boost + if: steps.cache-boost.outputs.cache-hit != 'true' + run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix + + - name: Cache zlib + id: cache-zlib + uses: actions/cache@v3 + with: + path: ~/zlib-prefix/ + key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09 + + - name: Build zlib + if: steps.cache-zlib.outputs.cache-hit != 'true' + run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix + + - name: Compile tests + run: | + mkdir build + cmake \ + -D MSGPACK_CXX20=ON \ + -D MSGPACK_32BIT=OFF \ + -D MSGPACK_CHAR_SIGN=signed \ + -D MSGPACK_USE_X3_PARSE=ON \ + -D MSGPACK_BUILD_EXAMPLES=ON \ + -D MSGPACK_BUILD_TESTS=ON \ + -D CMAKE_BUILD_TYPE=Debug \ + -D MSGPACK_GEN_COVERAGE=ON \ + -D MSGPACK_USE_STD_VARIANT_ADAPTOR=ON \ + -D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \ + -B build \ + -S . || exit 1 + cmake --build build --target all || exit 1 + ctest --test-dir build || exit 1 + + - name: Generate coverage + working-directory: build + run: | + # Create lcov report + lcov --capture --directory . --output-file coverage.info --ignore-errors mismatch + lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files + lcov --list coverage.info # debug info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: build/coverage.info + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml new file mode 100644 index 000000000..6015e17f1 --- /dev/null +++ b/.github/workflows/gha.yml @@ -0,0 +1,244 @@ +name: CI + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - cpp_master + tags: + - '*' + +jobs: + macos: + name: ${{ format('macOS (pattern {0})', matrix.pattern) }} + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + pattern: [0, 1, 2, 3, 4] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Dependencies + run: | + brew update + brew install --force llvm + + - name: Cache boost + id: cache-boost + uses: actions/cache@v3 + with: + path: ~/boost-prefix/ + key: ${{ runner.os }}-boost-1-85-0-2024-05-27 + + - name: Build boost + if: steps.cache-boost.outputs.cache-hit != 'true' + run: ./.github/depends/boost.sh -b 64 -t clang -p $HOME/boost-prefix + + - name: Cache zlib + id: cache-zlib + uses: actions/cache@v3 + with: + path: ~/zlib-prefix/ + key: ${{ runner.os }}-zlib-1-2-13-2022-11-02 + + - name: Build zlib + if: steps.cache-zlib.outputs.cache-hit != 'true' + run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix + + - name: Build and test + shell: bash + run: | + # default configuration - overwrite its params later depending on matrix.pattern + export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" + export ARCH=64 + export API_VERSION=3 + export CHAR_SIGN="signed" + export X3_PARSE="OFF" + export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all" + + case ${{ matrix.pattern }} in + 0) + export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" + ;; + 1) + export API_VERSION=1 + ;; + 2) + export API_VERSION=2 + ;; + 3) + export X3_PARSE="ON" + ;; + 4) + export CHAR_SIGN="unsigned" + ;; + esac + + # build and test + export CXX="clang++" + CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1 + + cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 + + linux: + name: ${{ format('Linux (pattern {0})', matrix.pattern) }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + steps: + - uses: actions/checkout@v3 + + - name: Install build dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install g++-10 cmake valgrind -y + sudo apt-get install g++-10-multilib -y # for 32-bit compile + ./ci/set_gcc_10.sh + + - name: Cache boost + id: cache-boost + uses: actions/cache@v3 + with: + path: ~/boost-prefix/ + key: ${{ runner.os }}-boost-1-85-0-2024-05-27 + + - name: Build boost + if: steps.cache-boost.outputs.cache-hit != 'true' + run: ./.github/depends/boost.sh -b both -t gcc -p $HOME/boost-prefix + + - name: Cache zlib + id: cache-zlib + uses: actions/cache@v3 + with: + path: ~/zlib-prefix/ + key: ${{ runner.os }}-zlib-1-2-13-2022-11-02 + + - name: Build zlib + if: steps.cache-zlib.outputs.cache-hit != 'true' + run: ./.github/depends/zlib.sh -b both -p $HOME/zlib-prefix + + - name: Build and test + shell: bash + run: | + # default configuration - overwrite its params later depending on matrix.pattern + export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" + export ARCH=64 + export API_VERSION=3 + export CHAR_SIGN="signed" + export X3_PARSE="OFF" + export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all" + export ACTION="ci/build_cmake.sh" + + case ${{ matrix.pattern }} in + 0) + export CXX="clang++" + export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" + ;; + 1) + export CXX="g++-10" + export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" + ;; + 2) + export CXX="clang++" + export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON" + ;; + 3) + export CXX="g++-10" + export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON" + export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON" + ;; + 4) + export CXX="clang++" + export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON" + export NO_BOOST="-DMSGPACK_NO_BOOST" + ;; + 5) + export CXX="g++-10" + export ARCH=32 + ;; + 6) + export CXX="clang++" + export API_VERSION=2 + ;; + 7) + export CXX="g++-10" + export API_VERSION=1 + ;; + 8) + export CXX="clang++" + export CHAR_SIGN="unsigned" + ;; + 9) + export CXX="g++-10" + export X3_PARSE="ON" + ;; + 10) + export CXX="clang++" + export ACTION="ci/build_regression.sh" + ;; + 11) + export CXX="g++-10" + export ARCH=32 + export CHAR_SIGN="unsigned" + export X3_PARSE="ON" + ;; + esac + + # build and test + CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE} ${NO_BOOST}" ci/build_cmake.sh || exit 1 + cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 + + windows: + name: ${{ format('Windows cxx{0}', matrix.cxx) }} + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + # MSVC2022 only supports /std:c++14, /std:c++17 and /std:c++latest + cxx: [14, 17, 20] + pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"] + steps: + - uses: actions/checkout@v3 + + - name: Cache vcpkg dependencies + id: cache-vcpkg + uses: actions/cache@v3 + with: + path: C:/vcpkg/installed/x64-windows + key: ${{ runner.os }}-vcpkg-2021-08-09 + + - name: Install vcpkg dependencies + if: steps.cache-vcpkg.outputs.cache-hit != 'true' + shell: powershell + run: | + vcpkg update + vcpkg install zlib:x64-windows + vcpkg install boost-assert:x64-windows boost-numeric-conversion:x64-windows boost-variant:x64-windows boost-utility:x64-windows boost-fusion:x64-windows boost-optional:x64-windows boost-predef:x64-windows boost-preprocessor:x64-windows boost-timer:x64-windows boost-test:x64-windows + + - name: Build and test + shell: powershell + run: | + $CPPVER="MSGPACK_CXX${{ matrix.cxx }}=ON" + + md build + cmake ` + -A x64 ` + -G "Visual Studio 17 2022" ` + -D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` + -D MSGPACK_BUILD_TESTS=ON ` + -D $CPPVER ` + -D CMAKE_CXX_FLAGS="${{ matrix.pp_flag }} /D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" ` + -B build ` + -S . + if ($LastExitCode -ne 0) { exit $LastExitCode } + + cmake --build build --config Release + if ($LastExitCode -ne 0) { exit $LastExitCode } + + ctest -VV --test-dir build -C Release + if ($LastExitCode -ne 0) { exit $LastExitCode } diff --git a/appveyor.yml b/appveyor.yml index 1c57143e5..c0ec57bc8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: 7.0.0.{build} branches: only: - - cpp_master + - cpp_master environment: matrix: @@ -36,28 +36,6 @@ build_script: md prefix cd build - # Debug: Check Boost directories - Write-Host "=== Checking Boost installation at $env:boost_prefix ===" - if (Test-Path "$env:boost_prefix") { - Write-Host "Boost directory found!" - Write-Host "Top-level contents:" - dir $env:boost_prefix | Format-Table Name -AutoSize - - Write-Host "=== Checking $env:boost_subdir ===" - if (Test-Path "$env:boost_prefix\$env:boost_subdir") { - Write-Host "Library directory found!" - dir "$env:boost_prefix\$env:boost_subdir" | Select-Object -First 10 - } else { - Write-Host "$env:boost_subdir not found" - } - } else { - Write-Host "ERROR: Boost directory NOT found at $env:boost_prefix" - } - - Write-Host "=== Starting CMake configuration ===" - - $ErrorActionPreference = "Continue" - cmake ` -G $env:msvc ` $env:cpp11 ` @@ -68,29 +46,12 @@ build_script: -D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.3.1\prefix" ` -D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" ` -D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" ` - .. 2>&1 | Tee-Object -Variable cmakeOutput - - Write-Host "=== Full CMake output: ===" - Write-Host $cmakeOutput - - if ($LastExitCode -ne 0) { - Write-Host "=== CMake configuration FAILED with exit code $LastExitCode ===" - Write-Host "=== Checking if CMakeLists.txt exists ===" - if (Test-Path "..\CMakeLists.txt") { - Write-Host "CMakeLists.txt found" - } else { - Write-Host "CMakeLists.txt NOT found!" - } - Write-Host "=== Current directory: ===" - Get-Location - Write-Host "=== Directory contents: ===" - dir - exit $LastExitCode - } + .. + if ($LastExitCode -ne 0) { exit $LastExitCode } cmake --build . --config Release if ($LastExitCode -ne 0) { exit $LastExitCode } test_script: - - set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir% - - ctest -VV -C Release +- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.3.1\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir% +- ctest -VV -C Release