Closed
Description
In the current setup, we create the DepGraph
very early, so it can be put into the CrateStore
and the Session
object. This means that we construct the DepGraph
long before we have enough information to know where to load the previous DepGraph
from and, because the CrateStore
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 previous DepGraph
. This needs some refactoring:
- Remove the
dep_graph
field fromSession
, - rustc: RemoveSession::dep_graph
#44502 - Remove the
dep_graph
field fromCStore
and don't do any dependency tracking in the regularCStore
implementation. - rustc: RemoveDepGraph
handling from rustc_metadata #44418 - Make sure that we do perform dependency tracking for anything within the query system, via a tasteful blend of: - Migrate a slew of metadata methods to queries #44142 and rustc: Make
CrateStore
private toTyCtxt
#44420- creating a
CrateStore
wrapper that does dependency tracking and make only that available viatcx.cstore()
, and - Migrate a slew of metadata methods to queries #44142 - making all
CrateStore
access go through queries. - Migrate a slew of metadata methods to queries #44142
- creating a
- Adapt
librustc_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
#44502 - Move
DepGraph
construction to right afterlibrustc_incremental::persist::fs::prepare_session_directory()
has been called. - rustc: RemoveSession::dep_graph
#44502
Any work in this direction will want to be based on top of #44341 the master branch.