mongo-c-driver: fix problems with newer CMake versions - #30788
Conversation
- <2.4.0 has broken TRY_COMPILE in src/libmongoc/CMakeLists.txt, failing in CMake 4.4+ - mongodb/mongo-c-driver@ea1b547 - <1.30.3/<2.1.0 has CMP0042 OLD in src/libbson/CMakeLists.txt, removed in CMake 4+ - mongodb/mongo-c-driver@2344038 - mongodb/mongo-c-driver@c60f45f - <1.25 has cmake_minimum_required (VERSION 3.1) in src/libbson/CMakeLists.txt, rejected in CMake 4+ - mongodb/mongo-c-driver@3c7951b#diff-71a4c7cf57df62b3b3d8bb547bcf79c5fafb5accb4a6608d696ccdf43e17ad6a
|
Does defining Clipping the version range of CMake to <4 would prevent usage with Visual Studio 2026. I'd say we would only do this if the build script truly does not work with CMake <4 even with the policy workaround. |
It only fixes the last issue with |
|
I'm a bit confused. What version of |
|
With
Either we can drop these older <1.30.3 versions or we can add this patch, By also adding this we can support CMake 4.4, I've added both fixes as separate commits, let me know which combination you prefer |
|
Hi @Dahlgren thanks so much for the table and for the work working out which versions build and don't. However, based on what you are saying I think we may just leave this as is - if all versions greater than 1.30.6 work with CMake 4, then users should use those instead. If this is because of We will generally not backport fixes to "older" versions if newer versions are already published and working and can be trivially updated to. |
|
How about dropping versions older than 1.30.6 and just adding the CMake 4.4 fix then? My issue is the CMake 4.4 incompatibility with |
1.30.6 should theoretically be compatible with 4.0: https://github.com/mongodb/mongo-c-driver/blob/1.30.6/CMakeLists.txt#L1 What is the error when CMake 4.4. is used - if it worked with 4.0-4.3.x, it could very well be a CMake regression too. |
Yes,
It's an incorrect According to the CMake docs the It's only fixed in latest 2.4.0 release, mongodb/mongo-c-driver@ea1b547
Applying this patch would fix the build for the existing versions, |
Summary
Changes to recipe: mongo-c-driver
Motivation
It's not possible to compile mongo-c-driver recipe when newer versions of CMake are on system path, the recipe doesn't declare any CMake range
Details
Add a 👍 reaction to pull requests you find important to help the team prioritize, thanks!