incr.comp.: Move Metadata-hash loading to DepGraph. #44702
Labels
A-incr-comp
Area: Incremental compilation
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
WG-incr-comp
Working group: Incremental compilation
As of #44696, the
DepGraph
already has afingerprint_of()
method which allows to query the fingerprint associated with a givenDepNode
in the current compilation session. However, this method does not yet support retrieving the fingerprints ofDepKind::MetaData
dep-nodes. As opposed to the fingerprints for other kinds of dep-nodes, these are not computed during the current compilation session; they are rather already computed during the previous compilation session and stored in themetadata.bin
file in the exporting crate's incr.comp. session directory.Currently, this loading of these hashes from
metadata.bin
happens inrustc_incremental::persist::hash::HashContext
. To resolve this issue and gain copious amounts of ❤️s and 🎉s, move this loading logic toDepGraph::fingerprint_of()
.The loading should still happen as semi-lazily as it does now (although doing it more lazily via memory mapped files should be implemented at some point in the future) and for that the
DepGraph
will need to have access to the incr.comp. session directory. It would still be preferable if theDepGraph
did not keep a permanent reference to the wholeSession
, I think.There's some preliminary work for this task already done in https://github.com/michaelwoerister/rust/tree/metadata-hashes-in-dep-graph (note: this branch is based on top of #44696 and only the latest commit adds something new to that).
cc @alexcrichton @nikomatsakis
The text was updated successfully, but these errors were encountered: