Skip to content

CXX-2665 audit and refactor EVG matrices to use supported distros and extended coverage #1328

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 35 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
22951e9
Silence venv activation error messages during post-task commands
eramongodb Feb 7, 2025
3603c89
Print uncaught exception message during component execution
eramongodb Feb 7, 2025
7761f49
Avoid failure to spawn mongocryptd from failing API examples
eramongodb Feb 7, 2025
20f6543
Fix missing alignment parameter to std::aligned_storage
eramongodb Feb 7, 2025
43c4c6a
Silence -Wover-aligned warnings
eramongodb Feb 7, 2025
0282554
Ensure alignment of data members of new-allocated objects
eramongodb Feb 7, 2025
62c766a
Silence -Walign-mismatch warnings for stack::emplace_back
eramongodb Feb 7, 2025
ce45e07
Use alignas instead of std::aligned_storage to address C2338
eramongodb Feb 7, 2025
abc542b
Address -Wsign-conversion warnings on ubuntu2204-arm64
eramongodb Feb 7, 2025
31beecb
Fix expansion of uninstall directories on RHEL
eramongodb Feb 7, 2025
a399cbf
Add TEST_WITH_CSFLE to opt out of CSFLE setup routines
eramongodb Feb 7, 2025
0ffa53d
Move handling of lib vs. lib64 from config into scripts
eramongodb Feb 7, 2025
18dd0a7
Use DYLD_FALLBACK_LIBRARY_PATH instead of DYLD_LIBRARY_PATH
eramongodb Feb 7, 2025
5e636f9
Use Astral UV to acquire clang-tidy on RHEL
eramongodb Feb 7, 2025
3c77444
Refactor integration matrix to use highest-availability hosts
eramongodb Feb 7, 2025
f5af8c0
Refactor sanitizer matrix to use highest-availability distros
eramongodb Feb 7, 2025
9c42f2a
Refactor uninstall check matrix to use highest-availability distros
eramongodb Feb 7, 2025
2456c43
Refactor versioned API matrix to use highest-availability distros
eramongodb Feb 7, 2025
9dc22e9
Refactor valgrind matrix to use highest-availability distros
eramongodb Feb 7, 2025
8d3982d
Refactor compile only matrix to use highest-availability distros
eramongodb Feb 7, 2025
440c66a
Use rhel80 as the default Linux distro of choice
eramongodb Feb 7, 2025
3752e62
Remove unused distros from distros.py
eramongodb Feb 7, 2025
dd89974
Reduce large+small distro boilerplate
eramongodb Feb 7, 2025
a4f5867
Group tasks on non-limited distros into display tasks
eramongodb Feb 7, 2025
223c3b9
Ignore std::bad_alloc exceptions when allocating examples::big_string
eramongodb Feb 10, 2025
02a47a7
Reduce tasks on limited distros to csfle, latest, replica only
eramongodb Feb 10, 2025
d55582b
Revert "Use alignas instead of std::aligned_storage to address C2338"
eramongodb Feb 11, 2025
00f3bbc
Remove _GLIBCXX_USE_CXX11_ABI=0 from compile flags
eramongodb Feb 11, 2025
b95d51d
Revert "Silence -Walign-mismatch warnings for stack::emplace_back"
eramongodb Feb 11, 2025
2f15461
Revert "Ensure alignment of data members of new-allocated objects"
eramongodb Feb 11, 2025
9fb715e
Revert "Silence -Wover-aligned warnings"
eramongodb Feb 11, 2025
255fa1c
Revert "Fix missing alignment parameter to std::aligned_storage"
eramongodb Feb 11, 2025
4e798e4
Update path to llvm-symbolizer for print_stacktrace=1 output
eramongodb Feb 11, 2025
a8b5988
Use consistent LLVM toolchain for compiler and symbolizer
eramongodb Feb 11, 2025
b468a81
Fix typo in error message for valgrind
eramongodb Feb 11, 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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def functions():


def tasks():
distro_name = 'ubuntu2004'
distro_name = 'rhel80'
distro = find_large_distro(distro_name)

