Skip to content

Add C11 and C17 conformance coverage with VS 2017 #1294

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 8 commits into from
Jun 5, 2023
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
36 changes: 15 additions & 21 deletions .evergreen/config_generator/components/c_std_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@
# pylint: disable=line-too-long
# fmt: off
MATRIX = [
('archlinux', 'clang', None, [11, ]),
('debian81', 'clang', None, [11, ]),
('debian92', 'clang', None, [11, ]),
('ubuntu1604', 'clang', 'i686', [11, ]),
('ubuntu1604', 'clang', None, [11, ]),
('ubuntu1804', 'clang', 'i686', [11, ]),
('ubuntu1804', 'gcc', None, [11, ]),
('debian10', 'clang', None, [11, ]),
('debian10', 'gcc', None, [11, 17]),
('debian11', 'clang', None, [11, ]),
('debian11', 'gcc', None, [11, 17]),
('ubuntu2004', 'clang', None, [11, ]),
('ubuntu2004', 'gcc', None, [11, ]),
('archlinux', 'clang', None, [11, ]),
('debian81', 'clang', None, [11, ]),
('debian92', 'clang', None, [11, ]),
('ubuntu1604', 'clang', 'i686', [11, ]),
('ubuntu1604', 'clang', None, [11, ]),
('ubuntu1804', 'clang', 'i686', [11, ]),
('ubuntu1804', 'gcc', None, [11, ]),
('debian10', 'clang', None, [11, ]),
('debian10', 'gcc', None, [11, 17]),
('debian11', 'clang', None, [11, ]),
('debian11', 'gcc', None, [11, 17]),
('ubuntu2004', 'clang', None, [11, ]),
('ubuntu2004', 'gcc', None, [11, ]),
('windows-vsCurrent', 'vs2017x64', None, [11, 17]),
]
# fmt: on
# pylint: enable=line-too-long
Expand Down Expand Up @@ -72,14 +73,7 @@ def tasks():
distro_str = make_distro_str(distro_name, compiler, arch)

for std in stds:
with_std = {}

if std >= 17:
# CMake 3.21 or newer is required to use CMAKE_C_STANDARD to
# specify C17 or newer.
with_std = {'CFLAGS': f'-std=c{std}'}
else:
with_std = {'C_STD_VERSION': std}
with_std = {'C_STD_VERSION': std}

task_name = f'std-c{std}-{distro_str}-compile'

Expand Down
6 changes: 3 additions & 3 deletions .evergreen/config_generator/components/cse/openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
('ubuntu1804-arm64', 'gcc', None, ['cyrus']),
('ubuntu1804', 'gcc', None, ['cyrus']),
('ubuntu2004', 'gcc', None, ['cyrus']),
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
]

# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
Expand All @@ -35,13 +35,13 @@

('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),

# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
('rhel83-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
]
# fmt: on
# pylint: enable=line-too-long
Expand Down
6 changes: 3 additions & 3 deletions .evergreen/config_generator/components/cse/winssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
# fmt: off
COMPILE_MATRIX = [
('windows-64-vs2015', 'vs2015x64', None, ['cyrus']),
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
]

# TODO (CDRIVER-3789): test cse with the 'sharded' topology.
TEST_MATRIX = [
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['4.2', '4.4', '5.0']),

# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
]
# fmt: on
# pylint: enable=line-too-long
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/config_generator/components/sasl/nossl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
('macos-1014', 'clang', None, ['off']),
('ubuntu1604', 'gcc', None, ['off']),
('ubuntu1804', 'gcc', None, ['off']),
('windows-64-vs2017', 'vs2017x64', None, ['off']),
('windows-vsCurrent', 'vs2017x64', None, ['off']),
]

TEST_MATRIX = [
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/config_generator/components/sasl/openssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
('ubuntu1804-arm64', 'gcc', None, ['cyrus']),
('ubuntu1804', 'gcc', None, ['cyrus']),
('ubuntu2004', 'gcc', None, ['cyrus']),
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
]

TEST_MATRIX = [
('rhel81-power8', 'gcc', None, 'cyrus', ['auth'], ['server', ], [ '4.2', '4.4', '5.0', '6.0', 'latest']),
('rhel83-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', ], [ '5.0', '6.0', 'latest']),
('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', ], [ '4.2', '4.4', '5.0', '6.0', 'latest']),
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['4.0', '4.2', '4.4', '5.0', '6.0', 'latest']),
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', ], [ 'latest']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', ], [ 'latest']),

