Make setup_dep_graph incremental-only and more straightforward #154529
Open
Zalathar wants to merge 3 commits intorust-lang:mainfrom
Open
Make setup_dep_graph incremental-only and more straightforward #154529Zalathar wants to merge 3 commits intorust-lang:mainfrom
setup_dep_graph incremental-only and more straightforward #154529Zalathar wants to merge 3 commits intorust-lang:mainfrom
Conversation
Moving this code here makes the subsequent cleanup easier.
The existing code contains some very strange control flow that can put the dep graph into an inconsistent and untested state if streaming output setup fails. (Specifically, that failure would put `DepGraph` into an "empty" state intended for non-incremental compilation, but other parts of the compiler would still think that incremental mode is enabled due to `sess.opts.incremental`.) This commit therefore performs a big overhaul of `setup_dep_graph` by: - Returning immediately in non-incremental mode. - Exiting immediately if dep-graph streaming output couldn't be set up. - Inlining some "helper" functions that were more confusing than helpful.
- Make the enum non-public - Replace the generic `<T>` with concrete fields - Rename variant `LoadDepGraph` to `IoError`
Collaborator
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing code contains some very strange control flow that can put the dep graph into an inconsistent and untested state if streaming output setup fails.
(Specifically, that failure would put
DepGraphinto an "empty" state intended for non-incremental compilation, but other parts of the compiler would still think that incremental mode is enabled due tosess.opts.incremental.)This PR therefore performs a big overhaul of
setup_dep_graphby: