[llvm] [CI] Make updates to .ci actually test everything (PR #224125)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 12:48:15 PDT 2026


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/224125

We ran into an issue where test failures in cross-project-tests were not surfaced when bumping the image to Ubuntu 26.04 due to the script not correctly calculating dependencies for changes to .ci and the premerge workflow. This patch fixes that by ensuring the projects executed for .ci/workflow changes are derived from everything else which means we do not need to manually maintain the list and risk leaving it out of date.

>From 36097b42042bded8497a3166223594a23ae8c677 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 16 Sep 2026 19:46:16 +0000
Subject: [PATCH] [CI] Make updates to .ci actually test everything

We ran into an issue where test failures in cross-project-tests were not
surfaced when bumping the image to Ubuntu 26.04 due to the script not
correctly calculating dependencies for changes to .ci and the premerge
workflow. This patch fixes that by ensuring the projects executed for
.ci/workflow changes are derived from everything else which means we do
not need to manually maintain the list and risk leaving it out of date.
---
 .ci/compute_projects.py      | 108 +++++++++++++++++------------------
 .ci/compute_projects_test.py |  14 ++---
 2 files changed, 60 insertions(+), 62 deletions(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 42d1524d638ed..936397b779eb0 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -36,6 +36,42 @@
     "offload": {"clang", "lld", "flang"},
 }
 
+PROJECT_CHECK_TARGETS = {
+    "clang-tools-extra": "check-clang-tools",
+    "compiler-rt": "check-compiler-rt",
+    "cross-project-tests": "check-cross-project",
+    "libcxx": "check-cxx",
+    "libcxxabi": "check-cxxabi",
+    "libunwind": "check-unwind",
+    "lldb": "check-lldb",
+    "llvm": "check-llvm",
+    "clang": "check-clang check-clang-python",
+    "CIR": "check-clang-cir",
+    "bolt": "check-bolt",
+    "lld": "check-lld",
+    "flang": "check-flang",
+    "flang-rt": "check-flang-rt",
+    "libc": "check-libc",
+    "libclc": "check-libclc",
+    "mlir": "check-mlir",
+    "openmp": "openmp",  # Run only build in pre-merge
+    "polly": "check-polly",
+    "lit": "check-lit",
+    "offload": "offload",  # Run only build in pre-merge
+}
+
+RUNTIMES = {
+    "libcxx",
+    "libcxxabi",
+    "libunwind",
+    "compiler-rt",
+    "libc",
+    "flang-rt",
+    "libclc",
+    "openmp",
+    "offload",
+}
+
 # This mapping describes the additional projects that should be tested when a
 # specific project is touched. We enumerate them specifically rather than
 # just invert the dependencies list to give more control over what exactly is
@@ -58,16 +94,9 @@
     "mlir": {"flang"},
     # Test everything if ci scripts are changed.
     ".ci": {
-        "llvm",
-        "clang",
-        "CIR",
-        "lld",
-        "lldb",
-        "bolt",
-        "clang-tools-extra",
-        "mlir",
-        "polly",
-        "flang",
+        project_name
+        for project_name in PROJECT_CHECK_TARGETS
+        if project_name not in RUNTIMES
     },
 }
 
@@ -76,11 +105,16 @@
 # which needs some runtimes enabled for tests.
 DEPENDENT_RUNTIMES_TO_BUILD = {
     "flang": {"openmp"},
-    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"}
+    "lldb": {"libcxx", "libcxxabi", "libunwind", "compiler-rt"},
 }
 
 # This mapping describes runtimes that should be tested when the key project is
 # touched.
+DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
+    "llvm": {"libcxx", "libcxxabi", "libunwind"},
+    "clang": {"libcxx", "libcxxabi", "libunwind"},
+    ".ci": {"libcxx", "libcxxabi", "libunwind"},
+}
 DEPENDENT_RUNTIMES_TO_TEST = {
     "clang": {"compiler-rt", "libc"},
     "clang-tools-extra": {"libc"},
@@ -92,16 +126,15 @@
     "flang-rt": {"flang-rt"},
     "openmp": {"openmp"},
     "offload": {"offload", "openmp"},
-    ".ci": {"compiler-rt", "libc", "flang-rt", "libclc", "openmp", "offload"},
-}
-DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {
-    "llvm": {"libcxx", "libcxxabi", "libunwind"},
-    "clang": {"libcxx", "libcxxabi", "libunwind"},
-    ".ci": {"libcxx", "libcxxabi", "libunwind"},
+    ".ci": {
+        runtime_name
+        for runtime_name in PROJECT_CHECK_TARGETS
+        if runtime_name in RUNTIMES
+        and runtime_name not in DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG[".ci"]
+    },
 }
 
-EXCLUDE_LINUX = {
-}
+EXCLUDE_LINUX = {}
 
 # Runtimes configured for cross-compilation using LLVM_RUNTIME_TARGETS.
 # The same build may also use LLVM_ENABLE_RUNTIMES for other runtimes.
@@ -153,42 +186,6 @@
     "libclc",
 }
 
-PROJECT_CHECK_TARGETS = {
-    "clang-tools-extra": "check-clang-tools",
-    "compiler-rt": "check-compiler-rt",
-    "cross-project-tests": "check-cross-project",
-    "libcxx": "check-cxx",
-    "libcxxabi": "check-cxxabi",
-    "libunwind": "check-unwind",
-    "lldb": "check-lldb",
-    "llvm": "check-llvm",
-    "clang": "check-clang check-clang-python",
-    "CIR": "check-clang-cir",
-    "bolt": "check-bolt",
-    "lld": "check-lld",
-    "flang": "check-flang",
-    "flang-rt": "check-flang-rt",
-    "libc": "check-libc",
-    "libclc": "check-libclc",
-    "mlir": "check-mlir",
-    "openmp": "openmp",  # Run only build in pre-merge
-    "polly": "check-polly",
-    "lit": "check-lit",
-    "offload": "offload",  # Run only build in pre-merge
-}
-
-RUNTIMES = {
-    "libcxx",
-    "libcxxabi",
-    "libunwind",
-    "compiler-rt",
-    "libc",
-    "flang-rt",
-    "libclc",
-    "openmp",
-    "offload",
-}
-
 # Meta projects are projects that need explicit handling but do not reside
 # in their own top level folder. To add a meta project, the start of the path
 # for the metaproject should be mapped to the name of the project below.
@@ -212,6 +209,7 @@
 # Projects that should not run any tests. These need to be metaprojects.
 SKIP_PROJECTS = ["docs", "gn"]
 
+
 def _add_dependencies(projects: Set[str], runtimes: Set[str]) -> Set[str]:
     projects_with_dependents = set(projects)
     current_projects_count = 0
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index c0c9cc100d91b..0dc01964201c6 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -351,11 +351,11 @@ def test_ci(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
+            "bolt;clang;clang-tools-extra;cross-project-tests;flang;lld;lldb;llvm;mlir;polly",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -380,7 +380,7 @@ def test_windows_ci(self):
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-clang check-clang-python check-clang-cir check-clang-tools check-lld check-llvm check-mlir check-polly",
+            "check-clang check-clang-python check-clang-cir check-clang-tools check-lit check-lld check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -425,11 +425,11 @@ def test_premerge_workflow(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
+            "bolt;clang;clang-tools-extra;cross-project-tests;flang;lld;lldb;llvm;mlir;polly",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],
@@ -460,11 +460,11 @@ def test_third_party_benchmark(self):
         )
         self.assertEqual(
             env_variables["projects_to_build"],
-            "bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
+            "bolt;clang;clang-tools-extra;cross-project-tests;flang;lld;lldb;llvm;mlir;polly",
         )
         self.assertEqual(
             env_variables["project_check_targets"],
-            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-flang check-lld check-lldb check-llvm check-mlir check-polly",
+            "check-bolt check-clang check-clang-python check-clang-cir check-clang-tools check-cross-project check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
         )
         self.assertEqual(
             env_variables["runtimes_to_build"],



More information about the llvm-commits mailing list