Stream the dep-graph to a file instead of storing it in-memory. This is a reimplementation of #60035. Instead of storing the dep-graph in-memory, the nodes are encoded as they come into the a temporary file as they come. At the end of a successful the compilation, this file is renamed to be the persistent dep-graph, to be decoded during the next compilation session. This two-files scheme avoids overwriting the dep-graph on unsuccessful or crashing compilations. The structure of the file is modified to be the sequence of `(DepNode, Fingerprint, EdgesVec)`. The deserialization is responsible for going to the more compressed representation. The `node_count` and `edge_count` are stored in the last 16 bytes of the file, in order to accurately reserve capacity for the vectors. At the end of the compilation, the encoder is flushed and dropped. The graph is not usable after this point: any creation of a node will ICE. I had to retrofit the debugging options, which is not really pretty.
For more information about how rustc works, see the rustc dev guide.