Skip to content

Conversation

dbarker
Copy link
Member

@dbarker dbarker commented Sep 21, 2025

Fixes #3648

CMake 4.x removed compatibility with versions older than 3.5.
https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features

OpenTracing is no longer being updated and sets the minimum CMake version required to 3.1. This creates a CMake configure error when using CMake 4.x.

Older versions of many dependencies depend on minimum versions of CMake < 3.5 (those in the install/cmake/third_party_<minimum,stable> and install/conan/conanfile_stable.txt).

Changes

  • Set CMAKE_POLICY_VERSION_MINIMUM=3.5 when building opentracing-cpp from source using FetchContent
  • Install CMake 3.31 in the MacOS CMake install test with conanfile_stable.txt dependency versions.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@dbarker dbarker changed the title set the CMAKE_POLICY_VERSION_MINIMUM=3.1 as a cache variable and envi… [CMAKE] Fix CMake 4.x error when building OpenTracing Sep 21, 2025
Copy link

codecov bot commented Sep 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.08%. Comparing base (4193b21) to head (c59c6fd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3649      +/-   ##
==========================================
- Coverage   90.09%   90.08%   -0.01%     
==========================================
  Files         220      220              
  Lines        7110     7110              
==========================================
- Hits         6405     6404       -1     
- Misses        705      706       +1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ronment variable when building opentracing-cpp to support cmake 4.x
@dbarker dbarker force-pushed the fix_macos_cmake_build branch from e573c13 to e1f97f7 Compare September 21, 2025 18:01
@dbarker dbarker marked this pull request as ready for review September 21, 2025 19:11
@dbarker dbarker requested a review from a team as a code owner September 21, 2025 19:11
INSTALL_TEST_DIR: '/Users/runner/install_test'
CXX_STANDARD: '17'
CMAKE_TOOLCHAIN_FILE: '/Users/runner/conan/build/Debug/generators/conan_toolchain.cmake'
CMAKE_VERSION: 3.31.0 # building the conan "stable" versions requires CMake 3.x
Copy link
Member Author

@dbarker dbarker Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading is the most direct and stable solution to fix the CMake 4.x build issue. Many of the dependencies in this "stable" version set depend on CMake versions < 3.5. Later versions of the dependencies (with the exception of opentracing has a minimum of 3.1) build with CMake 4.x.

@dbarker dbarker changed the title [CMAKE] Fix CMake 4.x error when building OpenTracing [CMAKE] Fix CMake 4.x build error on MacOS runner and when building opentracing Sep 21, 2025
@marcalff marcalff merged commit 74d348a into open-telemetry:main Sep 22, 2025
66 checks passed
@dbarker dbarker deleted the fix_macos_cmake_build branch September 22, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] Build on MacOS broken due to CMake upgrade

2 participants