[llvm] [ci] Don't add more check targets if "check-all" is present (PR #110277)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 08:05:30 PDT 2024


https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/110277

>From 87979774ad57836e01b7626f49dd9c3e1a470089 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Fri, 27 Sep 2024 15:41:56 +0100
Subject: [PATCH] [ci] Don't add more check targets if "check-all" is present

Fixes #110265.

Where I noticed that because compiler-rt added the "check-all" target
we were actually testing clang and clang-tools twice. One for "all" and
once with their specific targets.

This what the generated commands looked like before this commit (Linux/Windows):
```
  commands:
  - './.ci/monolithic-linux.sh "clang;clang;lld;clang-tools-extra;compiler-rt;llvm" "check-all check-clang check-clang-tools" "libcxx;libcxxabi;libunwind" "check-cxx check-cxxabi check-unwind"'
  commands:
  - 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 -host_arch=amd64'
  - 'bash .ci/monolithic-windows.sh "clang;clang-tools-extra;llvm" "check-clang check-clang-tools"'
```
Windows avoided this issue because compiler-rt is ignored there due to
failing tests, but the same issue could happen there in future.

These extra tests were about 24% of the test run and increased testing
time (on my local machine) by 45%.

With the changes I've made here, once a project says it needs the
"check-all" target, we stop looking for check targets. As "all"
includes them all anyway.

The generated commands are now:
```
  commands:
  - './.ci/monolithic-linux.sh "clang;clang;lld;clang-tools-extra;compiler-rt;llvm" "check-all" "libcxx;libcxxabi;libunwind" "check-cxx check-cxxabi check-unwind"'
  commands:
  - 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 -host_arch=amd64'
  - 'bash .ci/monolithic-windows.sh "clang;clang-tools-extra;llvm" "check-clang check-clang-tools"'
```

I have not applied this logic to the runtimes check targets because
the monolithic build actually does 2 builds.
* The first is projects only.
* The second is runtimes only.

The second build will all be specific check targets like "check-cxx".

(though if you do combine the two builds, runtimes tests will run as
part of "check-all")
---
 .ci/generate-buildkite-pipeline-premerge | 29 ++++++++++++++++--------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge
index 98a8b8fff3687a..4cd2f93dbbb1a0 100755
--- a/.ci/generate-buildkite-pipeline-premerge
+++ b/.ci/generate-buildkite-pipeline-premerge
@@ -192,40 +192,49 @@ function keep-modified-projects() {
 
 function check-targets() {
   projects=${@}
+  targets=""
   for project in ${projects}; do
     case ${project} in
     clang-tools-extra)
-      echo "check-clang-tools"
+      targets="${targets} check-clang-tools"
     ;;
     compiler-rt)
-      echo "check-all"
+      targets="${targets} check-all"
     ;;
     cross-project-tests)
-      echo "check-cross-project"
+      targets="${targets} check-cross-project"
     ;;
     libcxx)
-      echo "check-cxx"
+      targets="${targets} check-cxx"
     ;;
     libcxxabi)
-      echo "check-cxxabi"
+      targets="${targets} check-cxxabi"
     ;;
     libunwind)
-      echo "check-unwind"
+      targets="${targets} check-unwind"
     ;;
     lldb)
-      echo "check-lldb"
+      targets="${targets} check-lldb"
     ;;
     pstl)
-      echo "check-all"
+      targets="${targets} check-all"
     ;;
     libclc)
-      echo "check-all"
+      targets="${targets} check-all"
     ;;
     *)
-      echo "check-${project}"
+      targets="${targets} check-${project}"
     ;;
     esac
   done
+
+  # check-all includes every project and runtime. Adding more targets would
+  # make tests run multiple times.
+  if [[ $targets == *"check-all"* ]]; then
+    echo "check-all"
+  else
+    echo ${targets}
+  fi
 }
 
 # Project specific pipelines.



More information about the llvm-commits mailing list