-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Improve request evaluator cycle diagnostics #36375
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
base: main
Are you sure you want to change the base?
Conversation
9771a7c
to
1ef5414
Compare
@swift-ci please smoke test |
test/CircularReferences/Inputs/custom-modules/CircularLibrary.swift
Outdated
Show resolved
Hide resolved
Nice! |
637e534
to
0e13dba
Compare
@swift-ci please test |
The previous test case was very fragile and is, in itself, a bug we probably ought to fix. I've filed that bug as SR-14324 and added a command-line argument to the frontend which artificially creates a request cycle involving arbitrary types that we can diagnose. |
Build failed |
@swift-ci please test Linux platform |
Build failed |
Build failed |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
This commit makes the pretty-printing behavior of `DiagnosticEngine` easily accessible via a new `Decl::getLocByPrintingIfNeeded()` call and uses that call in various places related to `extractNearestSourceLoc()`, ultimately improving diagnostics for cycles involving serialized declarations. Note that the test case added here should probably not cause a circularity error; SR-14324 tracks this bug.
This commit implements a facility to artificially cause a request cycle involving various types so we can test how circularity errors print without having to carefully craft test cases where they happen.
0e13dba
to
b96a107
Compare
@swift-ci please smoke test |
@swift-ci please smoke test macOS platform |
This PR:
DiagnosticEngine
's declaration-pretty-printing facility to allow it to be used fromextractNearestSourceLoc()
, improving cycle diagnostics that were previously emitted at<invalid>:0
.-debug-cycles
output to indicate which request in the dumped stack was repeated.I haven't figured out how to test these changes yet, which is why this is still currently a WIP.