99from shrub .v3 .evg_task import EvgTask , EvgTaskRef
1010from shrub .v3 .evg_task_group import EvgTaskGroup
1111
12+ from itertools import product
13+
1214
1315TAG = 'abi-stability'
1416
1517
1618# pylint: disable=line-too-long
1719# fmt: off
1820MATRIX = [
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
@@ -43,7 +48,7 @@ class AbiComplianceCheck(Function):
4348 display_name = 'ABI Compliance Check (Stable): ' ,
4449 local_files_include_filter = 'cxx-abi/compat_reports/**/compat_report.html' ,
4550 permissions = 'public-read' ,
46- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/' ,
51+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abi-compliance-check/abi/' ,
4752 ),
4853 s3_put (
4954 command_type = EvgCommandType .SYSTEM ,
@@ -54,7 +59,7 @@ class AbiComplianceCheck(Function):
5459 display_name = 'ABI Compliance Check (Stable): ' ,
5560 local_files_include_filter = 'cxx-abi/logs/**/log.txt' ,
5661 permissions = 'public-read' ,
57- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/abi/' ,
62+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abi-compliance-check/abi/' ,
5863 ),
5964 s3_put (
6065 command_type = EvgCommandType .SYSTEM ,
@@ -65,7 +70,7 @@ class AbiComplianceCheck(Function):
6570 display_name = 'ABI Compliance Check (Unstable): ' ,
6671 local_files_include_filter = 'cxx-noabi/compat_reports/**/compat_report.html' ,
6772 permissions = 'public-read' ,
68- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/' ,
73+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abi-compliance-check/noabi/' ,
6974 ),
7075 s3_put (
7176 command_type = EvgCommandType .SYSTEM ,
@@ -76,7 +81,7 @@ class AbiComplianceCheck(Function):
7681 display_name = 'ABI Compliance Check (Unstable): ' ,
7782 local_files_include_filter = 'cxx-noabi/logs/**/log.txt' ,
7883 permissions = 'public-read' ,
79- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abi-compliance-check/noabi/' ,
84+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abi-compliance-check/noabi/' ,
8085 ),
8186 ]
8287
@@ -101,7 +106,7 @@ class Abidiff(Function):
101106 display_name = 'abidiff (Stable): ' ,
102107 local_files_include_filter = 'cxx-abi/*.txt' ,
103108 permissions = 'public-read' ,
104- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/abi/' ,
109+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abidiff/abi/' ,
105110 ),
106111 s3_put (
107112 command_type = EvgCommandType .SYSTEM ,
@@ -112,7 +117,7 @@ class Abidiff(Function):
112117 display_name = 'abidiff (Unstable): ' ,
113118 local_files_include_filter = 'cxx-noabi/*.txt' ,
114119 permissions = 'public-read' ,
115- remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${execution}/abidiff/noabi/' ,
120+ remote_file = 'mongo-cxx-driver/${branch_name}/${revision}/${version_id}/${build_id}/${task_id}/${ execution}/abidiff/noabi/' ,
116121 ),
117122 ]
118123
@@ -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
151180def 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}/${task_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
172217def 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 ]
0 commit comments