Skip to content

Commit 641c4e4

Browse files
committed
CXX-3187 Extend ABI stability tasks to C++20 and C++23
1 parent 021528e commit 641c4e4

File tree

8 files changed

+404
-73
lines changed

8 files changed

+404
-73
lines changed

.evergreen/config_generator/components/abi_stability.py

Lines changed: 59 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@
99
from shrub.v3.evg_task import EvgTask, EvgTaskRef
1010
from shrub.v3.evg_task_group import EvgTaskGroup
1111

12+
from itertools import product
13+
1214

1315
TAG = 'abi-stability'
1416

1517

1618
# pylint: disable=line-too-long
1719
# fmt: off
1820
MATRIX = [
19-
('polyfill', 11),
20-
('stdlib', 17),
21+
('impls', 11),
22+
('impls', 17),
23+
('stdlib', 17),
24+
('stdlib', 20),
25+
('stdlib', 23),
2126
]
2227
# fmt: on
2328
# pylint: enable=line-too-long
@@ -134,56 +139,82 @@ def functions():
134139

135140

136141
def tasks():
137-
distro_name = 'ubuntu2204'
138-
distro = find_large_distro(distro_name)
139-
140-
return [
141-
EvgTask(
142-
name=func.name,
143-
tags=[TAG, func.name, distro_name],
144-
run_on=distro.name,
145-
commands=[func.call()],
142+
funcs = [AbiComplianceCheck, Abidiff, AbiProhibitedSymbols]
143+
144+
tasks = []
145+
146+
for func, (polyfill, cxx_standard) in product(funcs, MATRIX):
147+
if func is Abidiff:
148+
distro_name = 'ubuntu2204' # Clang 12, libabigail is not available on RHEL distros.
149+
else:
150+
distro_name = 'rhel9-latest' # Clang 15.
151+
152+
distro = find_large_distro(distro_name)
153+
154+
tasks.append(
155+
EvgTask(
156+
name=f'{func.name}-{polyfill}-cxx{cxx_standard}',
157+
tags=[TAG, distro_name, func.name, polyfill, f'cxx{cxx_standard}'],
158+
run_on=distro.name,
159+
commands=[
160+
func.call(
161+
vars={
162+
'cxx_standard': f'{cxx_standard}',
163+
'polyfill': polyfill,
164+
}
165+
)
166+
],
167+
)
146168
)
147-
for func in [AbiComplianceCheck, Abidiff, AbiProhibitedSymbols]
148-
]
169+
170+
return tasks
149171

150172

151173
def task_groups():
152174
return [
153175
EvgTaskGroup(
154-
name=f'tg-{TAG}',
176+
name=f'tg-{TAG}-{polyfill}-cxx{cxx_standard}',
155177
max_hosts=-1,
156178
setup_group_can_fail_task=True,
157179
setup_task=[
158180
git_get_project(directory='mongo-cxx-driver'),
159181
InstallCDriver.call(),
160182
bash_exec(
161-
include_expansions_in_env=['cxx_standard'],
183+
env={
184+
'cxx_standard': f'{cxx_standard}',
185+
'polyfill': polyfill,
186+
},
187+
include_expansions_in_env=['distro_id'],
162188
script='mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh'
163189
),
190+
s3_put(
191+
command_type=EvgCommandType.SETUP,
192+
aws_key='${aws_key}',
193+
aws_secret='${aws_secret}',
194+
bucket='mciuploads',
195+
content_type='text/plain',
196+
display_name='ABI Stability Setup: ',
197+
local_files_include_filter='*.log',
198+
permissions='public-read',
199+
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/',
200+
),
164201
],
165-
tasks=[f'.{TAG}'],
202+
tasks=[f'.{TAG} .{polyfill} .cxx{cxx_standard}'],
166203
teardown_task_can_fail_task=True,
167204
teardown_task=[bash_exec(script='rm -rf *'),],
168205
)
206+
for polyfill, cxx_standard in MATRIX
169207
]
170208

171209

172210
def variants():
173211
return [
174212
BuildVariant(
175-
name=f'abi-stability-{name}',
176-
display_name=f'ABI Stability Checks ({name})',
177-
expansions={
178-
'cxx_standard': f'{cxx_standard}', # Use a polyfill library.
179-
},
180-
tasks=[EvgTaskRef(name='tg-abi-stability')],
181-
display_tasks=[
182-
DisplayTask(
183-
name=f'ABI Stability Checks ({name})',
184-
execution_tasks=[f'.{TAG}'],
185-
)
213+
name=f'abi-stability',
214+
display_name=f'ABI Stability Checks',
215+
tasks=[
216+
EvgTaskRef(name=f'tg-{TAG}-{polyfill}-cxx{cxx_standard}')
217+
for polyfill, cxx_standard in MATRIX
186218
],
187219
)
188-
for name, cxx_standard in MATRIX
189220
]

.evergreen/config_generator/etc/distros.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def validate_os_ver(cls, value):
8282

8383
Distro(name='rhel8-latest-large', os='rhel', os_type='linux', os_ver='latest', size='large'),
8484
Distro(name='rhel8-latest-small', os='rhel', os_type='linux', os_ver='latest', size='small'),
85+
Distro(name='rhel9-latest-large', os='rhel', os_type='linux', os_ver='latest', size='large'),
86+
Distro(name='rhel9-latest-small', os='rhel', os_type='linux', os_ver='latest', size='small'),
8587
]
8688

8789
RHEL_ARM64_DISTROS = [

.evergreen/generated_configs/task_groups.yml

Lines changed: 177 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
task_groups:
2-
- name: tg-abi-stability
2+
- name: tg-abi-stability-impls-cxx11
33
max_hosts: -1
44
setup_group_can_fail_task: true
55
setup_task:
@@ -10,13 +10,187 @@ task_groups:
1010
- command: subprocess.exec
1111
params:
1212
binary: bash
13+
env:
14+
cxx_standard: "11"
15+
polyfill: impls
16+
include_expansions_in_env:
17+
- distro_id
18+
args:
19+
- -c
20+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
21+
- command: s3.put
22+
type: setup
23+
params:
24+
display_name: "ABI Stability Setup: "
25+
aws_key: ${aws_key}
26+
aws_secret: ${aws_secret}
27+
bucket: mciuploads
28+
content_type: text/plain
29+
local_files_include_filter: "*.log"
30+
permissions: public-read
31+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
32+
tasks:
33+
- .abi-stability .impls .cxx11
34+
teardown_task:
35+
- command: subprocess.exec
36+
params:
37+
binary: bash
38+
args:
39+
- -c
40+
- rm -rf *
41+
teardown_task_can_fail_task: true
42+
- name: tg-abi-stability-impls-cxx17
43+
max_hosts: -1
44+
setup_group_can_fail_task: true
45+
setup_task:
46+
- command: git.get_project
47+
params:
48+
directory: mongo-cxx-driver
49+
- func: install_c_driver
50+
- command: subprocess.exec
51+
params:
52+
binary: bash
53+
env:
54+
cxx_standard: "17"
55+
polyfill: impls
56+
include_expansions_in_env:
57+
- distro_id
58+
args:
59+
- -c
60+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
61+
- command: s3.put
62+
type: setup
63+
params:
64+
display_name: "ABI Stability Setup: "
65+
aws_key: ${aws_key}
66+
aws_secret: ${aws_secret}
67+
bucket: mciuploads
68+
content_type: text/plain
69+
local_files_include_filter: "*.log"
70+
permissions: public-read
71+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
72+
tasks:
73+
- .abi-stability .impls .cxx17
74+
teardown_task:
75+
- command: subprocess.exec
76+
params:
77+
binary: bash
78+
args:
79+
- -c
80+
- rm -rf *
81+
teardown_task_can_fail_task: true
82+
- name: tg-abi-stability-stdlib-cxx17
83+
max_hosts: -1
84+
setup_group_can_fail_task: true
85+
setup_task:
86+
- command: git.get_project
87+
params:
88+
directory: mongo-cxx-driver
89+
- func: install_c_driver
90+
- command: subprocess.exec
91+
params:
92+
binary: bash
93+
env:
94+
cxx_standard: "17"
95+
polyfill: stdlib
1396
include_expansions_in_env:
14-
- cxx_standard
97+
- distro_id
1598
args:
1699
- -c
17100
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
101+
- command: s3.put
102+
type: setup
103+
params:
104+
display_name: "ABI Stability Setup: "
105+
aws_key: ${aws_key}
106+
aws_secret: ${aws_secret}
107+
bucket: mciuploads
108+
content_type: text/plain
109+
local_files_include_filter: "*.log"
110+
permissions: public-read
111+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
112+
tasks:
113+
- .abi-stability .stdlib .cxx17
114+
teardown_task:
115+
- command: subprocess.exec
116+
params:
117+
binary: bash
118+
args:
119+
- -c
120+
- rm -rf *
121+
teardown_task_can_fail_task: true
122+
- name: tg-abi-stability-stdlib-cxx20
123+
max_hosts: -1
124+
setup_group_can_fail_task: true
125+
setup_task:
126+
- command: git.get_project
127+
params:
128+
directory: mongo-cxx-driver
129+
- func: install_c_driver
130+
- command: subprocess.exec
131+
params:
132+
binary: bash
133+
env:
134+
cxx_standard: "20"
135+
polyfill: stdlib
136+
include_expansions_in_env:
137+
- distro_id
138+
args:
139+
- -c
140+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
141+
- command: s3.put
142+
type: setup
143+
params:
144+
display_name: "ABI Stability Setup: "
145+
aws_key: ${aws_key}
146+
aws_secret: ${aws_secret}
147+
bucket: mciuploads
148+
content_type: text/plain
149+
local_files_include_filter: "*.log"
150+
permissions: public-read
151+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
152+
tasks:
153+
- .abi-stability .stdlib .cxx20
154+
teardown_task:
155+
- command: subprocess.exec
156+
params:
157+
binary: bash
158+
args:
159+
- -c
160+
- rm -rf *
161+
teardown_task_can_fail_task: true
162+
- name: tg-abi-stability-stdlib-cxx23
163+
max_hosts: -1
164+
setup_group_can_fail_task: true
165+
setup_task:
166+
- command: git.get_project
167+
params:
168+
directory: mongo-cxx-driver
169+
- func: install_c_driver
170+
- command: subprocess.exec
171+
params:
172+
binary: bash
173+
env:
174+
cxx_standard: "23"
175+
polyfill: stdlib
176+
include_expansions_in_env:
177+
- distro_id
178+
args:
179+
- -c
180+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
181+
- command: s3.put
182+
type: setup
183+
params:
184+
display_name: "ABI Stability Setup: "
185+
aws_key: ${aws_key}
186+
aws_secret: ${aws_secret}
187+
bucket: mciuploads
188+
content_type: text/plain
189+
local_files_include_filter: "*.log"
190+
permissions: public-read
191+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
18192
tasks:
19-
- .abi-stability
193+
- .abi-stability .stdlib .cxx23
20194
teardown_task:
21195
- command: subprocess.exec
22196
params:

0 commit comments

Comments
 (0)