0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-24 07:26:05 +00:00

34 Commits

Author SHA1 Message Date
Aiden Grossman
34d858635f
[CI] Move CI over to new project computation script
This patch migrates the CI over to the new compute_projects.py script
for calculating what projects need to be tested based on a change to
LLVM.

Reviewers: lnihlen, ldionne, tstellar, Endilll, joker-eph, Keenuts

Reviewed By: Keenuts, tstellar

Pull Request: https://github.com/llvm/llvm-project/pull/132642
2025-03-28 22:25:52 -07:00
Aiden Grossman
43c21f96a7
Revert "[Premerge] Add flang-rt ()" ()
This reverts commit 95d28fe503cc3d2bc0bb980442d3defaf199ea5a.

I did not fully realize the implications of this change when reviewing.
With how it is set up currently, it causes clang and all of the runtimes
to be built and tested everytime a change to MLIR is made. This is a
large regression in build/test time, which seems to have been causing
large queueing delays.

Reverting for now. Once we rework the runtimes build for premerge (which
I hope to do soon, ideally in the next week), I will make sure flang-rt
gets added in.
2025-03-18 15:52:59 -07:00
Michael Kruse
95d28fe503
[Premerge] Add flang-rt ()
Flang's runtime can now be built using LLVM's LLVM_ENABLE_RUNTIMES
mechanism, with the intent to remove the old mechanism in .
Update the pre-merge builders to use the new mechanism.

In the current form,  actually will add
LLVM_ENABLE_RUNTIMES=flang-rt implicitly, so no change is strictly
needed. I still think it is a good idea to do it explicitly and in
advance.

On Windows, flang-rt also requires compiler-rt, but which is not
building on Windows anyway.
2025-03-13 12:17:59 +01:00
Aiden Grossman
280c7d7198
[CI] Increase Configurability of Monolithic Windows Build ()
This patch makes it so that the caller of monolithic-windows.sh can set
the maximum number of parallel compile/link jobs in an environment
variable rather than manually specifying it inside of the CMake.
Additionally, the env variable definitions for CC, CXX, and LD are sunk
into the shell script due to those config options being pretty inherent
to what the pipeline is testing.

This is intended to make things more flexible/useable for the new
premerge CI pipeline, particularly as we are looking at using larger
runners and want the increased flexibility to experiment.
2025-01-24 15:37:36 -08:00
Aiden Grossman
d6cc140dfd
[CI] Refactor common functionality into separate script ()
This patch refactors some common functionality present in the CI scripts
to a separate shell script. This is mainly intended to make it easier to
reuse this functionality inside of a Github Actions pipeline as we make
the switch.
2024-12-13 01:20:02 -08:00
David Spickett
f539d92dca
[ci] Write test results to unique file names ()
In this patch I'm using a new lit option so that the pipeline writes
many results files, one for each time lit is run:
```
--use-unique-output-file-name
  When enabled, lit will add a unique element to the output file name, before the extension. For example "results.xml" will become "results.<something>.xml". The
  "<something>" is not ordered in any way and is chosen so that existing files are not overwritten. [Default: Off]
```
(I added this to lit recently)

Alternatives were considered:
* mkfifo - does not work on bash for Windows.
* tail -f - does not print full content on file truncation
* lit wrapper script - more complication than using an option to lit
itself
* ninja/mv file/ninja/mv file etc - lots of changes needed to make the
scripts build each target separately

And after feedback I decided that using an option to lit itself is the
cleanest way to go. It can be removed when we no longer need it.

If I run the Linux build after this change:
```
$ bash ./.ci/monolithic-linux.sh "clang;lldb;lld" "check-lldb-shell check-lld" "libcxx;libcxxabi" "check-libcxx check-libcxxabi"
```
I get multiple test result files. In my case some tests fail so runtimes
aren't checked, but all projects are so there is 1 file for lldb and one
for lld:
```
$ ls build/*.xml
build/test-results.klc82utf.xml  build/test-results.majylh73.xml
```
This change just collects the XML files as artifacts. Once I know that's
working, I can set up test reporting to make a summary of them.
2024-11-12 13:24:44 +00:00
David Spickett
90149204bd
[ci] Don't add check-all target when pstl project is enabled ()
Fixes 

