[Serialization] Intro -Rmodule-recovery
to remark on inconsistencies in swiftmodule files
#66139
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.
Deserialization recovery is a long standing feature designed to support reading from swiftmodule files despite small context changes. It is expected for recovery to drop errors related to Swift language version differences or cross-references to implementation-only imported modules. However, it also attempts to recover from project configuration issues, which can lead to unexpected behavior like silently dropping a function because it relies on a type that can't be deserialized. These issues used to be hard to investigate for the general developer.
To improve the situation, this PR introduces the flag
-Rmodule-recovery
that will display remarks when recovery drops a decl for any reason.This follows #65713 that introduced the errors that can now be also displayed as remarks. Next I'll add contextual notes and try to improve how we display these diagnostics.