# Test ARM64 + 4.0 on Ubuntu 16.04, as MongoDB server does not produce
# downloads for Ubuntu 18.04 arm64.
Expand Down
14 changes: 7 additions & 7 deletions .evergreen/config_generator/components/sasl/winssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
('windows-64-vs2013', 'vs2013x86', None, ['off', ]),
('windows-64-vs2015', 'vs2015x64', None, [ 'cyrus', ]),
('windows-64-vs2015', 'vs2015x86', None, ['off', ]),
('windows-64-vs2017', 'mingw', None, [ 'sspi']),
('windows-64-vs2017', 'vs2017x64', None, ['off', 'cyrus', 'sspi']),
('windows-64-vs2017', 'vs2017x86', None, ['off', 'sspi']),
('windows-vsCurrent', 'mingw', None, [ 'sspi']),
('windows-vsCurrent', 'vs2017x64', None, ['off', 'cyrus', 'sspi']),
('windows-vsCurrent', 'vs2017x86', None, ['off', 'sspi']),
]

TEST_MATRIX = [
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['3.6', '4.0', '4.2', '4.4', '5.0', '6.0', 'latest']),
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server'], ['3.6', '4.0', '4.2', '4.4', '5.0', '6.0', 'latest']),

('windows-64-vs2017', 'mingw', None, 'sspi', ['auth'], ['server'], ['latest']),
('windows-64-vs2017', 'vs2017x64', None, 'sspi', ['auth'], ['server'], ['latest']),
('windows-64-vs2017', 'vs2017x86', None, 'sspi', ['auth'], ['server'], ['latest']),
('windows-vsCurrent', 'mingw', None, 'sspi', ['auth'], ['server'], ['latest']),
('windows-vsCurrent', 'vs2017x64', None, 'sspi', ['auth'], ['server'], ['latest']),
('windows-vsCurrent', 'vs2017x86', None, 'sspi', ['auth'], ['server'], ['latest']),
]
# fmt: on
# pylint: enable=line-too-long
Expand Down
25 changes: 20 additions & 5 deletions .evergreen/config_generator/etc/distros.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def validate_os_ver(cls, value):
]

