Skip to content

CXX-3103 bump minimum required C Driver version to 2.0.0 #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9e12c0d
CXX-3103 bump minimum required C Driver version to 2.0.0
eramongodb Apr 8, 2025
95c317d
Fix display name for CMake compatibility matrix
eramongodb Apr 8, 2025
9668d13
Remove aggressive FetchContent optimization
eramongodb Apr 8, 2025
291591e
Treat NEED_DOWNLOAD_C_DRIVER as an INTERNAL cache variable
eramongodb Apr 8, 2025
e68fe8f
Restore setting C++ standard in example project CMake configs
eramongodb Apr 8, 2025
461658c
Fix distcheck
eramongodb Apr 8, 2025
3d1026f
Merge remote-tracking branch 'upstream/master' into cxx-3103
eramongodb Apr 9, 2025
779d7aa
Merge remote-tracking branch 'upstream/master' into cxx-3103
eramongodb Apr 10, 2025
e392c8a
Use alias targets for *_target variables
eramongodb Apr 10, 2025
1063ba4
Remove CMake patch version number from requirements and coverage
eramongodb Apr 14, 2025
b7307ac
Restore patch number for CMake binary downloads
eramongodb Apr 14, 2025
6d78a87
Test find-cxx and add-cxx in the same task
eramongodb Apr 15, 2025
9cac0ab
Defer C++ standard coverage to compile-only matrix
eramongodb Apr 15, 2025
9a34dea
Update changelog entry
eramongodb Apr 15, 2025
46f020b
Update calc_release_version_selftest.sh for 4.0
eramongodb Apr 15, 2025
091319b
Guard patch version number comparisons on minor version number
eramongodb Apr 15, 2025
b40c68a
Merge remote-tracking branch 'upstream/master' into cxx-3103
eramongodb Apr 17, 2025
11dea97
Simplify bool -> int conversion
eramongodb Apr 18, 2025
c855dab
Remove redundant REQUIRED in find_dependency()
eramongodb Apr 18, 2025
ad9a5a8
Avoid redundant list concatenation
eramongodb Apr 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .evergreen/config_generator/components/cmake_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
from config_generator.components.funcs.fetch_c_driver_source import FetchCDriverSource
from config_generator.components.funcs.install_c_driver import InstallCDriver
from config_generator.components.funcs.install_uv import InstallUV
from config_generator.components.funcs.setup import Setup

from config_generator.etc.distros import find_small_distro
from config_generator.etc.function import Function
from config_generator.etc.utils import bash_exec

from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_command import EvgCommandType
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from itertools import product

TAG = 'cmake-compat'


MATRIX = [
("min", [3, 15, 0], [11, 17], [False, True], [False, True]),
("max-v3", [3, 31, 6], [11, 17], [False, True], [False, True]),
("max", [4, 0, 0], [11, 17], [False, True], [False, True]),
]


class CMakeCompat(Function):
name = TAG
commands = [
bash_exec(
command_type=EvgCommandType.TEST,
working_dir='mongo-cxx-driver',
include_expansions_in_env=[
'CMAKE_MAJOR_VERSION',
'CMAKE_MINOR_VERSION',
'CMAKE_PATCH_VERSION',
'INSTALL_C_DRIVER',
'cxx_standard',
],
script='.evergreen/scripts/cmake-compat.sh',
),
bash_exec(
command_type=EvgCommandType.TEST,
include_expansions_in_env=[
'CMAKE_MAJOR_VERSION',
'CMAKE_MINOR_VERSION',
'CMAKE_PATCH_VERSION',
'INSTALL_C_DRIVER',
'cxx_standard',
'find_c_driver',
],
script='mongo-cxx-driver/.evergreen/scripts/cmake-compat-check.sh',
),
]


def functions():
return CMakeCompat.defn()


def tasks():
distro_name = 'rhel80'
distro = find_small_distro(distro_name)

