Skip to content

Commit 7da71a6

Browse files
[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.
1 parent 2b43ecd commit 7da71a6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.ci/compute_projects.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
"polly": "check-polly",
113113
}
114114

115+
RUNTIMES = {"libcxx", "libcxxabi", "libunwind"}
116+
115117

116118
def _add_dependencies(projects: Set[str]) -> Set[str]:
117119
projects_with_dependents = set(projects)
@@ -131,6 +133,8 @@ def _compute_projects_to_test(modified_projects: Set[str], platform: str) -> Set
131133
# Skip all projects where we cannot run tests.
132134
if modified_project not in PROJECT_CHECK_TARGETS:
133135
continue
136+
if modified_project in RUNTIMES:
137+
continue
134138
projects_to_test.add(modified_project)
135139
if modified_project not in DEPENDENTS_TO_TEST:
136140
continue

.ci/compute_projects_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ def test_top_level_file(self):
161161
self.assertEqual(env_variables["runtimes_to_build"], "")
162162
self.assertEqual(env_variables["runtimes_check_targets"], "")
163163

164+
def test_blah(self):
165+
env_variables = compute_projects.get_env_variables(
166+
[".ci/compute_projects.py", "libcxx/CMakeLists.txt"], "Linux"
167+
)
168+
self.assertEqual(env_variables["projects_to_build"], "")
169+
self.assertEqual(env_variables["project_check_targets"], "")
170+
self.assertEqual(env_variables["runtimes_to_build"], "")
171+
self.assertEqual(env_variables["runtimes_check_targets"], "")
172+
164173

165174
if __name__ == "__main__":
166175
unittest.main()

0 commit comments

Comments
 (0)