Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incr.comp.: Move Metadata-hash loading to DepGraph. #44702

Closed
michaelwoerister opened this issue Sep 19, 2017 · 5 comments
Closed

incr.comp.: Move Metadata-hash loading to DepGraph. #44702

michaelwoerister opened this issue Sep 19, 2017 · 5 comments
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

Comments

@michaelwoerister
Copy link
Member

As of #44696, the DepGraph already has a fingerprint_of() method which allows to query the fingerprint associated with a given DepNode in the current compilation session. However, this method does not yet support retrieving the fingerprints of DepKind::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 the metadata.bin file in the exporting crate's incr.comp. session directory.

Currently, this loading of these hashes from metadata.bin happens in rustc_incremental::persist::hash::HashContext. To resolve this issue and gain copious amounts of ❤️s and 🎉s, move this loading logic to DepGraph::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 the DepGraph did not keep a permanent reference to the whole Session, 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

@michaelwoerister michaelwoerister added A-incr-comp Area: Incremental compilation WG-incr-comp Working group: Incremental compilation labels Sep 19, 2017
@aidanhs aidanhs added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Sep 19, 2017
@alexcrichton
Copy link
Member

I've got a commit at alexcrichton@cb48804 which does this, but I'll wait for #44696 to land before sending a PR

@michaelwoerister
Copy link
Member Author

Awesome, thank you!

@michaelwoerister
Copy link
Member Author

michaelwoerister commented Sep 21, 2017

@alexcrichton Do you mind if I pull your changes into a local branch of mine?
(EDIT: ...and then submit them as part of a larger PR)

@alexcrichton
Copy link
Member

Certainly!

@michaelwoerister
Copy link
Member Author

This is implemented as part of #44901.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants