[llvm] [ci] Don't add more check targets if "check-all" is present (PR #110277)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 27 07:52:14 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-github-workflow
Author: David Spickett (DavidSpickett)
<details>
<summary>Changes</summary>
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")
---
Full diff: https://github.com/llvm/llvm-project/pull/110277.diff
1 Files Affected:
- (modified) .ci/generate-buildkite-pipeline-premerge (+16-9)
``````````diff
diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge
index 98a8b8fff3687a..d1777ca9d8b70b 100755
--- a/.ci/generate-buildkite-pipeline-premerge
+++ b/.ci/generate-buildkite-pipeline-premerge
@@ -192,14 +192,23 @@ function keep-modified-projects() {
function check-targets() {
projects=${@}
+
+ # If any one of the projects must be checked with check-all, return only
+ # check-all as it will enable testing for all projects.
+ for project in ${projects}; do
+ case ${project} in
+ compiler-rt|pstl|libclc)
+ echo "check-all"
+ return
+ ;;
+ esac
+ done
+
for project in ${projects}; do
case ${project} in
clang-tools-extra)
echo "check-clang-tools"
;;
- compiler-rt)
- echo "check-all"
- ;;
cross-project-tests)
echo "check-cross-project"
;;
@@ -215,12 +224,6 @@ function check-targets() {
lldb)
echo "check-lldb"
;;
- pstl)
- echo "check-all"
- ;;
- libclc)
- echo "check-all"
- ;;
*)
echo "check-${project}"
;;
@@ -255,6 +258,10 @@ linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq)
linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq)
linux_runtimes_to_test=$(compute-runtimes-to-test ${linux_projects_to_test})
+# linux_check_targets may be "check-all" at this point, however
+# monolithic-linux.sh uses this for the first build which includes projects
+# only. The second build is runtimes only and it will use the "check-" targets
+# we generate here.
linux_runtime_check_targets=$(check-targets ${linux_runtimes_to_test} | sort | uniq)
linux_runtimes=$(echo ${linux_runtimes_to_test} | sort | uniq)
``````````
</details>
https://github.com/llvm/llvm-project/pull/110277
More information about the llvm-commits
mailing list