5757 ".ci" : {"llvm" , "clang" , "lld" , "lldb" },
5858}
5959
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.
6067DEPENDENT_RUNTIMES_TO_TEST = {"clang" : {"libcxx" , "libcxxabi" , "libunwind" }}
6168
6269EXCLUDE_LINUX = {
@@ -180,16 +187,20 @@ def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
180187def _compute_runtimes_to_test (projects_to_test : Set [str ]) -> Set [str ]:
181188 runtimes_to_test = set ()
182189 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 ])
186194 return runtimes_to_test
187195
188196
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 ]:
190198 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 ])
193204 return check_targets
194205
195206
@@ -216,16 +227,16 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
216227 projects_to_test = _compute_projects_to_test (modified_projects , platform )
217228 projects_to_build = _compute_projects_to_build (projects_to_test )
218229 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 )
221232 # We use a semicolon to separate the projects/runtimes as they get passed
222233 # to the CMake invocation and thus we need to use the CMake list separator
223234 # (;). We use spaces to separate the check targets as they end up getting
224235 # passed to ninja.
225236 return {
226237 "projects_to_build" : ";" .join (sorted (projects_to_build )),
227238 "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 )),
229240 "runtimes_check_targets" : " " .join (sorted (runtimes_check_targets )),
230241 }
231242
0 commit comments