Skip to content

CXX-3253 reintroduce VS 2015 task coverage #1381

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 13 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
72 changes: 47 additions & 25 deletions .evergreen/config_generator/components/compile_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,62 @@
from shrub.v3.evg_command import KeyValueParam, expansions_update
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from itertools import product


TAG = 'compile-only'


# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('rhel80', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),
('rhel80', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),

('ubuntu2004-arm64', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),
('ubuntu2004-arm64', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),

('rhel8-power', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),
('rhel8-zseries', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),

('macos-14-arm64', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),
('macos-14', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),

('windows-vsCurrent', 'vs2017x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, ]),
('windows-vsCurrent', 'vs2019x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, ]),
('windows-vsCurrent', 'vs2022x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),
# C++ standard and compiler coverage

('rhel80', 'clang', [11, 17, 20, ]), # Clang 7.0 (max: C++20)
('ubuntu2004', 'clang-10', [11, 17, 20, ]), # Clang 10.0 (max: C++20)
('rhel84', 'clang', [11, 17, 20, ]), # Clang 11.0 (max: C++20)
('ubuntu2204', 'clang-12', [11, 17, 20, 23]), # Clang 12.0 (max: C++23)
('rhel90', 'clang', [11, 17, 20, 23]), # Clang 13.0 (max: C++23)
('rhel91', 'clang', [11, 17, 20, 23]), # Clang 14.0 (max: C++23)
('rhel92', 'clang', [11, 17, 20, 23]), # Clang 15.0 (max: C++23)
('rhel93', 'clang', [11, 17, 20, 23]), # Clang 16.0 (max: C++23)
('rhel94', 'clang', [11, 17, 20, 23]), # Clang 17.0 (max: C++23)
('rhel95', 'clang', [11, 17, 20, 23]), # Clang 18.0 (max: C++23)

('rhel76', 'gcc', [11, 14, ]), # GCC 4.8 (max: C++14)
('rhel80', 'gcc', [11, 17, 20, ]), # GCC 8.2 (max: C++20)
('debian10', 'gcc-8', [11, 17, 20, ]), # GCC 8.3 (max: C++20)
('rhel84', 'gcc', [11, 17, 20, ]), # GCC 8.4 (max: C++20)
('ubuntu2004', 'gcc-9', [11, 17, 20, ]), # GCC 9.4 (max: C++20)
('debian11', 'gcc-10', [11, 17, 20, ]), # GCC 10.2 (max: C++20)
('rhel90', 'gcc', [11, 17, 20, 23]), # GCC 11.2 (max: C++23)
('rhel92', 'gcc', [11, 17, 20, 23]), # GCC 11.3 (max: C++23)
('rhel94', 'gcc', [11, 17, 20, 23]), # GCC 11.4 (max: C++23)
('rhel95', 'gcc', [11, 17, 20, 23]), # GCC 11.5 (max: C++23)

('windows-vsCurrent', 'vs2015x64', [11, 14, 'latest']), # Max: C++14
('windows-vsCurrent', 'vs2017x64', [11, 14, 17, 20, 'latest']), # Max: C++20
('windows-vsCurrent', 'vs2019x64', [11, 14, 17, 20, 23, 'latest']), # Max: C++23
('windows-vsCurrent', 'vs2022x64', [11, 14, 17, 20, 23, 'latest']), # Max: C++23

# Other coverage.

('ubuntu2004-arm64', 'gcc', [11, 17]), # Clang 10
('ubuntu2004-arm64', 'clang', [11, 17]), # Clang 10

('rhel8-power', None, [11, 17]),
('rhel8-zseries', None, [11, 17]),

('macos-14-arm64', None, [11, 17]),
('macos-14', None, [11, 17]),
]
# fmt: on
# pylint: enable=line-too-long


def tasks():
for distro_name, compiler, build_types, link_types, cxx_standards in MATRIX:
for build_type, link_type, cxx_standard in product(build_types, link_types, cxx_standards):
build_type = 'Debug'

for distro_name, compiler, cxx_standards in MATRIX:
for cxx_standard in cxx_standards:
distro = find_large_distro(distro_name)

name = f'{TAG}-{make_distro_str(distro_name, compiler, None)}'
Expand All @@ -53,21 +77,18 @@ def tasks():
if compiler is not None:
tags.append(compiler)

name += f'-{build_type.lower()}-{link_type}'
tags += [build_type.lower(), link_type]
name += f'-{build_type.lower()}'
tags += [build_type.lower()]

updates = []
compile_vars = {}
compile_vars = {'BUILD_SHARED_AND_STATIC_LIBS': 'ON'}

updates += [KeyValueParam(key='build_type', value=build_type)]
updates += [KeyValueParam(key=key, value=value) for key, value in compiler_to_vars(compiler).items()]

if cxx_standard is not None:
compile_vars |= {'REQUIRED_CXX_STANDARD': cxx_standard}

if link_type == 'static':
compile_vars |= {'USE_STATIC_LIBS': 1}

# PowerPC and zSeries are limited resources.
patchable = False if any(pattern in distro_name for pattern in ['power', 'zseries']) else None

Expand All @@ -79,6 +100,7 @@ def tasks():
Compile.call(
build_type=build_type,
compiler=compiler,
vars=compile_vars,
)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class InstallCDriver(Function):
bash_exec(
command_type=EvgCommandType.SETUP,
add_expansions_to_env=True,
env={
'CC': '${cc_compiler}',
'CXX': '${cxx_compiler}',
},
script='mongo-cxx-driver/.evergreen/scripts/install-c-driver.sh'
),
]
Expand Down
55 changes: 31 additions & 24 deletions .evergreen/config_generator/etc/distros.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Distro(BaseModel):
os_type: Literal['linux', 'macos', 'windows'] | None = None
os_ver: str | None = None
vs_ver: Literal[
'2013',
'2015',
'2017',
'2019',
Expand All @@ -48,6 +47,8 @@ def ls_distro(name, **kwargs):


DEBIAN_DISTROS = [
*ls_distro(name='debian10', os='debian', os_type='linux', os_ver='10'),
*ls_distro(name='debian11', os='debian', os_type='linux', os_ver='10'),
*ls_distro(name='debian12-latest', os='debian', os_type='linux', os_ver='latest'),
]

Expand All @@ -60,8 +61,16 @@ def ls_distro(name, **kwargs):
]

RHEL_DISTROS = [
*ls_distro(name='rhel76', os='rhel', os_type='linux', os_ver='7.6'),
*ls_distro(name='rhel80', os='rhel', os_type='linux', os_ver='8.0'),
*ls_distro(name='rhel84', os='rhel', os_type='linux', os_ver='8.4'),
*ls_distro(name='rhel90', os='rhel', os_type='linux', os_ver='9.0'),
*ls_distro(name='rhel91', os='rhel', os_type='linux', os_ver='9.1'),
*ls_distro(name='rhel92', os='rhel', os_type='linux', os_ver='9.2'),
*ls_distro(name='rhel93', os='rhel', os_type='linux', os_ver='9.3'),
*ls_distro(name='rhel94', os='rhel', os_type='linux', os_ver='9.4'),
*ls_distro(name='rhel95', os='rhel', os_type='linux', os_ver='9.5'),
*ls_distro(name='rhel92', os='rhel', os_type='linux', os_ver='9.0'),
]

RHEL_ARM64_DISTROS = [
Expand All @@ -78,6 +87,7 @@ def ls_distro(name, **kwargs):
]

UBUNTU_DISTROS = [
*ls_distro(name='ubuntu2004', os='ubuntu', os_type='linux', os_ver='20.04'),
*ls_distro(name='ubuntu2204', os='ubuntu', os_type='linux', os_ver='22.04'),
]

Expand Down Expand Up @@ -151,19 +161,6 @@ def make_distro_str(distro_name, compiler, arch) -> str:
distro_name[len('windows-vsCurrent-'):] + f'-{compiler_str}'
else:
distro_str = 'windows-2019' + f'-{compiler_str}'
elif distro_name.startswith('windows-64-vs'):
# Abbreviate 'windows-64-vs<type>' as 'vs<type>' and append '-<arch>' if
# given in compiler string as 'vs<type><arch>', e.g.:
# ('windows-64-vs2017', 'vs2017x64', None) -> vs2017-x64
# ('windows-64-vs2017', 'mingw', None) -> vs2017-mingw
distro_str = distro_name[len('windows-64-'):] + {
'vs2017x64': '-x64',
'vs2017x86': '-x86',
'vs2019x64': '-x64',
'vs2019x86': '-x86',
'vs2022x64': '-x64',
'vs2022x86': '-x86',
}.get(compiler, f'-{compiler}')
else:
distro_str = distro_name
if compiler:
Expand All @@ -177,6 +174,8 @@ def make_distro_str(distro_name, compiler, arch) -> str:

def to_cc(compiler):
return {
'vs2015x64': 'Visual Studio 14 2015',
'vs2015x86': 'Visual Studio 14 2015',
'vs2017x64': 'Visual Studio 15 2017',
'vs2017x86': 'Visual Studio 15 2017',
'vs2019x64': 'Visual Studio 16 2019',
Expand All @@ -188,6 +187,8 @@ def to_cc(compiler):

def to_platform(compiler):
return {
'vs2015x64': 'x64',
'vs2015x86': 'Win32',
'vs2017x64': 'x64',
'vs2017x86': 'Win32',
'vs2019x64': 'x64',
Expand All @@ -198,24 +199,30 @@ def to_platform(compiler):


def compiler_to_vars(compiler):
match compiler:
case 'gcc':
if compiler is None:
return {}

match compiler, compiler.split('-'):
case _, ['gcc', *rest]:
return {
'cc_compiler': 'gcc',
'cxx_compiler': 'g++',
'cc_compiler': '-'.join(['gcc'] + rest),
'cxx_compiler': '-'.join(['g++'] + rest),
}

case 'clang':
case _, ['clang', *rest]:
return {
'cc_compiler': 'clang',
'cxx_compiler': 'clang++',
'cc_compiler': '-'.join(['clang'] + rest),
'cxx_compiler': '-'.join(['clang++'] + rest),
}

case str(vs) if 'vs' in vs:
case str(vs), _ if 'vs' in vs:
return {
'generator': to_cc(vs),
'platform': to_platform(vs),
}

case _:
return {}
case compiler, _:
return {
'cc_compiler': compiler,
'cxx_compiler': compiler,
}
3 changes: 3 additions & 0 deletions .evergreen/generated_configs/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ functions:
params:
binary: bash
add_expansions_to_env: true
env:
CC: ${cc_compiler}
CXX: ${cxx_compiler}
args:
- -c
- mongo-cxx-driver/.evergreen/scripts/install-c-driver.sh
Expand Down
Loading