-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.WG-incr-compWorking group: Incremental compilationWorking group: Incremental compilation
Description
The dependency graph is loaded at the earliest point possibly during the compilation session (after the crate disambiguator has been set):
rust/src/librustc_driver/driver.rs
Line 654 in bd7021f
let dep_graph = if sess.opts.build_dep_graph() { |
However, it is only needed for the first time a few passes later:
rust/src/librustc_driver/driver.rs
Line 890 in bd7021f
let hir_crate = lower_crate(sess, cstore, &dep_graph, &krate, &mut resolver); |
This was intentional so that we have to possibility to load and decode it the graph on a background thread. One way to implement this is to make rustc_incremental::load_dep_graph()
start a new thread and return the thread::JoinHandle
and then only join that thread right before the dep-graph is actually needed.
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.WG-incr-compWorking group: Incremental compilationWorking group: Incremental compilation