From 7da71a6b7132be8db76c67e34a2ba497bf851779 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Wed, 26 Mar 2025 23:58:40 +0000 Subject: [PATCH] [CI] Exclude runtimes from being tested as projects Before this patch, making a change to a runtime directory (like libcxx) would cause the project to be added to the LLVM_ENABLE_PROJECTS CMake flag which is illegal as they can only be built as part of LLVM_ENABLE_RUNTIMES. This patch fixes that behavior. Test added. --- .ci/compute_projects.py | 4 ++++ .ci/compute_projects_test.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py index 8bae8359ff23..e9c43a4df8ec 100644 --- a/.ci/compute_projects.py +++ b/.ci/compute_projects.py @@ -112,6 +112,8 @@ PROJECT_CHECK_TARGETS = { "polly": "check-polly", } +RUNTIMES = {"libcxx", "libcxxabi", "libunwind"} + def _add_dependencies(projects: Set[str]) -> Set[str]: projects_with_dependents = set(projects) @@ -131,6 +133,8 @@ def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set # Skip all projects where we cannot run tests. if modified_project not in PROJECT_CHECK_TARGETS: continue + if modified_project in RUNTIMES: + continue projects_to_test.add(modified_project) if modified_project not in DEPENDENTS_TO_TEST: continue diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py index 4e79f9368539..4afc121f18c4 100644 --- a/.ci/compute_projects_test.py +++ b/.ci/compute_projects_test.py @@ -161,6 +161,15 @@ class TestComputeProjects(unittest.TestCase): self.assertEqual(env_variables["runtimes_to_build"], "") self.assertEqual(env_variables["runtimes_check_targets"], "") + def test_blah(self): + env_variables = compute_projects.get_env_variables( + [".ci/compute_projects.py", "libcxx/CMakeLists.txt"], "Linux" + ) + self.assertEqual(env_variables["projects_to_build"], "") + self.assertEqual(env_variables["project_check_targets"], "") + self.assertEqual(env_variables["runtimes_to_build"], "") + self.assertEqual(env_variables["runtimes_check_targets"], "") + if __name__ == "__main__": unittest.main()