return [
Expand Down
5 changes: 4 additions & 1 deletion .evergreen/config_generator/components/clang_tidy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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 compiler_to_vars, find_small_distro
Expand All @@ -24,6 +25,7 @@ class ClangTidy(Function):
'cc_compiler',
'cxx_compiler',
'distro_id',
'UV_INSTALL_DIR',
],
script='etc/run-clang-tidy.sh',
)
Expand All @@ -42,7 +44,7 @@ def functions():


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

return [
Expand All @@ -52,6 +54,7 @@ def tasks():
run_on=distro.name,
commands=[
Setup.call(),
InstallUV.call(),
InstallCDriver.call(compiler='clang'),
ClangTidy.call(compiler='clang'),
],
Expand Down
153 changes: 76 additions & 77 deletions .evergreen/config_generator/components/compile_only.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from config_generator.components.funcs.compile import Compile
from config_generator.components.funcs.install_uv import InstallUV
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.setup import Setup

from config_generator.etc.distros import find_large_distro, make_distro_str
from config_generator.etc.distros import compiler_to_vars, find_large_distro, make_distro_str

from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_build_variant import BuildVariant, DisplayTask
from shrub.v3.evg_command import KeyValueParam, expansions_update
from shrub.v3.evg_task import EvgTask, EvgTaskRef

from itertools import product
Expand All @@ -17,112 +18,110 @@
# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('rhel79', None, ['Release'], ['shared'], ['impls']),
('rhel80', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),
('rhel80', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),

('rhel81-power8', None, ['Release'], ['shared'], [None]),
('rhel83-zseries', None, ['Release'], ['shared'], [None]),
('ubuntu2004-arm64', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),
('ubuntu2004-arm64', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]),

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

('windows-64-vs2015', 'vs2015x64', ['Debug', 'Release'], ['shared'], [None]),
('windows-vsCurrent', 'vs2017x64', ['Debug', 'Release'], ['shared'], [None]),
('windows-vsCurrent', 'vs2019x64', ['Debug', 'Release'], ['shared'], [None]),
('windows-vsCurrent', 'vs2022x64', ['Debug', 'Release'], ['shared'], [None]),
('macos-14-arm64', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),
('macos-14', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]),

('windows-64-vs2015', 'vs2015x64', ['Debug', 'Release'], ['shared', 'static'], [11, ]), # CXX-3215
('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]),
]
# fmt: on
# pylint: enable=line-too-long


def generate_tasks():
res = []

for distro_name, compiler, build_types, link_types, polyfills in MATRIX:
for build_type, link_type, polyfill in product(build_types, link_types, polyfills):
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):
distro = find_large_distro(distro_name)

name = f'{TAG}-{make_distro_str(distro_name, compiler, None)}'
tags = [TAG, distro_name]

if cxx_standard is not None:
name += f'-cxx{cxx_standard}'
tags += [f'cxx{cxx_standard}']

if compiler is not None:
tags.append(compiler)

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

if polyfill is not None:
name += f'-{polyfill}'
tags.append(polyfill)
updates = []
compile_vars = {}

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

patchable = None
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.
if any(pattern in distro_name for pattern in ['power8', 'zseries']):
patchable = False

# In etc/calc_release_version.py:
# error: unknown option `format=...'
# usage: git tag ...
# or: ...
if distro_name == 'rhel79':
patchable = False

