From 61c9b602181d7da8db5c5d0324c1eb3995736564 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Mon, 24 Mar 2025 12:55:30 -0500 Subject: [PATCH 1/2] CDRIVER-3253 reintroduce VS 2015 task coverage --- .../components/c_std_compile.py | 7 +-- .evergreen/config_generator/etc/distros.py | 21 ++------ .evergreen/generated_configs/tasks.yml | 50 ++++++++----------- .evergreen/scripts/compile-std.sh | 46 +++++++++++++++++ 4 files changed, 75 insertions(+), 49 deletions(-) diff --git a/.evergreen/config_generator/components/c_std_compile.py b/.evergreen/config_generator/components/c_std_compile.py index d228452aa75..83e8777ab3e 100644 --- a/.evergreen/config_generator/components/c_std_compile.py +++ b/.evergreen/config_generator/components/c_std_compile.py @@ -39,9 +39,10 @@ ('rhel94', 'gcc', None, [99, 11, 17, 23]), # GCC 11.4 (max: C2x) ('rhel95', 'gcc', None, [99, 11, 17, 23]), # GCC 11.5 (max: C2x) - ('windows-vsCurrent', 'vs2017x64', None, [99, 11, 17, 'latest']), # Max: C17, clatest (C2x) - ('windows-vsCurrent', 'vs2019x64', None, [99, 11, 17, 'latest']), # Max: C17, clatest (C2x) - ('windows-vsCurrent', 'vs2022x64', None, [99, 11, 17, 'latest']), # Max: C17, clatest (C2x) + ('windows-vsCurrent', 'vs2015x64', None, [99, 11, ]), # Max: C11 + ('windows-vsCurrent', 'vs2017x64', None, [99, 11, 17]), # Max: C17 + ('windows-vsCurrent', 'vs2019x64', None, [99, 11, 17]), # Max: C17 + ('windows-vsCurrent', 'vs2022x64', None, [99, 11, 17]), # Max: C17 ] # fmt: on # pylint: enable=line-too-long diff --git a/.evergreen/config_generator/etc/distros.py b/.evergreen/config_generator/etc/distros.py index 2168af0d95d..149d2bd6d7e 100644 --- a/.evergreen/config_generator/etc/distros.py +++ b/.evergreen/config_generator/etc/distros.py @@ -28,8 +28,6 @@ class Distro(BaseModel): '2019', '2022', 'vsCurrent', - 'vsCurrent2', - 'vsMulti', ] | None = None size: Literal['small', 'large'] | None = None arch: Literal['arm64', 'power', 'zseries'] | None = None @@ -165,20 +163,7 @@ def make_distro_str(distro_name, compiler, arch) -> str: distro_str = 'windows-' + \ 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' as 'vs' and append '-' if - # given in compiler string as 'vs', 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}') + distro_str = 'windows-2019-' + compiler_str else: distro_str = distro_name if compiler: @@ -192,6 +177,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', @@ -203,6 +190,8 @@ def to_cc(compiler): def to_platform(compiler): return { + 'vs2015x64': 'x64', + 'vs2015x86': 'Win32', 'vs2017x64': 'x64', 'vs2017x86': 'Win32', 'vs2019x64': 'x64', diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index df0e3413820..ea9d72f1d1f 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -5132,6 +5132,16 @@ tasks: CC: clang-12 CXX: clang++-12 C_STD_VERSION: 11 + - name: std-c11-windows-2019-vs2015-x64-compile + run_on: windows-vsCurrent-large + tags: [std-matrix, windows-vsCurrent, vs2015x64, compile, std-c11] + commands: + - func: find-cmake-latest + - func: std-compile + vars: + CMAKE_GENERATOR: Visual Studio 14 2015 + CMAKE_GENERATOR_PLATFORM: x64 + C_STD_VERSION: 11 - name: std-c11-windows-2019-vs2017-x64-compile run_on: windows-vsCurrent-large tags: [std-matrix, windows-vsCurrent, vs2017x64, compile, std-c11] @@ -5732,6 +5742,16 @@ tasks: CC: clang-12 CXX: clang++-12 C_STD_VERSION: 99 + - name: std-c99-windows-2019-vs2015-x64-compile + run_on: windows-vsCurrent-large + tags: [std-matrix, windows-vsCurrent, vs2015x64, compile, std-c99] + commands: + - func: find-cmake-latest + - func: std-compile + vars: + CMAKE_GENERATOR: Visual Studio 14 2015 + CMAKE_GENERATOR_PLATFORM: x64 + C_STD_VERSION: 99 - name: std-c99-windows-2019-vs2017-x64-compile run_on: windows-vsCurrent-large tags: [std-matrix, windows-vsCurrent, vs2017x64, compile, std-c99] @@ -5762,36 +5782,6 @@ tasks: CMAKE_GENERATOR: Visual Studio 17 2022 CMAKE_GENERATOR_PLATFORM: x64 C_STD_VERSION: 99 - - name: std-clatest-windows-2019-vs2017-x64-compile - run_on: windows-vsCurrent-large - tags: [std-matrix, windows-vsCurrent, vs2017x64, compile, std-clatest] - commands: - - func: find-cmake-latest - - func: std-compile - vars: - CMAKE_GENERATOR: Visual Studio 15 2017 - CMAKE_GENERATOR_PLATFORM: x64 - C_STD_VERSION: latest - - name: std-clatest-windows-2019-vs2019-x64-compile - run_on: windows-vsCurrent-large - tags: [std-matrix, windows-vsCurrent, vs2019x64, compile, std-clatest] - commands: - - func: find-cmake-latest - - func: std-compile - vars: - CMAKE_GENERATOR: Visual Studio 16 2019 - CMAKE_GENERATOR_PLATFORM: x64 - C_STD_VERSION: latest - - name: std-clatest-windows-2019-vs2022-x64-compile - run_on: windows-vsCurrent-large - tags: [std-matrix, windows-vsCurrent, vs2022x64, compile, std-clatest] - commands: - - func: find-cmake-latest - - func: std-compile - vars: - CMAKE_GENERATOR: Visual Studio 17 2022 - CMAKE_GENERATOR_PLATFORM: x64 - C_STD_VERSION: latest - name: tsan-sasl-cyrus-openssl-debian10-clang-compile run_on: debian10-large tags: [sanitizers-matrix-tsan, compile, debian10, clang, tsan, sasl-cyrus] diff --git a/.evergreen/scripts/compile-std.sh b/.evergreen/scripts/compile-std.sh index 13799be0912..5faed8bb575 100755 --- a/.evergreen/scripts/compile-std.sh +++ b/.evergreen/scripts/compile-std.sh @@ -116,6 +116,52 @@ if [[ "${CMAKE_GENERATOR:-}" =~ "Visual Studio" ]]; then export EnforceProcessCountAcrossBuilds=1 fi +echo "Checking requested C standard is supported..." +pushd "$(mktemp -d)" +cat >CMakeLists.txt <= version + else() + failure() # Both are old: latest < version + endif() + elseif(CMAKE_C_STANDARD_LATEST IN_LIST old_std_versions) + failure() # latest (old) < version (new) + elseif(c_std_version IN_LIST old_std_versions) + success() # latest (new) >= version (old) + elseif(CMAKE_C_STANDARD_LATEST GREATER_EQUAL c_std_version) + success() # Both are new: latest >= version. + else() + failure() # Both are new: latest < version. + endif() +endif() +DOC +"${cmake_binary:?}" -S . -B build +popd # "$(tmpfile -d)" +echo "Checking requested C standard is supported... done." + echo "Installing libmongocrypt..." # shellcheck source=.evergreen/scripts/compile-libmongocrypt.sh "${script_dir}/compile-libmongocrypt.sh" "${cmake_binary}" "${mongoc_dir}" "${install_dir}" &>output.txt || { From d64841b2da247c796c038f6b90e00ebf2656af1c Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Fri, 11 Apr 2025 12:08:38 -0500 Subject: [PATCH 2/2] VS 2017 does not support C17 --- .../config_generator/components/c_std_compile.py | 2 +- .evergreen/generated_configs/tasks.yml | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.evergreen/config_generator/components/c_std_compile.py b/.evergreen/config_generator/components/c_std_compile.py index 83e8777ab3e..53d7f767d34 100644 --- a/.evergreen/config_generator/components/c_std_compile.py +++ b/.evergreen/config_generator/components/c_std_compile.py @@ -40,7 +40,7 @@ ('rhel95', 'gcc', None, [99, 11, 17, 23]), # GCC 11.5 (max: C2x) ('windows-vsCurrent', 'vs2015x64', None, [99, 11, ]), # Max: C11 - ('windows-vsCurrent', 'vs2017x64', None, [99, 11, 17]), # Max: C17 + ('windows-vsCurrent', 'vs2017x64', None, [99, 11, ]), # Max: C11 ('windows-vsCurrent', 'vs2019x64', None, [99, 11, 17]), # Max: C17 ('windows-vsCurrent', 'vs2022x64', None, [99, 11, 17]), # Max: C17 ] diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index ea9d72f1d1f..f00b0bf6ca9 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -5362,16 +5362,6 @@ tasks: CC: clang-12 CXX: clang++-12 C_STD_VERSION: 17 - - name: std-c17-windows-2019-vs2017-x64-compile - run_on: windows-vsCurrent-large - tags: [std-matrix, windows-vsCurrent, vs2017x64, compile, std-c17] - commands: - - func: find-cmake-latest - - func: std-compile - vars: - CMAKE_GENERATOR: Visual Studio 15 2017 - CMAKE_GENERATOR_PLATFORM: x64 - C_STD_VERSION: 17 - name: std-c17-windows-2019-vs2019-x64-compile run_on: windows-vsCurrent-large tags: [std-matrix, windows-vsCurrent, vs2019x64, compile, std-c17]