forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 352
[clang][scan-deps] Add option to disable caching stat failures #11728
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author
|
@swift-ci please test |
|
@swift-ci please test llvm |
jansvoboda11
reviewed
Nov 3, 2025
clang/unittests/Tooling/DependencyScanning/DependencyScannerTest.cpp
Outdated
Show resolved
Hide resolved
96b090c to
1c00903
Compare
Author
|
@swift-ci please test |
Author
|
@swift-ci please test llvm |
1c00903 to
bbc7ed4
Compare
Author
|
@swift-ci please test llvm |
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
Outdated
Show resolved
Hide resolved
clang/unittests/Tooling/DependencyScanning/DependencyScannerTest.cpp
Outdated
Show resolved
Hide resolved
While the source code isn't supposed to change during a build, in some environments it does. This adds an option that disables caching of stat failures, meaning that source files can be added to the build during scanning. This adds a `-no-cache-negative-stats` option to clang-scan-deps to enable this behavior. There are no tests for clang-scan-deps as there's no reliable way to do so from it. A unit test has been added that modifies the filesystem between scans to test it. Internally this uses an environment variable. `CLANG_SCAN_CACHE_NEGATIVE_STATS`: If this is set or set to 1 negative stat caching is enabled. If it's 0 then it's disabled. Negative stat caching is disabled by default.
bbc7ed4 to
08f0acd
Compare
jansvoboda11
approved these changes
Nov 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While the source code isn't supposed to change during a build, in some environments it does. This adds an option that disables caching of stat failures, meaning that source files can be added to the build during scanning.
This adds a
-no-cache-negative-statsoption to clang-scan-deps to enable this behavior. There are no tests for clang-scan-deps as there's no reliable way to do so from it. A unit test has been added that modifies the filesystem between scans to test it.Internally this uses an environment variable.
CLANG_SCAN_CACHE_NEGATIVE_STATS: If this is set or set to 1 negative stat caching is enabled. If it's 0 then it's disabled.Negative stat caching is disabled by default.