Skip to content

Commit 1c4518f

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

File tree

8 files changed

+424
-66
lines changed

8 files changed

+424
-66
lines changed

.evergreen/config_generator/components/abi_stability.py

Lines changed: 69 additions & 25 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
@@ -133,57 +138,96 @@ def functions():
133138
)
134139

135140

136-
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()],
141+
def generate_tasks():
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 17.
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
171+
172+
173+
TASKS = generate_tasks()
174+
175+
176+
def tasks():
177+
return TASKS
149178

150179

151180
def task_groups():
152181
return [
153182
EvgTaskGroup(
154-
name=f'tg-{TAG}',
183+
name=f'tg-{TAG}-{polyfill}-cxx{cxx_standard}',
155184
max_hosts=-1,
156185
setup_group_can_fail_task=True,
157186
setup_task=[
158187
git_get_project(directory='mongo-cxx-driver'),
159188
InstallCDriver.call(),
160189
bash_exec(
161-
include_expansions_in_env=['cxx_standard'],
190+
env={
191+
'cxx_standard': f'{cxx_standard}',
192+
'polyfill': polyfill,
193+
},
194+
include_expansions_in_env=['distro_id'],
162195
script='mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh'
163196
),
197+
s3_put(
198+
command_type=EvgCommandType.SETUP,
199+
aws_key='${aws_key}',
200+
aws_secret='${aws_secret}',
201+
bucket='mciuploads',
202+
content_type='text/plain',
203+
display_name='ABI Stability Setup: ',
204+
local_files_include_filter='*.log',
205+
permissions='public-read',
206+
remote_file='mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/',
207+
),
164208
],
165-
tasks=[f'.{TAG}'],
209+
tasks=[task.name for task in TASKS if polyfill in task.name and f'cxx{cxx_standard}' in task.name],
166210
teardown_task_can_fail_task=True,
167211
teardown_task=[bash_exec(script='rm -rf *'),],
168212
)
213+
for polyfill, cxx_standard in MATRIX
169214
]
170215

171216

172217
def variants():
173218
return [
174219
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')],
220+
name=f'abi-stability',
221+
display_name=f'ABI Stability Checks',
222+
tasks=[
223+
EvgTaskRef(name=f'tg-{TAG}-{polyfill}-cxx{cxx_standard}')
224+
for polyfill, cxx_standard in MATRIX
225+
],
181226
display_tasks=[
182227
DisplayTask(
183-
name=f'ABI Stability Checks ({name})',
228+
name=f'ABI Stability Checks',
184229
execution_tasks=[f'.{TAG}'],
185230
)
186231
],
187232
)
188-
for name, cxx_standard in MATRIX
189233
]

