57
57
".ci" : {"llvm" , "clang" , "lld" , "lldb" },
58
58
}
59
59
60
+ # This mapping describes runtimes that should be enabled for a specific project,
61
+ # but not necessarily run for testing. The only case of this currently is lldb
62
+ # which needs some runtimes enabled for tests.
63
+ DEPENDENT_RUNTIMES_TO_BUILD = {"lldb" : {"libcxx" , "libcxxabi" , "libunwind" }}
64
+
65
+ # This mapping describes runtimes that should be tested when the key project is
66
+ # touched.
60
67
DEPENDENT_RUNTIMES_TO_TEST = {"clang" : {"libcxx" , "libcxxabi" , "libunwind" }}
61
68
62
69
EXCLUDE_LINUX = {
@@ -180,16 +187,20 @@ def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
180
187
def _compute_runtimes_to_test (projects_to_test : Set [str ]) -> Set [str ]:
181
188
runtimes_to_test = set ()
182
189
for project_to_test in projects_to_test :
183
- if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST :
184
- continue
185
- runtimes_to_test .update (DEPENDENT_RUNTIMES_TO_TEST [project_to_test ])
190
+ if project_to_test in DEPENDENT_RUNTIMES_TO_TEST :
191
+ runtimes_to_test .update (DEPENDENT_RUNTIMES_TO_TEST [project_to_test ])
192
+ if project_to_test in DEPENDENT_RUNTIMES_TO_BUILD :
193
+ runtimes_to_test .update (DEPENDENT_RUNTIMES_TO_BUILD [project_to_test ])
186
194
return runtimes_to_test
187
195
188
196
189
- def _compute_runtime_check_targets (runtimes_to_test : Set [str ]) -> Set [str ]:
197
+ def _compute_runtime_check_targets (projects_to_test : Set [str ]) -> Set [str ]:
190
198
check_targets = set ()
191
- for runtime_to_test in runtimes_to_test :
192
- check_targets .add (PROJECT_CHECK_TARGETS [runtime_to_test ])
199
+ for project_to_test in projects_to_test :
200
+ if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST :
201
+ continue
202
+ for runtime_to_test in DEPENDENT_RUNTIMES_TO_TEST [project_to_test ]:
203
+ check_targets .add (PROJECT_CHECK_TARGETS [runtime_to_test ])
193
204
return check_targets
194
205
195
206
@@ -216,16 +227,16 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
216
227
projects_to_test = _compute_projects_to_test (modified_projects , platform )
217
228
projects_to_build = _compute_projects_to_build (projects_to_test )
218
229
projects_check_targets = _compute_project_check_targets (projects_to_test )
219
- runtimes_to_test = _compute_runtimes_to_test (projects_to_test )
220
- runtimes_check_targets = _compute_runtime_check_targets (runtimes_to_test )
230
+ runtimes_to_build = _compute_runtimes_to_test (projects_to_test )
231
+ runtimes_check_targets = _compute_runtime_check_targets (projects_to_test )
221
232
# We use a semicolon to separate the projects/runtimes as they get passed
222
233
# to the CMake invocation and thus we need to use the CMake list separator
223
234
# (;). We use spaces to separate the check targets as they end up getting
224
235
# passed to ninja.
225
236
return {
226
237
"projects_to_build" : ";" .join (sorted (projects_to_build )),
227
238
"project_check_targets" : " " .join (sorted (projects_check_targets )),
228
- "runtimes_to_build" : ";" .join (sorted (runtimes_to_test )),
239
+ "runtimes_to_build" : ";" .join (sorted (runtimes_to_build )),
229
240
"runtimes_check_targets" : " " .join (sorted (runtimes_check_targets )),
230
241
}
231
242
0 commit comments