Skip to content

Commit 3ca6cf3

Browse files
authored
Add C11 and C17 conformance coverage with VS 2017 (#1294)
* Revert incorrect invocation of find_cmake_latest on source * Migrate tasks on windows-64-vs2017 to windows-vsCurrent * Use latest CMake in debug-compile-aws for VS 2022 support * Ensure libmongocrypt compilation output is printed on failure * Cherry-pick VS 2022 ICE patch in libmongocrypt * CDRIVER-4334 Remove rhel62 from distro list * CDRIVER-4549 Add VS 2017 to std-matrix * Replace `make` -> `cmake --build`
1 parent e0e3a49 commit 3ca6cf3

23 files changed

+331
-268
lines changed

.evergreen/config_generator/components/c_std_compile.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@
1616
# pylint: disable=line-too-long
1717
# fmt: off
1818
MATRIX = [
19-
('archlinux', 'clang', None, [11, ]),
20-
('debian81', 'clang', None, [11, ]),
21-
('debian92', 'clang', None, [11, ]),
22-
('ubuntu1604', 'clang', 'i686', [11, ]),
23-
('ubuntu1604', 'clang', None, [11, ]),
24-
('ubuntu1804', 'clang', 'i686', [11, ]),
25-
('ubuntu1804', 'gcc', None, [11, ]),
26-
('debian10', 'clang', None, [11, ]),
27-
('debian10', 'gcc', None, [11, 17]),
28-
('debian11', 'clang', None, [11, ]),
29-
('debian11', 'gcc', None, [11, 17]),
30-
('ubuntu2004', 'clang', None, [11, ]),
31-
('ubuntu2004', 'gcc', None, [11, ]),
19+
('archlinux', 'clang', None, [11, ]),
20+
('debian81', 'clang', None, [11, ]),
21+
('debian92', 'clang', None, [11, ]),
22+
('ubuntu1604', 'clang', 'i686', [11, ]),
23+
('ubuntu1604', 'clang', None, [11, ]),
24+
('ubuntu1804', 'clang', 'i686', [11, ]),
25+
('ubuntu1804', 'gcc', None, [11, ]),
26+
('debian10', 'clang', None, [11, ]),
27+
('debian10', 'gcc', None, [11, 17]),
28+
('debian11', 'clang', None, [11, ]),
29+
('debian11', 'gcc', None, [11, 17]),
30+
('ubuntu2004', 'clang', None, [11, ]),
31+
('ubuntu2004', 'gcc', None, [11, ]),
32+
('windows-vsCurrent', 'vs2017x64', None, [11, 17]),
3233
]
3334
# fmt: on
3435
# pylint: enable=line-too-long
@@ -72,14 +73,7 @@ def tasks():
7273
distro_str = make_distro_str(distro_name, compiler, arch)
7374

7475
for std in stds:
75-
with_std = {}
76-
77-
if std >= 17:
78-
# CMake 3.21 or newer is required to use CMAKE_C_STANDARD to
79-
# specify C17 or newer.
80-
with_std = {'CFLAGS': f'-std=c{std}'}
81-
else:
82-
with_std = {'C_STD_VERSION': std}
76+
with_std = {'C_STD_VERSION': std}
8377

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

.evergreen/config_generator/components/cse/openssl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
('ubuntu1804-arm64', 'gcc', None, ['cyrus']),
2626
('ubuntu1804', 'gcc', None, ['cyrus']),
2727
('ubuntu2004', 'gcc', None, ['cyrus']),
28-
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
28+
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
2929
]
3030

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

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