res.append(
EvgTask(
name=name,
tags=tags,
run_on=distro.name,
patchable=patchable,
commands=[
Setup.call(),
FetchCDriverSource.call(),
] + (
# DEVPROD-13875 + astral-sh/uv/issues/10231.
[] if "vs2015" in distro_name else [InstallUV.call()]
) + [
Compile.call(
build_type=build_type,
compiler=compiler,
polyfill=polyfill,
)
],
patchable = False if any(pattern in distro_name for pattern in ['power', 'zseries']) else None

commands = [expansions_update(updates=updates)] if updates else []
commands += [
Setup.call(),
InstallCDriver.call(),
] + (
# DEVPROD-13875 + astral-sh/uv/issues/10231.
[] if "vs2015" in distro_name else [InstallUV.call()]
) + [
Compile.call(
build_type=build_type,
compiler=compiler,
)
]

yield EvgTask(
name=name,
tags=tags,
run_on=distro.name,
patchable=patchable,
commands=commands,
)

return res


TASKS = generate_tasks()


def tasks():
res = TASKS.copy()

# PowerPC and zSeries are limited resources.
for task in res:
if any(pattern in task.run_on for pattern in ["power8", "zseries"]):
task.patchable = False

return res


def variants():
tasks = []

one_day = 1440 # Seconds.

# PowerPC and zSeries are limited resources.
tasks = [
EvgTaskRef(name=f'.{TAG} .rhel81-power8', batchtime=one_day),
EvgTaskRef(name=f'.{TAG} .rhel83-zseries', batchtime=one_day),
EvgTaskRef(name=f'.{TAG} !.rhel81-power8 !.rhel83-zseries'),
limited_distros = [
'rhel8-power',
'rhel8-zseries',
]

return [
BuildVariant(
name=f'{TAG}-matrix',
display_name=f'{TAG}-matrix',
tasks=tasks,
),
distros = sorted(list({entry[0] for entry in MATRIX}))
batched = [distro for distro in distros if distro in limited_distros]
tasks = [
EvgTaskRef(name=f'.{TAG} .{distro}', batchtime=one_day) for distro in batched
] + [
EvgTaskRef(name=f'.{TAG}' + ''.join(f' !.{distro}' for distro in batched))
]

yield BuildVariant(
name=f'{TAG}-matrix',
display_name=f'{TAG}-matrix',
tasks=tasks,
display_tasks=[
DisplayTask(
name=f'{TAG}-matrix',
execution_tasks=[f'.{TAG}' + ''.join(f' !.{distro}' for distro in batched)],
)
],
)
4 changes: 2 additions & 2 deletions .evergreen/config_generator/components/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('ubuntu2204-arm64'),
('ubuntu2204'),
('ubuntu2204-arm64'), # `docker` is not available on RHEL distros by default.
('ubuntu2204'), # `docker` is not available on RHEL distros by default.
]
# fmt: on
# pylint: enable=line-too-long
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/config_generator/components/funcs/stop_mongod.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class StopMongod(Function):
set -o pipefail
if cd drivers-evergreen-tools/.evergreen/orchestration 2>/dev/null; then
. ../venv-utils.sh
if venvactivate venv; then
mongo-orchestration stop
if venvactivate venv 2>/dev/null; then
mongo-orchestration stop
fi
fi
'''
Expand Down
1 change: 0 additions & 1 deletion .evergreen/config_generator/components/funcs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Test(Function):
'example_projects_cxxflags',
'example_projects_ldflags',
'generator',
'lib_dir',
'MONGOCXX_TEST_TOPOLOGY',
'MONGODB_API_VERSION',
'platform',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ class TestAtlasConnectivity(Function):
script='''\
export MONGOC_INSTALL_PREFIX=$(pwd)/../mongoc
export MONGOCXX_INSTALL_PREFIX=$(pwd)/build/install
export LIB_DIR=${lib_dir}
if [[ "${distro_id}" == rhel* ]]; then
export LIB_DIR=lib64
else
export LIB_DIR=lib
fi
export BUILD_TYPE=${build_type}
export BUILD_DIR=$(pwd)/build

Expand Down
6 changes: 5 additions & 1 deletion .evergreen/config_generator/components/funcs/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class TestAuth(Function):
script='''\
export MONGOC_INSTALL_PREFIX=$(pwd)/../mongoc
export MONGOCXX_INSTALL_PREFIX=$(pwd)/build/install
export LIB_DIR=${lib_dir}
if [[ "${distro_id}" == rhel* ]]; then
export LIB_DIR=lib64
else
export LIB_DIR=lib
fi
export BUILD_TYPE=${build_type}
export BUILD_DIR=$(pwd)/build
export URI="mongodb://bob:pwd123@localhost"
Expand Down
Loading