2
2
3
3
## Which jobs we run
4
4
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
6
6
platforms] [ platforms ] we support. We currently have two kinds of jobs running
7
7
for each commit we want to merge to master:
8
8
@@ -26,14 +26,14 @@ platform’s custom Docker container. This has a lot of advantages for us:
26
26
underlying image (switching from the trusty image to xenial was painless for
27
27
us).
28
28
- 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.
30
30
- We can avoid reinstalling tools (like QEMU or the Android emulator) every
31
31
time thanks to Docker image caching.
32
32
- Users can run the same tests in the same environment locally by just running
33
33
` src/ci/docker/run.sh image-name ` , which is awesome to debug failures.
34
34
35
35
We 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
37
37
everything inside QEMU or just cross-compile if we don’t want to run the tests
38
38
for that platform.
39
39
@@ -63,10 +63,10 @@ Since the merge commit is based on the latest master and only one can be tested
63
63
at the same time, when the results are green master is fast-forwarded to that
64
64
merge commit.
65
65
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
67
67
hours for a full run), means we can’t merge too many PRs in a single day, and a
68
68
single 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 .
70
70
71
71
[ bors ] : https://github.com/bors
72
72
[ homu ] : https://github.com/rust-lang/homu
@@ -96,31 +96,26 @@ same time, even if there is a normal PR in progress.
96
96
97
97
## Which branches we test
98
98
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
102
102
103
103
### PR builds
104
104
105
105
All the commits pushed in a PR run a limited set of tests: a job containing a
106
106
bunch 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
108
108
two builders are enough to catch most of the common errors introduced in a PR,
109
109
but they don’t cover other platforms at all. Unfortunately it would take too
110
110
many resources to run the full test suite for each commit on every PR.
111
111
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
113
113
builder is run.
114
114
115
115
### The ` try ` branch
116
116
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.
124
119
125
120
### The ` auto ` branch
126
121
@@ -138,23 +133,19 @@ below).
138
133
### Other branches
139
134
140
135
Other 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.
144
137
145
138
## Caching
146
139
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.
148
141
All our caching is uploaded to an S3 bucket we control
149
142
(` rust-lang-ci-sccache2 ` ), and it’s used mainly for two things:
150
143
151
144
### Docker images caching
152
145
153
146
The 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 ` ).
158
149
159
150
Since we test multiple, diverged branches (` master ` , ` beta ` and ` stable ` ) we
160
151
can’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.
175
166
176
167
During the years we developed some custom tooling to improve our CI experience.
177
168
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
-
189
169
### Rust Log Analyzer to show the error message in PRs
190
170
191
171
The build logs for ` rust-lang/rust ` are huge, and it’s not practical to find
@@ -204,19 +184,18 @@ saw before.
204
184
205
185
### Toolstate to support allowed failures
206
186
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).
211
193
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.
220
199
221
200
While tool failures are allowed most of the time, they’re automatically
222
201
forbidden 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.
226
205
More information is available in the [ toolstate documentation] .
227
206
228
207
[ 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