.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: 187 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,197 @@ 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-compliance-check-impls-cxx11
34+
- abidiff-impls-cxx11
35+
- abi-prohibited-symbols-impls-cxx11
36+
teardown_task:
37+
- command: subprocess.exec
38+
params:
39+
binary: bash
40+
args:
41+
- -c
42+
- rm -rf *
43+
teardown_task_can_fail_task: true
44+
- name: tg-abi-stability-impls-cxx17
45+
max_hosts: -1
46+
setup_group_can_fail_task: true
47+
setup_task:
48+
- command: git.get_project
49+
params:
50+
directory: mongo-cxx-driver
51+
- func: install_c_driver
52+
- command: subprocess.exec
53+
params:
54+
binary: bash
55+
env:
56+
cxx_standard: "17"
57+
polyfill: impls
58+
include_expansions_in_env:
59+
- distro_id
60+
args:
61+
- -c
62+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
63+
- command: s3.put
64+
type: setup
65+
params:
66+
display_name: "ABI Stability Setup: "
67+
aws_key: ${aws_key}
68+
aws_secret: ${aws_secret}
69+
bucket: mciuploads
70+
content_type: text/plain
71+
local_files_include_filter: "*.log"
72+
permissions: public-read
73+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
74+
tasks:
75+
- abi-compliance-check-impls-cxx17
76+
- abidiff-impls-cxx17
77+
- abi-prohibited-symbols-impls-cxx17
78+
teardown_task:
79+
- command: subprocess.exec
80+
params:
81+
binary: bash
82+
args:
83+
- -c
84+
- rm -rf *
85+
teardown_task_can_fail_task: true
86+
- name: tg-abi-stability-stdlib-cxx17
87+
max_hosts: -1
88+
setup_group_can_fail_task: true
89+
setup_task:
90+
- command: git.get_project
91+
params:
92+
directory: mongo-cxx-driver
93+
- func: install_c_driver
94+
- command: subprocess.exec
95+
params:
96+
binary: bash
97+
env:
98+
cxx_standard: "17"
99+
polyfill: stdlib
13100
include_expansions_in_env:
14-
- cxx_standard
101+
- distro_id
15102
args:
16103
- -c
17104
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
105+
- command: s3.put
106+
type: setup
107+
params:
108+
display_name: "ABI Stability Setup: "
109+
aws_key: ${aws_key}
110+
aws_secret: ${aws_secret}
111+
bucket: mciuploads
112+
content_type: text/plain
113+
local_files_include_filter: "*.log"
114+
permissions: public-read
115+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
116+
tasks:
117+
- abi-compliance-check-stdlib-cxx17
118+
- abidiff-stdlib-cxx17
119+
- abi-prohibited-symbols-stdlib-cxx17
120+
teardown_task:
121+
- command: subprocess.exec
122+
params:
123+
binary: bash
124+
args:
125+
- -c
126+
- rm -rf *
127+
teardown_task_can_fail_task: true
128+
- name: tg-abi-stability-stdlib-cxx20
129+
max_hosts: -1
130+
setup_group_can_fail_task: true
131+
setup_task:
132+
- command: git.get_project
133+
params:
134+
directory: mongo-cxx-driver
135+
- func: install_c_driver
136+
- command: subprocess.exec
137+
params:
138+
binary: bash
139+
env:
140+
cxx_standard: "20"
141+
polyfill: stdlib
142+
include_expansions_in_env:
143+
- distro_id
144+
args:
145+
- -c
146+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
147+
- command: s3.put
148+
type: setup
149+
params:
150+
display_name: "ABI Stability Setup: "
151+
aws_key: ${aws_key}
152+
aws_secret: ${aws_secret}
153+
bucket: mciuploads
154+
content_type: text/plain
155+
local_files_include_filter: "*.log"
156+
permissions: public-read
157+
remote_file: mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-stability-setup/
158+
tasks:
159+
- abi-compliance-check-stdlib-cxx20
160+
- abidiff-stdlib-cxx20
161+
- abi-prohibited-symbols-stdlib-cxx20
162+
teardown_task:
163+
- command: subprocess.exec
164+
params:
165+
binary: bash
166+
args:
167+
- -c
168+
- rm -rf *
169+
teardown_task_can_fail_task: true
170+
- name: tg-abi-stability-stdlib-cxx23
171+
max_hosts: -1
172+
setup_group_can_fail_task: true
173+
setup_task:
174+
- command: git.get_project
175+
params:
176+
directory: mongo-cxx-driver
177+
- func: install_c_driver
178+
- command: subprocess.exec
179+
params:
180+
binary: bash
181+
env:
182+
cxx_standard: "23"
183+
polyfill: stdlib
184+
include_expansions_in_env:
185+
- distro_id
186+
args:
187+
- -c
188+
- mongo-cxx-driver/.evergreen/scripts/abi-stability-setup.sh
189+
- command: s3.put
190+
type: setup
191+
params:
192+
display_name: "ABI Stability Setup: "
193+
aws_key: ${aws_key}
194+
aws_secret: ${aws_secret}
195+
bucket: mciuploads
196+
content_type: text/plain
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/
18200
tasks:
19-
- .abi-stability
201+
- abi-compliance-check-stdlib-cxx23
202+
- abidiff-stdlib-cxx23
203+
- abi-prohibited-symbols-stdlib-cxx23
20204
teardown_task:
21205
- command: subprocess.exec
22206
params:

0 commit comments

Comments
 (0)