22
33## Which jobs we run
44
5- The ` rust-lang/rust ` repository uses Azure Pipelines to test [ all the other
5+ The ` rust-lang/rust ` repository uses GitHub Actions to test [ all the other
66platforms] [ platforms ] we support. We currently have two kinds of jobs running
77for each commit we want to merge to master:
88
@@ -26,14 +26,14 @@ platform’s custom Docker container. This has a lot of advantages for us:
2626 underlying image (switching from the trusty image to xenial was painless for
2727 us).
2828- We can use ancient build environments to ensure maximum binary compatibility,
29- for example [ using CentOS 5 ] [ dist-x86_64-linux ] on our Linux builders.
29+ for example [ using CentOS 7 ] [ dist-x86_64-linux ] on our Linux builders.
3030- We can avoid reinstalling tools (like QEMU or the Android emulator) every
3131 time thanks to Docker image caching.
3232- Users can run the same tests in the same environment locally by just running
3333 ` src/ci/docker/run.sh image-name ` , which is awesome to debug failures.
3434
3535We also run tests for less common architectures (mainly Tier 2 and Tier 3
36- platforms) on Azure Pipelines . Since those platforms are not x86 we either run
36+ platforms) in CI . Since those platforms are not x86 we either run
3737everything inside QEMU or just cross-compile if we don’t want to run the tests
3838for that platform.
3939
@@ -63,10 +63,10 @@ Since the merge commit is based on the latest master and only one can be tested
6363at the same time, when the results are green master is fast-forwarded to that
6464merge commit.
6565
66- Unfortunately testing a single PR at the time, combined with our long CI (~ 3.5
66+ Unfortunately testing a single PR at the time, combined with our long CI (~ 3
6767hours for a full run), means we can’t merge too many PRs in a single day, and a
6868single failure greatly impacts our throughput for the day. The maximum number
69- of PRs we can merge in a day is 7 .
69+ of PRs we can merge in a day is around 8 .
7070
7171[ bors ] : https://github.com/bors
7272[ homu ] : https://github.com/rust-lang/homu
@@ -96,31 +96,26 @@ same time, even if there is a normal PR in progress.
9696
9797## Which branches we test
9898
99- Our builders are defined in ` src/ci/azure-pipelines/ ` , and they depend on the
100- branch used for the build. Each job is configured in one of the top ` .yml `
101- files.
99+ Our builders are defined in [ ` src/ci/github-actions/ci.yml ` ] .
100+
101+ [ `src/ci/github-actions/ci.yml` ] : https://github.com/rust-lang/rust/blob/master/src/ci/github-actions/ci.yml
102102
103103### PR builds
104104
105105All the commits pushed in a PR run a limited set of tests: a job containing a
106106bunch of lints plus a cross-compile check build to Windows mingw (without
107- producing any artifacts) and the ` x86_64-gnu-llvm-6.0 ` non-dist builder. Those
107+ producing any artifacts) and the ` x86_64-gnu-llvm-13 ` non-dist builder. Those
108108two builders are enough to catch most of the common errors introduced in a PR,
109109but they don’t cover other platforms at all. Unfortunately it would take too
110110many resources to run the full test suite for each commit on every PR.
111111
112- Additionally, if the PR changes submodules the ` x86_64-gnu-tools ` non-dist
112+ Additionally, if the PR changes certain tools, the ` x86_64-gnu-tools ` non-dist
113113builder is run.
114114
115115### The ` try ` branch
116116
117- On the main rust repo try builds produce just a Linux toolchain. Builds on
118- those branches run a job containing the lint builder and both the dist and
119- non-dist builders for ` linux-x86_64 ` . Usually we don’t need ` try ` builds for
120- other platforms, but on the rare cases when this is needed we just add a
121- temporary commit that changes the ` src/ci/azure-pipelines/try.yml ` file to
122- enable the builders we need on that platform (disabling Linux to avoid wasting
123- CI resources).
117+ On the main rust repo, ` try ` builds produce just a Linux toolchain using the
118+ ` dist-x86_64-linux ` image.
124119
125120### The ` auto ` branch
126121
@@ -138,23 +133,19 @@ below).
138133### Other branches
139134
140135Other branches are just disabled and don’t run any kind of builds, since all
141- the in-progress branches will eventually be tested in a PR. We try to encourage
142- contributors to create branches on their own fork, but there is no way for us
143- to disable that.
136+ the in-progress branches will eventually be tested in a PR.
144137
145138## Caching
146139
147- The main rust repository doesn’t use the native Azure Pipelines caching tools.
140+ The main rust repository doesn’t use the native GitHub Actions caching tools.
148141All our caching is uploaded to an S3 bucket we control
149142(` rust-lang-ci-sccache2 ` ), and it’s used mainly for two things:
150143
151144### Docker images caching
152145
153146The Docker images we use to run most of the Linux-based builders take a * long*
154- time to fully build: every time we need to build them (for example when the CI
155- scripts change) we consistently reach the build timeout, forcing us to retry
156- the merge. To avoid the timeouts we cache the exported images on the S3 bucket
157- (with ` docker save ` /` docker load ` ).
147+ time to fully build. To speed up the build, we cache the exported images on the
148+ S3 bucket (with ` docker save ` /` docker load ` ).
158149
159150Since we test multiple, diverged branches (` master ` , ` beta ` and ` stable ` ) we
160151can’t rely on a single cache for the images, otherwise builds on a branch would
@@ -175,17 +166,6 @@ we do with our S3 bucket.
175166
176167During the years we developed some custom tooling to improve our CI experience.
177168
178- ### Cancelbot to keep the queue short
179-
180- We have limited CI capacity on Azure Pipelines, and while that’s enough for a
181- single build we can’t run more than one at the time. Unfortunately when a job
182- fails the other jobs on the same build will continue to run, limiting the
183- available capacity. To avoid the issue we have a tool called [ cancelbot] that
184- runs in cron every 2 minutes and kills all the jobs not related to a running
185- build through the API.
186-
187- [ cancelbot ] : https://github.com/rust-lang/rust-central-station/tree/master/cancelbot
188-
189169### Rust Log Analyzer to show the error message in PRs
190170
191171The build logs for ` rust-lang/rust ` are huge, and it’s not practical to find
@@ -204,19 +184,18 @@ saw before.
204184
205185### Toolstate to support allowed failures
206186
207- The ` rust-lang/rust ` repo doesn’t only test the compiler on its CI, but also
208- all the tools distributed through rustup (like miri). Since
209- those tools rely on the compiler internals (which don’t have any kind of
210- stability guarantee) they often break after the compiler code is changed.
187+ The ` rust-lang/rust ` repo doesn’t only test the compiler on its CI, but also a
188+ variety of tools and documentation. Some documentation is pulled in via git
189+ submodules. If we blocked merging rustc PRs on the documentation being fixed,
190+ we would be stuck in a chicken-and-egg problem, because the documentation's CI
191+ would not pass since updating it would need the not-yet-merged version of
192+ rustc to test against (and we usually require CI to be passing).
211193
212- If we blocked merging rustc PRs on the tools being fixed we would be stuck in a
213- chicken-and-egg problem, because the tools need the new rustc to be fixed but
214- we can’t merge the rustc change until the tools are fixed. To avoid the problem
215- most of the tools are allowed to fail, and their status is recorded in
216- [ rust-toolstate] . When a tool breaks a bot automatically pings the tool authors
217- so they know about the breakage, and it records the failure on the toolstate
218- repository. The release process will then ignore broken tools on nightly,
219- removing them from the shipped nightlies.
194+ To avoid the problem, submodules are allowed to fail, and their status is
195+ recorded in [ rust-toolstate] . When a submodule breaks, a bot automatically
196+ pings the maintainers so they know about the breakage, and it records the
197+ failure on the toolstate repository. The release process will then ignore
198+ broken tools on nightly, removing them from the shipped nightlies.
220199
221200While tool failures are allowed most of the time, they’re automatically
222201forbidden a week before a release: we don’t care if tools are broken on nightly
@@ -226,4 +205,4 @@ few days before we promote nightly to beta.
226205More information is available in the [ toolstate documentation] .
227206
228207[ rust-toolstate ] : https://rust-lang-nursery.github.io/rust-toolstate
229- [ toolstate documentation ] : https://forge.rust-lang.org/infra/ toolstate.html
208+ [ toolstate documentation ] : ../ toolstate.md
0 commit comments