RHEL_DISTROS = [
Distro(name='rhel62-large', os='rhel', os_type='linux', os_ver='6.2', size='large'),
Distro(name='rhel62-small', os='rhel', os_type='linux', os_ver='6.2', size='small'),
Distro(name='rhel70-large', os='rhel', os_type='linux', os_ver='7.0', size='large'),
Distro(name='rhel70-small', os='rhel', os_type='linux', os_ver='7.0', size='small'),
Distro(name='rhel76-large', os='rhel', os_type='linux', os_ver='7.6', size='large'),
Expand Down Expand Up @@ -167,8 +165,8 @@ def validate_os_ver(cls, value):
Distro(name='windows-vsCurrent-2022-large', os='windows', os_type='windows', os_ver='2022', vs_ver='vsCurrent', size='large'),
Distro(name='windows-vsCurrent-2022-small', os='windows', os_type='windows', os_ver='2022', vs_ver='vsCurrent', size='small'),

Distro(name='windows-vsCurrent-large', os='windows', os_type='windows', vs_ver='vsCurrent', size='large'),
Distro(name='windows-vsCurrent-small', os='windows', os_type='windows', vs_ver='vsCurrent', size='small'),
Distro(name='windows-vsCurrent-large', os='windows', os_type='windows', vs_ver='vsCurrent', size='large'), # Windows Server 2019
Distro(name='windows-vsCurrent-small', os='windows', os_type='windows', vs_ver='vsCurrent', size='small'), # Windows Server 2019

Distro(name='windows-vsCurrent2-large', os='windows', os_type='windows', vs_ver='vsCurrent2', size='large'),
Distro(name='windows-vsCurrent2-small', os='windows', os_type='windows', vs_ver='vsCurrent2', size='small'),
Expand Down Expand Up @@ -221,7 +219,24 @@ def find_small_distro(name):


def make_distro_str(distro_name, compiler, arch):
if distro_name.startswith('windows-64-vs'):
if distro_name.startswith('windows-vsCurrent'):
# Rename `windows-vsCurrent-*` distros to `windows-<year>` where`<year>`
# is the Windows Server version used by the distro, e.g.:
# ('windows-vsCurrent-2022', 'vs2017x64', None) -> windows-2022-vs2017-x64
# ('windows-vsCurrent-2022', 'mingw', None) -> windows-2022-mingw
# ('windows-vsCurrent', 'vs2017x64', None) -> windows-2019-vs2017-x64
# ('windows-vsCurrent', 'mingw', None) -> windows-2019-mingw
maybe_arch = compiler[len('vs20XY'):]
if maybe_arch in ('x86', 'x64'):
compiler_str = compiler[:-len(maybe_arch)] + '-' + maybe_arch
else:
compiler_str = compiler
if distro_name.startswith('windows-vsCurrent-'):
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
Expand Down
3 changes: 0 additions & 3 deletions .evergreen/etc/skip-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
/mongohouse/listDatabases # CDRIVER-4333
/mongohouse/runCommand # CDRIVER-4333

/versioned_api/crud-api-version-1-strict/"estimatedDocumentCount appends declared API version" # (CDRIVER-4334) error: expected success, but got error: stage $collStats is not allowed with 'apiStrict: true' in API Version 1 (observed on rhel62 variant)
/versioned_api/crud-api-version-1-strict/"find and getMore append API version" # (CDRIVER-4334) error: expected result, but got error: Cannot pass in API parameter field apiVersion
/versioned_api/crud-api-version-1/"find and getMore append API version" # (CDRIVER-4334) error: expected result, but got error: Cannot pass in API parameter field apiVersion
/versioned_api/transaction-handling/"All commands in a transaction declare an API version" # (CDRIVER-4335) API parameters are only allowed in the first command of a multi-document transaction
/versioned_api/test-commands-deprecation-errors # (CDRIVER-4336) Could not establish stream for node 127.0.0.1:8000: [TLS handshake failed: Connection timed out calling hello on '127.0.0.1:8000']
/versioned_api/test-commands-strict-mode # (CDRIVER-4336) Could not establish stream for node 127.0.0.1:8000: [TLS handshake failed: Connection timed out calling hello on '127.0.0.1:8000']
Expand Down
32 changes: 17 additions & 15 deletions .evergreen/generated_configs/legacy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1718,11 +1718,13 @@ tasks:
shell: bash
script: |-
set -o errexit
export distro_id='${distro_id}' # Required by find_cmake_latest.
. .evergreen/scripts/find-cmake-latest.sh
cmake_binary="$(find_cmake_latest)"
# Compile test-awsauth. Disable unnecessary dependencies since test-awsauth is copied to a remote Ubuntu 18.04 ECS cluster for testing, which may not have all dependent libraries.
. .evergreen/scripts/find-cmake.sh
export CC='${CC}'
$CMAKE -DENABLE_SASL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZSTD=OFF -DENABLE_CLIENT_SIDE_ENCRYPTION=OFF .
$CMAKE --build . --target test-awsauth
"$cmake_binary" -DENABLE_SASL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZSTD=OFF -DENABLE_CLIENT_SIDE_ENCRYPTION=OFF .
"$cmake_binary" --build . --target test-awsauth
- func: upload-build
- name: test-aws-openssl-regular-latest
depends_on:
Expand Down Expand Up @@ -9212,16 +9214,16 @@ buildvariants:
- macos-1014
- name: link-with-cmake-windows
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: link-with-cmake-windows-ssl
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: link-with-cmake-windows-snappy
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: link-with-cmake-mingw
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: link-with-pkg-config
distros:
- ubuntu1804-test
Expand All @@ -9232,7 +9234,7 @@ buildvariants:
- link-with-bson
- name: link-with-bson-windows
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: link-with-bson-mac
distros:
- macos-1014
Expand All @@ -9243,10 +9245,10 @@ buildvariants:
- install-uninstall-check
- name: install-uninstall-check-mingw
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: install-uninstall-check-msvc
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- debug-compile-with-warnings
- name: build-and-test-with-toolchain
distros:
Expand Down Expand Up @@ -9482,15 +9484,15 @@ buildvariants:
display_name: Windows (i686) (VS 2017)
expansions:
CC: Visual Studio 15 2017
run_on: windows-64-vs2017-test
run_on: windows-vsCurrent-large
tasks:
- debug-compile-nosasl-nossl
- .latest .nossl .nosasl
- name: windows-2017
display_name: Windows (VS 2017)
expansions:
CC: Visual Studio 15 2017 Win64
run_on: windows-64-vs2017-test
run_on: windows-vsCurrent-large
tasks:
- debug-compile-nosasl-nossl
- debug-compile-nosasl-openssl
Expand Down Expand Up @@ -9551,7 +9553,7 @@ buildvariants:
display_name: MinGW-W64 (Windows Server 2016)
expansions:
CC: mingw
run_on: windows-64-vs2017-test
run_on: windows-vsCurrent-large
tasks:
- debug-compile-nosasl-nossl
- .latest .nossl .nosasl .server
Expand Down Expand Up @@ -9653,14 +9655,14 @@ buildvariants:
- macos-1014
- name: debug-compile-nosasl-winssl
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: .ocsp-openssl
- name: .ocsp-darwinssl
distros:
- macos-1014
- name: .ocsp-winssl
distros:
- windows-64-vs2017-test
- windows-vsCurrent-large
- name: debug-compile-nosasl-openssl-1.0.1
- name: .ocsp-openssl-1.0.1
batchtime: 10080
Expand Down
Loading