[clang][modules] Detect invalidation of SDKSettings.json #10661
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 input file section in module files only stores files loaded into the
SourceManager
. When rebuilding the module cache, include-trees also include other files, like the SDKSettings.json file. If we don't invalidate the module cache when that file changes, the corresponding include-trees won't agree with the primary TU include-tree on the file contents. This PR makes it so that we do track that file in module files, triggering module cache and therefore include-tree rebuilds, which makes the whole system have a consistent view of the file.The is implemented by loading the SDKSettings.json file into
SourceManager
. Note that this doesn't handle all other extra files contained in the include-tree, because I don't think this is a reasonable long-term solution, but the SDKSettings.json file is the one immediately causing issues.I intentionally suppress reporting of this new file in tests, so that I don't have go updating ~all of them. This file is getting reported by the scanning C API, so that the build system is given the ability to eventually act on this file being out-of-date.
rdar://149868539