-
Notifications
You must be signed in to change notification settings - Fork 13k
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.: Do not hard-wire DepGraph into Session and CrateStore. #44390
Comments
@michaelwoerister should the After #44142 lands then 100% of the existing cstore methods are now queries (yay!) or otherwise don't need to be tracked. |
Ideally the "raw" CrateStore implementation would not know anything about the DepGraph anymore, just the queries (if that's possible). |
Ok! Sounds like a "yes" |
I have a commit for completely removing |
rustc: Remove `DepGraph` handling from rustc_metadata This should now be entirely tracked through queries, so no need to have a `DepGraph` in the `CStore` object any more! cc #44390
…aelwoerister rustc: Make `CrateStore` private to `TyCtxt` This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself. cc rust-lang#44390 cc rust-lang#44341 (initial commit pulled and rebased from here)
…aelwoerister rustc: Make `CrateStore` private to `TyCtxt` This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself. cc rust-lang#44390 cc rust-lang#44341 (initial commit pulled and rebased from here)
This commit removes the `dep_graph` field from the `Session` type according to issue rust-lang#44390. Most of the fallout here was relatively straightforward and the `prepare_session_directory` function was rejiggered a bit to reuse the results in the later-called `load_dep_graph` function. Closes rust-lang#44390
…elwoerister rustc: Remove `Session::dep_graph` This commit removes the `dep_graph` field from the `Session` type according to issue #44390. Most of the fallout here was relatively straightforward and the `prepare_session_directory` function was rejiggered a bit to reuse the results in the later-called `load_dep_graph` function. Closes #44390
In the current setup, we create the
DepGraph
very early, so it can be put into theCrateStore
and theSession
object. This means that we construct theDepGraph
long before we have enough information to know where to load the previousDepGraph
from and, because theCrateStore
is used very early too, we are registering dep-nodes and edges before the graph is fully operational. This is ugly but harmless in the current implementation. In the new tracking system it would become a problem.So the plan is to construct the
DepGraph
only when we can already load the previousDepGraph
. This needs some refactoring:dep_graph
field fromSession
, - rustc: RemoveSession::dep_graph
#44502dep_graph
field fromCStore
and don't do any dependency tracking in the regularCStore
implementation. - rustc: RemoveDepGraph
handling from rustc_metadata #44418CrateStore
private toTyCtxt
#44420CrateStore
wrapper that does dependency tracking and make only that available viatcx.cstore()
, and - Migrate a slew of metadata methods to queries #44142CrateStore
access go through queries. - Migrate a slew of metadata methods to queries #44142librustc_incremental::persist::fs::prepare_session_directory()
to not need thetcx
and invoke it right after parsing, when we know the definitive crate name. - rustc: RemoveSession::dep_graph
#44502DepGraph
construction to right afterlibrustc_incremental::persist::fs::prepare_session_directory()
has been called. - rustc: RemoveSession::dep_graph
#44502Any work in this direction will want to be based on top of
#44341the master branch.The text was updated successfully, but these errors were encountered: