[llvm] [CI] Test lit when it is changed (PR #159359)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 06:55:22 PDT 2025


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/159359

>From 1839c91fce7defbcf7fd28e18298e8aad8052194 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 17 Sep 2025 13:35:25 +0000
Subject: [PATCH 1/2] [CI] Test lit when it is changed

This patch makes it so that we run the lit tests when lit is changed.
This can make it much easier to catch portability issues with the tests
(like tests not working properly on Windows). It's also helpful as we
spend time working on enabling the internal shell by default.
---
 .ci/compute_projects.py      |  9 ++++++++-
 .ci/compute_projects_test.py | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 6b5370f471203..680eed782aadd 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -150,6 +150,7 @@
     "mlir": "check-mlir",
     "openmp": "check-openmp",
     "polly": "check-polly",
+    "lit": "check-lit",
 }
 
 RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc", "flang-rt"}
@@ -166,8 +167,12 @@
     ("llvm", "utils", "gn"): "gn",
     (".github", "workflows", "premerge.yaml"): ".ci",
     ("third-party",): ".ci",
+    ("llvm", "utils", "lit"): "lit"
 }
 
+# Projects that should run tests but cannot be explicitly built.
+SKIP_BUILD_PROJECTS = ["CIR", "lit"]
+
 # Projects that should not run any tests. These need to be metaprojects.
 SKIP_PROJECTS = ["docs", "gn"]
 
@@ -315,7 +320,9 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
     # clang build, but it requires an explicit option to enable. We set that
     # option here, and remove it from the projects_to_build list.
     enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
-    projects_to_build.discard("CIR")
+    # Remove any metaprojects from the list of projects to build.
+    for project in SKIP_BUILD_PROJECTS:
+        projects_to_build.discard(project)
 
     # We use a semicolon to separate the projects/runtimes as they get passed
     # to the CMake invocation and thus we need to use the CMake list separator
diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py
index bb1d24174ca30..fe1bf07eae8ff 100644
--- a/.ci/compute_projects_test.py
+++ b/.ci/compute_projects_test.py
@@ -413,6 +413,30 @@ def test_third_party_benchmark(self):
             "check-cxx check-cxxabi check-unwind",
         )
 
+    def test_lit(self):
+        env_variables = compute_projects.get_env_variables(
+            ["llvm/utils/lit/CMakeLists.txt"], "Linux"
+        )
+        self.assertEqual(
+            env_variables["projects_to_build"],
+            "bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
+        )
+        self.assertEqual(
+            env_variables["project_check_targets"],
+            "check-bolt check-clang check-clang-tools check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
+        )
+        self.assertEqual(
+            env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
+        )
+        self.assertEqual(
+            env_variables["runtimes_check_targets"],
+            "",
+        )
+        self.assertEqual(
+            env_variables["runtimes_check_targets_needs_reconfig"],
+            "check-cxx check-cxxabi check-unwind",
+        )
+
 
 if __name__ == "__main__":
     unittest.main()

>From 76c823b6840dd591e8e7fb44bd5d449467935028 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 17 Sep 2025 13:55:03 +0000
Subject: [PATCH 2/2] formatting

---
 .ci/compute_projects.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py
index 680eed782aadd..a4cfecf0cef90 100644
--- a/.ci/compute_projects.py
+++ b/.ci/compute_projects.py
@@ -167,7 +167,7 @@
     ("llvm", "utils", "gn"): "gn",
     (".github", "workflows", "premerge.yaml"): ".ci",
     ("third-party",): ".ci",
-    ("llvm", "utils", "lit"): "lit"
+    ("llvm", "utils", "lit"): "lit",
 }
 
 # Projects that should run tests but cannot be explicitly built.



More information about the llvm-commits mailing list