Adding check-all causes us to run some tests twice if a project specific
target like check-clang is also added.

check-pstl is an alternative but as far as I can tell, check-all does
not include this so we have not been running the tests in CI anyway.

When I tried to run check-pstl locally I got a lot of compiler errors
but have not found any instructions on how to setup a correct build
environment. Even if such instructions exist, it's probably more than we
want to do in CI.

According to Louis Dionne, the project is probably not active. So if
it's ever revived it'll be up to the new contributors to enable testing.
2024-10-10 14:26:46 +01:00
David Spickett
10008f731d
[ci] Don't add a testing target for libclc ()
According to
https://github.com/llvm/llvm-project/pull/111369#issuecomment-2400152471
there is no testing to be done here.

Adding "check-all" only risks duplicating tests if other project
specific "check-" targets are also added.
2024-10-09 09:16:37 +01:00
David Spickett
5be1024ea7
[ci] Use check-compiler-rt target for testing compiler-rt ()
Instead of "check-all" which leads to us running some tests twice if
there are other "check-..." targets. For example on one of my PRs this
script produced:
```
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"'
```
Which meant that Linux ran the clang and clang-tools tests twice. These
extra tests were about 24% of the test run and increased testing time
(on my local machine) by 45%.

This problem can also happen with other projects but there isn't a
simple fix like this one at the moment.
* pstl has a check-pstl target but it is not part of check-all and when
I tried it locally I couldn't build it.
* libclc has no check- target.

