-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Print reason for requiring resolution in verbose mode #3688
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
Conversation
@swift-ci please smoke test |
This actually needs an update, I just found that there's an existing mechanism for this |
Should this only be for verbose mode? It seems that with this error, it's useful to always know the reason. |
@abertelrud I was thinking we only do it in verbose mode initially in case we still want to work on the formatting of the output, but considering this goes to |
I do prefer providing minimal regular information, but in the case of this error, it seems useful to me to have the extra output. Since it's in main we can iterate on it. The alternative is that people have to re-run with verbose mode, and that's suboptimal when looking at CI output (less easy to rerun the command with extra flags). |
70262ab
to
2265fc5
Compare
Changed this now by moving the existing code for pretty printing |
@swift-ci please smoke test |
Ah the existing tests for the diagnostics need an update. |
Looks like the values of |
So I guess we have two options:
I'm kind of tending towards option 1, since this seems like a strict improvement even with the non-determinism. What do others think? |
It depends on how much effort making it deterministic would be. I usually prefer incremental improvements, since deeper dives sometimes get shelved when more urgent things come along and then nothing has improved. So in that spirit I would go for 1, but it would be great to later try to make it deterministic. |
It looks like the problem is that despite the |
2265fc5
to
89d007a
Compare
@swift-ci please smoke test |
Updated this now to go with option 1 and filed a follow-up radar for the non-determinism. |
@swift-ci smoke test |
This moves the existing code for printing a `WorkspaceResolveReason` and always appends it to the diagnostic for an out-of-date required resolved file.
89d007a
to
a385e62
Compare
@swift-ci smoke test |
This moves the existing code for printing a `WorkspaceResolveReason` and always appends it to the diagnostic for an out-of-date required resolved file.
When running SwiftPM while requiring a resolved file, print some more verbose info on why SwiftPM decided the existing file was out-of-date or why a resolved file was required.
Motivation:
We have been seeing some unexplained issues in CI related to resolved files where this would help us to debug them. It can also generally be helpful for folks.
Modifications:
If resolution is required and we are in verbose mode, append a reason to the diagnostic about the resolved file being out-of-date.
Result:
This is a pretty basic translation from
WorkspaceResolveReason
into prose which may need some improvements in the future, but it's a start at least.