-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make try_mark_previous_green aware of cycles. #66846
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
bug!("try_mark_previous_green() - Forcing the DepNode \ | ||
should have set its color") | ||
} else { | ||
// If the query we just forced has resulted | ||
// in some kind of compilation error, we | ||
// don't expect that the corresponding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I do not grasp the reasons of this expectation.
But whatever they are, seems the test is a counter-example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should be re-worded to "If the query we just forced has resulted in some kind of compilation error, we cannot rely on the dep-node color having been properly updated."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To elaborate: Forcing a query (as we have done when reaching this point in the code) must update the colors
table with an entry for that query invocation. Reaching the None
branch here means that we did not find the expected entry in the table, so we abort compilation with the bug!
. However, there seem to be cases when something generated an error while forcing the query where table is not updated. This is supposedly harmless (although it would be great to find out how that happens exactly) because once an error has occurred we don't persist anything to the incremental cache.
So the comment should expanded to something like:
// If the query we just forced has resulted in
// some kind of compilation error, we cannot rely on
// the dep-node color having been properly updated.
// This means that the query system has reached an
// invalid state. We let the compiler continue (by
// returning `None`) so it can emit error messages
// and wind down, but rely on the fact that this
// invalid state will not be persisted to the
// incremental compilation cache because of
// compilation errors being present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the new behavior of returning instead of continuing marking is definitely an improvement!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that makes sense now!
Thanks for the PR, @gizmondo! I should be able to take a closer look next week. |
ping from triage: |
@gizmondo If you update the comment as suggested, I'm happy to r+ this. |
@bors r+ |
📌 Commit de255a9 has been approved by |
⌛ Testing commit de255a9 with merge a1d84a0c2517186b85cc2a6a6984cb8ec92c4954... |
Make try_mark_previous_green aware of cycles. Fixes rust-lang#61323 r? @michaelwoerister
@bors retry rolled up |
Rollup of 11 pull requests Successful merges: - #66846 (Make try_mark_previous_green aware of cycles.) - #66959 (Remove potential cfgs duplicates) - #66988 (Fix angle bracket formatting when dumping MIR debug vars) - #66998 (Modified the testcases for VxWorks) - #67008 (rustdoc: Add test for fixed issue) - #67023 (SGX: Fix target linker used by bootstrap) - #67033 (Migrate to LLVM{Get,Set}ValueName2) - #67049 (Simplify {IoSlice, IoSliceMut}::advance examples and tests) - #67054 (codegen "unreachable" for invalid SetDiscriminant) - #67081 (Fix Query type docs) - #67085 (Remove boxed closures in address parser.) Failed merges: r? @ghost
Fixes #61323
r? @michaelwoerister