4040
# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
4141
('ubuntu1804', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
4242
('rhel83-zseries', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
4343
('ubuntu1804-arm64', 'gcc', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
44-
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
44+
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica'], ['6.0', 'latest']),
4545
]
4646
# fmt: on
4747
# pylint: enable=line-too-long

.evergreen/config_generator/components/cse/winssl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# fmt: off
1616
COMPILE_MATRIX = [
1717
('windows-64-vs2015', 'vs2015x64', None, ['cyrus']),
18-
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
18+
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
1919
]
2020

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

2525
# Test 6.0+ with a replica set since Queryable Encryption does not support the 'server' topology.
26-
('windows-64-vs2017', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
26+
('windows-vsCurrent', 'vs2017x64', None, 'cyrus', ['auth'], ['server', 'replica' ], ['6.0', 'latest']),
2727
]
2828
# fmt: on
2929
# pylint: enable=line-too-long

.evergreen/config_generator/components/sasl/nossl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
('macos-1014', 'clang', None, ['off']),
1919
('ubuntu1604', 'gcc', None, ['off']),
2020
('ubuntu1804', 'gcc', None, ['off']),
21-
('windows-64-vs2017', 'vs2017x64', None, ['off']),
21+
('windows-vsCurrent', 'vs2017x64', None, ['off']),
2222
]
2323

2424
TEST_MATRIX = [

.evergreen/config_generator/components/sasl/openssl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
('ubuntu1804-arm64', 'gcc', None, ['cyrus']),
3535
('ubuntu1804', 'gcc', None, ['cyrus']),
3636
('ubuntu2004', 'gcc', None, ['cyrus']),
37-
('windows-64-vs2017', 'vs2017x64', None, ['cyrus']),
37+
('windows-vsCurrent', 'vs2017x64', None, ['cyrus']),
3838
]
3939

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

4747
# Test ARM64 + 4.0 on Ubuntu 16.04, as MongoDB server does not produce
4848
# downloads for Ubuntu 18.04 arm64.

.evergreen/config_generator/components/sasl/winssl.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
('windows-64-vs2013', 'vs2013x86', None, ['off', ]),
2020
('windows-64-vs2015', 'vs2015x64', None, [ 'cyrus', ]),
2121
('windows-64-vs2015', 'vs2015x86', None, ['off', ]),
22-
('windows-64-vs2017', 'mingw', None, [ 'sspi']),
23-
('windows-64-vs2017', 'vs2017x64', None, ['off', 'cyrus', 'sspi']),
24-
('windows-64-vs2017', 'vs2017x86', None, ['off', 'sspi']),
22+
('windows-vsCurrent', 'mingw', None, [ 'sspi']),
23+
('windows-vsCurrent', 'vs2017x64', None, ['off', 'cyrus', 'sspi']),
24+
('windows-vsCurrent', 'vs2017x86', None, ['off', 'sspi']),
2525
]
2626

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

30-
('windows-64-vs2017', 'mingw', None, 'sspi', ['auth'], ['server'], ['latest']),
31-
('windows-64-vs2017', 'vs2017x64', None, 'sspi', ['auth'], ['server'], ['latest']),
32-
('windows-64-vs2017', 'vs2017x86', None, 'sspi', ['auth'], ['server'], ['latest']),
30+
('windows-vsCurrent', 'mingw', None, 'sspi', ['auth'], ['server'], ['latest']),
31+
('windows-vsCurrent', 'vs2017x64', None, 'sspi', ['auth'], ['server'], ['latest']),
32+
('windows-vsCurrent', 'vs2017x86', None, 'sspi', ['auth'], ['server'], ['latest']),
3333
]
3434
# fmt: on
3535
# pylint: enable=line-too-long

.evergreen/config_generator/etc/distros.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def validate_os_ver(cls, value):
7272
]
7373

7474
RHEL_DISTROS = [
75-
Distro(name='rhel62-large', os='rhel', os_type='linux', os_ver='6.2', size='large'),
76-
Distro(name='rhel62-small', os='rhel', os_type='linux', os_ver='6.2', size='small'),
7775
Distro(name='rhel70-large', os='rhel', os_type='linux', os_ver='7.0', size='large'),
7876
Distro(name='rhel70-small', os='rhel', os_type='linux', os_ver='7.0', size='small'),
7977
Distro(name='rhel76-large', os='rhel', os_type='linux', os_ver='7.6', size='large'),
@@ -167,8 +165,8 @@ def validate_os_ver(cls, value):
167165
Distro(name='windows-vsCurrent-2022-large', os='windows', os_type='windows', os_ver='2022', vs_ver='vsCurrent', size='large'),
168166
Distro(name='windows-vsCurrent-2022-small', os='windows', os_type='windows', os_ver='2022', vs_ver='vsCurrent', size='small'),
169167

170-
Distro(name='windows-vsCurrent-large', os='windows', os_type='windows', vs_ver='vsCurrent', size='large'),
171-
Distro(name='windows-vsCurrent-small', os='windows', os_type='windows', vs_ver='vsCurrent', size='small'),
168+
Distro(name='windows-vsCurrent-large', os='windows', os_type='windows', vs_ver='vsCurrent', size='large'), # Windows Server 2019
169+
Distro(name='windows-vsCurrent-small', os='windows', os_type='windows', vs_ver='vsCurrent', size='small'), # Windows Server 2019
172170

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

222220

223221
def make_distro_str(distro_name, compiler, arch):
224-
if distro_name.startswith('windows-64-vs'):
222+
if distro_name.startswith('windows-vsCurrent'):
223+
# Rename `windows-vsCurrent-*` distros to `windows-<year>` where`<year>`
224+
# is the Windows Server version used by the distro, e.g.:
225+
# ('windows-vsCurrent-2022', 'vs2017x64', None) -> windows-2022-vs2017-x64
226+
# ('windows-vsCurrent-2022', 'mingw', None) -> windows-2022-mingw
227+
# ('windows-vsCurrent', 'vs2017x64', None) -> windows-2019-vs2017-x64
228+
# ('windows-vsCurrent', 'mingw', None) -> windows-2019-mingw
229+
maybe_arch = compiler[len('vs20XY'):]
230+
if maybe_arch in ('x86', 'x64'):
231+
compiler_str = compiler[:-len(maybe_arch)] + '-' + maybe_arch
232+
else:
233+
compiler_str = compiler
234+
if distro_name.startswith('windows-vsCurrent-'):
235+
distro_str = 'windows-' + \
236+
distro_name[len('windows-vsCurrent-'):] + f'-{compiler_str}'
237+
else:
238+
distro_str = 'windows-2019' + f'-{compiler_str}'
239+
elif distro_name.startswith('windows-64-vs'):
225240
# Abbreviate 'windows-64-vs<type>' as 'vs<type>' and append '-<arch>' if
226241
# given in compiler string as 'vs<type><arch>', e.g.:
227242
# ('windows-64-vs2017', 'vs2017x64', None) -> vs2017-x64

.evergreen/etc/skip-tests.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
/mongohouse/listDatabases # CDRIVER-4333
2828
/mongohouse/runCommand # CDRIVER-4333
2929

30-
/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)
31-
/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
32-
/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
3330
/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
3431
/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']
3532
/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']

