-
Notifications
You must be signed in to change notification settings - Fork 543
Miscellaneous Improvements to EVG Config #1049
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of most YAML anchors, and movement of scripts from YAML to separate files is a much appreciated simplification.
LGTM with minor suggestions.
Removed the minimum libmongoc variant. Latest changes verified by this patch. |
separate_arguments (build_opts) | ||
execute_process_and_check_result ( | ||
COMMAND ${MY_CMAKE_COMMAND} ${MAKE_COMMAND} ${build_opts} | ||
COMMAND ${CMAKE_COMMAND} --build . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COMMAND ${CMAKE_COMMAND} --build . | |
COMMAND ${CMAKE_COMMAND} --build . --parallel |
If --parallel
is given with no argument value, CMake will infer the parallelism level automatically (may be useful in other contexts, but is a useful shorthand in general).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming, is inferring parallelism via --parallel
preferable/different to using the value of the CMAKE_BUILD_PARALLEL_LEVEL
environment variable (which AFAIK should be visible/inherited by the execute_process()
commands given the changes in this PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed: CMAKE_BUILD_PARALLEL_LEVEL
suffices.
"Ubuntu 18.04 with minimum libmongoc" was removed in PR mongodb#1049. Testing with minimum libmongoc is now the default.
* bump required C driver to 1.25.0 * remove reference to removed EVG variant "Ubuntu 18.04 with minimum libmongoc" was removed in PR #1049. Testing with minimum libmongoc is now the default. * remove step for updating docker versions This step is listed in later in `Docker Image Build and Publish`. Building the Docker images requires downloading the C++ release tarball. Bump after tagging. * remove `check_docker_file_versions` The Docker versions are bumped after tagging the release. This check may not be expected to succeed during a release. * fix documented introduction of the auto C driver download It is introduced in 3.9.0 as part of CXX-2695. * add `-pthread` to example project build scripts This is a workaround until CDRIVER-4776 is resolved.
Description
This PR aims to make numerous overdue improvements to the EVG config for the CXX Driver. Verified by this patch.
Due to volume of diffs, navigating the changes by-commit is recommended.
EVG Matrix Variants
The "integration task" matrix is currently defined using "matrix variants" (
axis:
+matrix_*
), which have long since been not actively supported. Per documentation:Instead of using EVG matrix variants, the "integration matrix" variants have been expanded and defined explicitly, identified by the
integration-
prefix in their names. Due to their names being different from the prior config (even though their display names remain unchanged), EVG considers these variants distinct from the prior config and thus does not preserve variant/task history.YAML "merge keys" (
<<:
) are used to reduce duplication across the "integration tasks" as much as possible. These keys are deliberately limited to the specification of tasks and preserving existing platform-specific behavior. This is part of a greater effort to reduce the complexity of the EVG variant/task definitions by reducing the use of EVG YAML anchors. The only YAML anchors now in use ismongoc_minimum_required
andintegration_matrix_*
.These changes also addresses ongoing task failures by resolving CXX-2772 (Ubuntu 18.04 -> Ubuntu 20.04 for 7.0 and Latest ). The "Ubuntu 18.04 Release (MongoDB Latest)" variant is thus obsoleted and removed, reducing the total task count by 8 (235 -> 227). The
lint
task was moved into its own variant.YAML Anchors
YAML anchors defined under
variables:
have been almost entirely inlined and moved into related scripts. This is to reduce the complexity of variant/task definitions. These changes include:tar_options
: removed: obsolete (unused?)poly_mnmlstc
: removed: obsolete (unused?)mongoc_version_default
: replaced withmongoc_version_minimum
(little/no reason for them not to be synced).version_*
: inlined intomongodb_version:
expansion definitions (no significant benefit to their use).example_projects_*
: inlined into the just 5 variants it is used by (asan/ubsan + experimental std).poly_flags
: inlined into the just 4 variants it is used by (MacOS + experimental std).extra_path
: inlined into the "compile" and "test" task definition (specified by platform detection).*_test_params
: inlined into the "test" task definition (specified byTEST_WITH_(ASAN|UBSAN|VALGRIND)
).*_cmake_flags
: inlined into the "compile" task definition (specified by platform detection,TEST_WITH_
, and CMakegenerator
).Therefore, the complexity of specifying CMake configuration and compile flags has been moved into the
compile.sh
andtest.sh
scripts, where Bash arrays can be used to much more easily and readably specify the flags required per task and platform (especially the CC/CXX compile flags).Compile and Test
These two EVG functions were occupying a significant portion of the EVG config file. Due to their importance and length, their entire definitions have been moved into the
compile.sh
andtest.sh
scripts. This significantly reduces the size of the EVG config file, offsetting the increased line count due to the integration matrix expansion. This also allows applying tools such as formatting and ShellCheck to the compile and task scripts.To further facilitate maintainability, rather than dumping all expansions via
add_expansions_to_env
, the specific expansions required by individual functions/scripts are explicitly documented viainclude_expansions_in_env:
andenv:
. Although a bit verbose, this should help keep track of what expansions are required by what functions/scripts in the future.Miscellaneous
-Wno-aligned-new
flag was dropped due to conflicts with Clang tasks + appearing to cause no trouble for existing tasks (not entirely clear what motivated its addition or if it still applies; can revert if necessary).run_on:
in variant definitions. Moved into task definition if able.CMAKE_(C|CXX)_COMPILER_LAUNCHER
environment variables.compiler
expansion intended to select GCC vs. Clang was completely unused (bug since its introduction?), meaning the Clang-specific tasks were not using Clang at all. The newcc_compiler
andcxx_compiler
expansions are used to defineCC
andCXX
environment variables to direct CMake to use the specified compiler(s), fixing the GCC and Clang tasks. Note: these tasks are moved from Ubuntu 22.04 -> Ubuntu 20.04 due to Ubuntu 22.04 apparently not providing a Clang compiler.nproc
andCMAKE_BUILD_PARALLEL_LEVEL
to enable build parallelism at the CMake level (more consistently and better forwarded to underlying generator without depending on compile flags).cmake -P
commands. Additionally, the distcheck commands were unnecessarily specific to the GNU Make generator. The required "polyfill flags" are now properly forwarded, andcmake --build
is used instead ofmake
. These changes now allow the distcheck test to be run on Windows, but this addition was deliberately omitted (see:_RUN_DISTCHECK
incompile.sh
) to avoid increasing the already-lengthy run time of Windows tasks.