for name, version, cxx_standards, c_driver_mode, import_modes in MATRIX:
for cxx_standard, install_c_driver, find_c_driver in product(cxx_standards, c_driver_mode, import_modes):
commands = [
Setup.call(), InstallUV.call()
] + ([InstallCDriver.call() if install_c_driver else FetchCDriverSource.call()]) + [
CMakeCompat.call(
vars={
'CMAKE_MAJOR_VERSION': version[0],
'CMAKE_MINOR_VERSION': version[1],
'CMAKE_PATCH_VERSION': version[2],
'INSTALL_C_DRIVER': 1 if install_c_driver else 0,
'cxx_standard': cxx_standard,
'find_c_driver': 1 if find_c_driver else 0,
},
),
]

if install_c_driver:
c_mode = 'find-c'
else:
c_mode = 'add-c'

if find_c_driver:
cxx_mode = 'find-cxx'
else:
cxx_mode = 'add-cxx'

yield EvgTask(
name=f'{TAG}-{name}-cxx{cxx_standard}-{c_mode}-{cxx_mode}',
tags=[TAG, f'cmake-{name}', f'cmake-{c_mode}', f'cxx{cxx_standard}', f'cmake-{cxx_mode}'],
run_on=distro.name,
commands=commands,
)


def variants():
return [
BuildVariant(
name=f'{TAG}-matrix',
display_name='CMake Compatibility Matrix',
tasks=[EvgTaskRef(name=f'.{TAG}')],
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@


# If updating mongoc_version_minimum, also update:
# - LIBBSON_REQUIRED_VERSION and LIBMONGOC_REQUIRED_VERSION in CMakeLists.txt
# - BSON_REQUIRED_VERSION and MONGOC_REQUIRED_VERSION in CMakeLists.txt
# - the version of pkg:github/mongodb/mongo-c-driver in etc/purls.txt
# - the default value of --c-driver-build-ref in etc/make_release.py
# Only LIBMONGOC_DOWNLOAD_VERSION needs to be updated when pinning to an unreleased commit.
# Only MONGOC_DOWNLOAD_VERSION needs to be updated when pinning to an unreleased commit.
# If pinning to an unreleased commit, create a "Blocked" JIRA ticket with
# a "depends on" link to the appropriate C Driver version release ticket.
MONGOC_VERSION_MINIMUM = 'f1e2b54090ea28b169b7d9949bd318615188d81d' # CXX-3103: bump to 2.0.0 once released.
MONGOC_VERSION_MINIMUM = '2.0.0'


class InstallCDriver(Function):
Expand Down
31 changes: 30 additions & 1 deletion .evergreen/generated_configs/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,35 @@ functions:
args:
- -c
- etc/run-clang-tidy.sh
cmake-compat:
- command: subprocess.exec
type: test
params:
binary: bash
working_dir: mongo-cxx-driver
include_expansions_in_env:
- CMAKE_MAJOR_VERSION
- CMAKE_MINOR_VERSION
- CMAKE_PATCH_VERSION
- INSTALL_C_DRIVER
- cxx_standard
args:
- -c
- .evergreen/scripts/cmake-compat.sh
- command: subprocess.exec
type: test
params:
binary: bash
include_expansions_in_env:
- CMAKE_MAJOR_VERSION
- CMAKE_MINOR_VERSION
- CMAKE_PATCH_VERSION
- INSTALL_C_DRIVER
- cxx_standard
- find_c_driver
args:
- -c
- mongo-cxx-driver/.evergreen/scripts/cmake-compat-check.sh
compile:
command: subprocess.exec
type: test
Expand Down Expand Up @@ -397,7 +426,7 @@ functions:
type: setup
params:
updates:
- { key: mongoc_version_minimum, value: f1e2b54090ea28b169b7d9949bd318615188d81d }
- { key: mongoc_version_minimum, value: 2.0.0 }
- command: subprocess.exec
type: setup
params:
Expand Down
Loading