.evergreen/generated_configs/legacy-config.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,11 +1718,13 @@ tasks:
17181718
shell: bash
17191719
script: |-
17201720
set -o errexit
1721+
export distro_id='${distro_id}' # Required by find_cmake_latest.
1722+
. .evergreen/scripts/find-cmake-latest.sh
1723+
cmake_binary="$(find_cmake_latest)"
17211724
# 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.
1722-
. .evergreen/scripts/find-cmake.sh
17231725
export CC='${CC}'
1724-
$CMAKE -DENABLE_SASL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZSTD=OFF -DENABLE_CLIENT_SIDE_ENCRYPTION=OFF .
1725-
$CMAKE --build . --target test-awsauth
1726+
"$cmake_binary" -DENABLE_SASL=OFF -DENABLE_SNAPPY=OFF -DENABLE_ZSTD=OFF -DENABLE_CLIENT_SIDE_ENCRYPTION=OFF .
1727+
"$cmake_binary" --build . --target test-awsauth
17261728
- func: upload-build
17271729
- name: test-aws-openssl-regular-latest
17281730
depends_on:
@@ -9212,16 +9214,16 @@ buildvariants:
92129214
- macos-1014
92139215
- name: link-with-cmake-windows
92149216
distros:
9215-
- windows-64-vs2017-test
9217+
- windows-vsCurrent-large
92169218
- name: link-with-cmake-windows-ssl
92179219
distros:
9218-
- windows-64-vs2017-test
9220+
- windows-vsCurrent-large
92199221
- name: link-with-cmake-windows-snappy
92209222
distros:
9221-
- windows-64-vs2017-test
9223+
- windows-vsCurrent-large
92229224
- name: link-with-cmake-mingw
92239225
distros:
9224-
- windows-64-vs2017-test
9226+
- windows-vsCurrent-large
92259227
- name: link-with-pkg-config
92269228
distros:
92279229
- ubuntu1804-test
@@ -9232,7 +9234,7 @@ buildvariants:
92329234
- link-with-bson
92339235
- name: link-with-bson-windows
92349236
distros:
9235-
- windows-64-vs2017-test
9237+
- windows-vsCurrent-large
92369238
- name: link-with-bson-mac
92379239
distros:
92389240
- macos-1014
@@ -9243,10 +9245,10 @@ buildvariants:
92439245
- install-uninstall-check
92449246
- name: install-uninstall-check-mingw
92459247
distros:
9246-
- windows-64-vs2017-test
9248+
- windows-vsCurrent-large
92479249
- name: install-uninstall-check-msvc
92489250
distros:
9249-
- windows-64-vs2017-test
9251+
- windows-vsCurrent-large
92509252
- debug-compile-with-warnings
92519253
- name: build-and-test-with-toolchain
92529254
distros:
@@ -9482,15 +9484,15 @@ buildvariants:
94829484
display_name: Windows (i686) (VS 2017)
94839485
expansions:
94849486
CC: Visual Studio 15 2017
9485-
run_on: windows-64-vs2017-test
9487+
run_on: windows-vsCurrent-large
94869488
tasks:
94879489
- debug-compile-nosasl-nossl
94889490
- .latest .nossl .nosasl
94899491
- name: windows-2017
94909492
display_name: Windows (VS 2017)
94919493
expansions:
94929494
CC: Visual Studio 15 2017 Win64
9493-
run_on: windows-64-vs2017-test
9495+
run_on: windows-vsCurrent-large
94949496
tasks:
94959497
- debug-compile-nosasl-nossl
94969498
- debug-compile-nosasl-openssl
@@ -9551,7 +9553,7 @@ buildvariants:
95519553
display_name: MinGW-W64 (Windows Server 2016)
95529554
expansions:
95539555
CC: mingw
9554-
run_on: windows-64-vs2017-test
9556+
run_on: windows-vsCurrent-large
95559557
tasks:
95569558
- debug-compile-nosasl-nossl
95579559
- .latest .nossl .nosasl .server
@@ -9653,14 +9655,14 @@ buildvariants:
96539655
- macos-1014
96549656
- name: debug-compile-nosasl-winssl
96559657
distros:
9656-
- windows-64-vs2017-test
9658+
- windows-vsCurrent-large
96579659
- name: .ocsp-openssl
96589660
- name: .ocsp-darwinssl
96599661
distros:
96609662
- macos-1014
96619663
- name: .ocsp-winssl
96629664
distros:
9663-
- windows-64-vs2017-test
9665+
- windows-vsCurrent-large
96649666
- name: debug-compile-nosasl-openssl-1.0.1
96659667
- name: .ocsp-openssl-1.0.1
96669668
batchtime: 10080

0 commit comments

Comments
 (0)