Skip to content

Commit f0b5ac2

Browse files
committed
Document 'Continuous Integration', 'Compiler Diagnostics' in 'README.md'
1 parent f91f637 commit f0b5ac2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,45 @@ Please see the [Contributing to GCC](https://gcc.gnu.org/contribute.html) guide
202202
Not all contributions must be code; we would love to see new test cases or bugs and issues to be reported.
203203
Feel free to add any comments on open PRs
204204

205+
206+
## Continuous Integration
207+
208+
When submitting (or updating) a [GitHub Pull Request](https://github.com/Rust-GCC/gccrs/pull/),
209+
several automated checks are run.
210+
Generally, a "green status" is necessary before merge.
211+
212+
213+
### Compiler Diagnostics
214+
215+
That is, here, diagnostics emitted by the "initial" compiler used to build GCC/Rust.
216+
217+
If building a native toolchain,
218+
GCC by default does a 3-stage bootstrap build (<https://gcc.gnu.org/install/configure.html>).
219+
In addition to making sure that GCC is able to reproduce itself bit-by-bit,
220+
this also means that stages 2+ are built with `-Werror`
221+
(turning most _warning_ into _error_ diagnostics; see `--enable-werror`,
222+
possibly enabled by default).
223+
This helps to catch a good number of bugs, because it enforces that GCC compiles without compiler diagnostics;
224+
it's a requirement for upstream patch submission (<https://gcc.gnu.org/contribute.html#testing>).
225+
226+
GCC generally is only expected to be "warning-clean" without `--disable-bootstrap`
227+
(that is, default `--enable-bootstrap` for a native build),
228+
and not for the initial stage where it's using the "initial" compiler -- otherwise
229+
we're at the mercy of whatever "initial" compiler we're using.
230+
Doing a `--disable-bootstrap` build is much faster, of course, so we're often doing that:
231+
for example, per the instructions above, or in the standard CI.
232+
With that, we're missing out on the aspect that _enforces that GCC compiles without compiler diagnostics_.
233+
234+
To encounter that, the default CI has a [_check for new warnings_ step](https://github.com/Rust-GCC/gccrs/pull/1026)
235+
that verifies in the CI `--disable-bootstrap` build configuration that no new warnings are introduced.
236+
If that step fails, it usually points out a new _warning_ you've introduced erroneously, and should address.
237+
Occasionally it means that simply the `.github/bors_log_expected_warnings` file needs to be updated,
238+
for example if due to any kind of "environmental changes" (for example, CI "initial" compiler changes).
239+
Unless diligently reproducing the CI configuration (in particular "initial" compiler, GCC version),
240+
it's not really feasible to reproduce this check locally.
241+
If in doubt, do a local `--enable-bootstrap` build, or submit your changes, and wait for the CI system's results.
242+
243+
205244
## Community
206245

207246
We can be found on all usual Rust channels such as Zulip, but we also have our own channels:

0 commit comments

Comments
 (0)