Skip to content

Commit d95d66d

Browse files
committed
Address review feedback
1 parent f1457f9 commit d95d66d

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

.ci/compute_projects.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ def _compute_projects_to_build(
196196
projects_to_test: Set[str], runtimes: Set[str]
197197
) -> Set[str]:
198198
projects_with_deps = _add_dependencies(projects_to_test, runtimes)
199-
# CIR is used as a pseudo-project in this script. We detect modifications
200-
# to clang's CIR-specific subdirectories and add CIR as a modified project
201-
# if a file in these directories is modified, but we need to remove it
202-
# explicitly here.
203-
return projects_with_deps - {"CIR"}
199+
return projects_with_deps
204200

205201

206202
def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
@@ -261,9 +257,8 @@ def _get_modified_projects(modified_files: list[str]) -> Set[str]:
261257
or path_parts[:3] == ("clang", "test", "CIR")
262258
or path_parts[:4] == ("clang", "include", "clang", "CIR")
263259
):
264-
modified_projects.add("clang")
265260
modified_projects.add("CIR")
266-
continue
261+
# Fall through to add clang.
267262
modified_projects.add(pathlib.Path(modified_file).parts[0])
268263
return modified_projects
269264

@@ -285,10 +280,11 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
285280
runtimes_to_test_needs_reconfig
286281
)
287282

288-
# Check if both clang and mlir are in projects_to_build to enable CIR
289-
enable_cir = (
290-
"ON" if "clang" in projects_to_build and "mlir" in projects_to_build else "OFF"
291-
)
283+
# CIR is used as a pseudo-project in this script. It is built as part of the
284+
# clang build, but it requires an explicit option to enable. We set that
285+
# option here, and remove it from the projects_to_build list.
286+
enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
287+
projects_to_build.discard("CIR")
292288

293289
# We use a semicolon to separate the projects/runtimes as they get passed
294290
# to the CMake invocation and thus we need to use the CMake list separator

.ci/compute_projects_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,12 @@ def test_mlir(self):
183183
)
184184
self.assertEqual(env_variables["projects_to_build"], "clang;flang;llvm;mlir")
185185
self.assertEqual(
186-
env_variables["project_check_targets"],
187-
"check-flang check-mlir",
186+
env_variables["project_check_targets"], "check-flang check-mlir",
188187
)
189188
self.assertEqual(env_variables["runtimes_to_build"], "")
190189
self.assertEqual(env_variables["runtimes_check_targets"], "")
191190
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
192-
self.assertEqual(env_variables["enable_cir"], "ON")
191+
self.assertEqual(env_variables["enable_cir"], "OFF")
193192

194193
def test_flang(self):
195194
env_variables = compute_projects.get_env_variables(

0 commit comments

Comments
 (0)