Skip to content

CDRIVER-5939 reintroduce VS 2015 task coverage #1991

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 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions .evergreen/config_generator/components/c_std_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ]), # Max: C11
('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
Expand Down
21 changes: 5 additions & 16 deletions .evergreen/config_generator/etc/distros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<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}')
distro_str = 'windows-2019-' + compiler_str
else:
distro_str = distro_name
if compiler:
Expand All @@ -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',
Expand All @@ -203,6 +190,8 @@ def to_cc(compiler):

def to_platform(compiler):
return {
'vs2015x64': 'x64',
'vs2015x86': 'Win32',
'vs2017x64': 'x64',
'vs2017x86': 'Win32',
'vs2019x64': 'x64',
Expand Down
60 changes: 20 additions & 40 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -5352,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]
Expand Down Expand Up @@ -5732,6 +5732,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]
Expand Down Expand Up @@ -5762,36 +5772,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]
Expand Down
46 changes: 46 additions & 0 deletions .evergreen/scripts/compile-std.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<DOC
cmake_minimum_required(VERSION 3.30)
project(c_standard_latest LANGUAGES C)
set(c_std_version "${C_STD_VERSION:?}")
if(c_std_version STREQUAL "latest") # Special-case MSVC's /std:clatest flag.
include(CheckCCompilerFlag)
check_c_compiler_flag("/std:clatest" cflag_std_clatest)
if(cflag_std_clatest)
message(STATUS "/std:clatest is supported")
else()
message(FATAL_ERROR "/std:clatest is not supported")
endif()
else()
# Ensure "old" standard versions are not compared as "newer" than C11/C17/etc.
set(old_std_versions 90 99)

macro(success)
message(STATUS "Latest C standard \${CMAKE_C_STANDARD_LATEST} is newer than \${c_std_version}")
endmacro()
macro(failure)
message(FATAL_ERROR "Latest C standard \${CMAKE_C_STANDARD_LATEST} is older than \${c_std_version}")
endmacro()

if (CMAKE_C_STANDARD_LATEST IN_LIST old_std_versions AND c_std_standard IN_LIST old_std_versions)
if (CMAKE_C_STANDARD_LATEST GREATER_EQUAL c_std_version)
success() # Both are old: latest >= 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 || {
Expand Down