Closed
Description
We've been plauged today with problems related to the error index tests. Today the way these tests work are:
- During compiling a crate with error codes, extra diagnostic information is emitted to a
tmp/
directory. - Later the
error_index_generator
program runs, processing this diagnostic information and generatingerror-index.md
- Then rustdoc is used to test this markdown file.
This setup is brittle for a few reasons:
- Running the error index generator doesn't actually depend on the compilations of each crate, so you just have to conveniently sequence it after compiles have finished to get it to actually work.
- The probing logic of the error index generator is not precise, it simply slurps up anything that looks like diagnostics. This means that if there's a bad or stale diagnostic file it'll get slurped up nonetheless.
- Emitting files always has fun complications when you run processes concurrently, and this in the past forced us to fix this emission for multi-host builds (e.g. the nightlies)
The compiler should not jettison json files out the back when compiling and instead the error index generator should process the diagnostics directly. This sidesteps sequencing problems, stale problems, etc, and should be more robust.