I will deal with those projects later.
2024-10-09 09:15:56 +01:00
Vlad Serebrennikov
a4f6b7dfa4
[lldb] Stop testing LLDB on Clang changes in pre-commit CI ()
This is a temporary measure to alleviate Linux pre-commit CI waiting
times that started snowballing
[recently](https://discourse.llvm.org/t/long-wait-for-linux-presubmit-testing/79547/5).
My [initial
estimate](https://github.com/llvm/llvm-project/pull/94208#issuecomment-2155972973)
of 4 additional minutes spent per built seems to be in the right
ballpark, but looks like that was the last straw to break camel's back.
It seems that CI load got past the tipping point, and now it's not able
to burn through the queue over the night on workdays.

I don't intend to overthrow the consensus we reached in , but it
shouldn't come at the expense of the whole LLVM community. I'll enable
this back as soon as we have news that we got more capacity for Linux
pre-commit CI.
2024-06-14 20:33:38 +04:00
Vlad Serebrennikov
d4eed43bad
Enable LLDB tests in Linux pre-merge CI ()
This patch removes LLDB from a list of projects that are excluded from
building and testing on pre-merge CI on Linux.

Windows environment needs to be prepared in order to test LLDB
(https://github.com/llvm/llvm-project/pull/94208#issuecomment-2146256857),
but we don't have enough maintenance resources to do that at the moment.

Because LLDB has been in the list of projects that need to be tested on
Clang changes, this PR make this happen on Linux. This seems to be the
consensus in the discussion of this PR.
2024-06-08 16:23:17 +04:00
Mehdi Amini
49ef21d767 Remove debug print from CI generation script (NFC) 2024-05-29 22:02:30 -07:00
Mehdi Amini
e4b424afc4
[CI] Disable Flang from pre-commit tests when Flang files are not touched on Windows Only ()
Flang triggers some OOM on Windows CI right now. This is disruptive to
MLIR and LLVM changes that don't touch Flang, as such we disable
building Flang on Windows only for these PR that don't touch flang. The
testing on Linux is unchanged, and the post-merge Windows testing is
still fully covering here.
2024-05-29 16:27:06 -06:00
Vlad Serebrennikov
1de1ee9cba
[clang][ci] Move libc++ testing into the main PR pipeline ()
Following the discussion in
https://github.com/llvm/llvm-project/pull/93233#issuecomment-2127920882,
this patch merges `clang-ci` pipeline into main `GitHub Pull Requests`
pipeline. `clang-ci` enables additional test coverage for Clang by
compiling it, and then using it to compile and test libc++, libc++abi,
and libunwind in C++03, C++26, and Clang Modules modes.

Additional work we skip and total time savings we should see:
1. Checking out the repo to generate the clang-ci pipeline (2 minutes)
2. Building Clang (3.5 minutes)
3. Uploading the artifacts once, then downloading them 3 times and
unpacking 3 times (0.5 minutes)

Note that because previously-split jobs for each mode are now under a
single Linux job, it now takes around 8 minutes more see the Linux CI
results despite total time savings.

The primary goal of this patch is to reduce the load of CI by removing
duplicated work. I consider this goal achieved. I could keep the job
parallelism we had (3 libc++ jobs depending on a main Linux job), but I
don't consider it worth the effort and opportunity cost, because
parallelism is not helping once the pool of builders is fully
subscribed.
2024-05-28 02:25:15 +04:00
Vlad Serebrennikov
243611ed4c
Disable compiling and testing Flang on Clang changes ()
This patch aims to rectify the Windows CI situation by decoupling Clang
changes from Flang test suite, which is causing Windows CI to "pause"
for 20 minutes (details can be found
[here](https://discourse.llvm.org/t/flang-tests-are-extremely-slow-on-windows/78591/11)).
This even seems desirable in the long run, because it was highlighted
that the only part of Clang that Flang depends on is Driver ([Discourse
post](https://discourse.llvm.org/t/flang-tests-are-extremely-slow-on-windows/78591/14)).

Importantly, this patch leaves the question of _entirely_ disabling
Flang tests on Windows CI out of scope.
2024-05-22 00:14:45 +04:00
Amir Ayupov
ced8497970
[ci] Add clang project dependency for bolt testing () 2024-04-26 22:06:24 +02:00
Fraser Cormack
d0af554464 [CI] Fix libclc dependencies
We need clang and llvm to build in-tree.
2024-04-18 07:01:13 +01:00
Mehdi Amini
d35f944dde
Add missing clang to the monolithic pre-merge build ()
Clang has a custom separate pipeline integrated with libc++ that only
runs in release mode. It means that changes which touches only clang
won't run the clang tests in the configuration used by LLVM premerge and
will break it unknowingly.
2024-03-14 22:06:45 -07:00
Lucile Rose Nihlen
cd4e246616
repair and re-enable Windows buildkite presubmit () 2024-02-20 15:30:38 -05:00
Tom Stellard
4ad9f5be83
ci: Temporarily disable the buildkite job on Windows ()
The failure rate is too high.
See
https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840
2024-02-13 07:45:55 -08:00
Louis Dionne
5aad789481 [ci] Diff against origin/BASE-BRANCH
Otherwise, when the base branch is not something that the CI runner
has checked out, that reference to e.g. release/18.x is ambiguous.
2024-01-25 16:48:08 -05:00
Louis Dionne
3b76289182
[ci] Fix the base branch we use to determine changes ()
We should diff against the base branch, not always against `main`. This
allows the BuildKite pre-commit CI to work properly when we target other
branches, such as `release/18.x`.
2024-01-25 16:38:53 -05:00
Louis Dionne
ca8605a78b [ci] Remove bits that are unused since we stopped using Phabricator 2024-01-24 10:46:34 -05:00
Vitaly Buka
f01b6ca8be
[CI] Add lld as compiler-rt dependecy ()
Fixing
https://buildkite.com/llvm-project/github-pull-requests/builds/30321#018d1a4a-bf72-449e-a70a-444ded875255

Co-authored-by: XinWang10 <108658776+XinWang10@users.noreply.github.com>
2024-01-17 21:10:54 -08:00
Mikhail Goncharov
815193f6be
[ci] diff with main merge-base ()
Basically a reland of ec9d80ec43f5761a34c4a785c67d9e7d21ec8bda but now
with fetching of main before that to get a correct merge base.
2023-10-17 11:24:43 +02:00
Mikhail Goncharov
8e53abc041
[ci] pull main branch before diffing ()
we tried to generate a full diff against main in
ec9d80e but it resulted in wrong diffs.

It seems that the issue was that 'main' was not
updated after agent restart and diff main...HEAD kept growing.

Not enabling diff main...HEAD just yet and will check logs for new PRs
first.
2023-10-16 11:22:58 +02:00
Louis Dionne
705d21f6ca Revert "[ci] Diff against main when determining what files have changed for pre-commit CI ()"
This reverts commit ec9d80ec43f5, since we are currently seeing tons of
CI jobs being triggered spuriously.
2023-10-02 11:02:47 -04:00
Louis Dionne
ec9d80ec43
[ci] Diff against main when determining what files have changed for pre-commit CI ()
Since we moved to Github PRs, the workflow has changed a bit and folks
often merge `main` back into their PR branch. This is fine, except the
previous way of determining modified files for pre-commit CI would use
the content modified just in the latest commit, whatever it is. This
means that in case someone merged main back into their PR branch, we'd
think that the files in the merge commit were modified by the PR, and
we'd spuriously trigger a CI run. This should fix this issue.

The downside is that the merge target is hardcoded to `main`, which
might not always be what we want. I still think this is an improvement
over the status quo.
2023-09-29 10:24:48 -04:00
Mikhail Goncharov
bcdba86f25 [ci] escape artifacts paths
That fixes issues like https://buildkite.com/llvm-project/github-pull-requests/builds/1350#018a8848-f70e-47f4-8aec-0bb48c49a7ca
2023-09-12 12:12:52 +02:00
Mikhail Goncharov
24846789f2
updated buildkite pipeline generation ()
- fixed build for linux (clang was missing)

- removed /monolithic-.. from build directory - it does not add anything
and makes path longer for windows which is not great;

- added env-based configuration to control cache and agent targeting;

- print (s)ccache stats to file not to pullute normal log.
2023-09-11 13:20:34 +02:00
Mikhail Goncharov
8149989532 enable new pipeline 2023-08-31 18:17:53 +02:00
Mikhail Goncharov
c81ab62273 update pipeline generation script
- Add control over "modified files" set and agent targeting rules. Mostly for testing purposes.

- Moved sections that outputs "steps" after functions

- Added step that report back to Phabricator

That will allow to replace step generation from invocation of script https://github.com/google/llvm-premerge-checks/blob/main/scripts/pipeline_premerge.py to plain call to ".ci/generate-buildkite-pipeline-premerge".

Differential Revision: https://reviews.llvm.org/D159280
2023-08-31 16:18:42 +02:00
Louis Dionne
cf1a3d9358 Implement the monolithic CI pipeline in the monorepo
This basically inlines the logic that was previously located in
https://github.com/google/llvm-premerge-checks so it is part of
the monorepo. This has the benefit of making it extremely easy
for individual projects to understand and modify this logic for
their own needs, unlike the current model where this logic lives
in a separate non-LLVM repository.

It also allows testing changes to the CI configuration using a simple
Phabricator review, since the code that defines the CI pipeline is taken
from the patch under review.

This (or something equivalent) is necessary if we want to retain the
current monolithic pre-commit CI throughout the GitHub PR transition.
Since triggering the monolithic CI is currently attached to the system
we use for triggering CI pipelines from Phabricator, we will lose that
part of the CI when we move to GitHub PRs if we don't do anything.

I've decided to rewrite the code as a shell script because the logic
was fairly simple and it seemed a lot easier than figuring out how to
pull only the relevant parts of llvm-premerge-checks into the monorepo.
Furthermore, I think we should strive to move away from the monolithic
CI altogether since sub-projects should understand, own and maintain the
tests that are relevant for them to run in the CI (with LLVM providing
the infrastructure). Hence, this is somewhat of a temporary solution
until monolithic CI is removed entirely.

Differential Revision: https://reviews.llvm.org/D158863
2023-08-29 13:31:19 -04:00
Louis Dionne
298f207e06 [ci] Make libc++ and Clang CI scripts independent
This simply moves existing CI-related scripts for Clang outside of libc++
to make the two projects independent with respect to CI.

The reason for making this change is that libc++'s CI pipeline history
was full of Clang runs, making it a lot harder to figure out information
about libc++'s own jobs. I created a pipeline for Clang and this patch
will run pre-commit CI for Clang inside that pipeline instead.

Differential Revision: https://reviews.llvm.org/D155078
2023-07-12 14:01:38 -04:00