Merged
Conversation
sccache has two modes: - normal mode - preprocessor cache mode (aka direct mode in ccache) In the former case, the preprocessor is invoked and creates the dep file itself. Whatever sccache does after that is going to overwrite a fresh file with potentially wrong information, since the cache key is not indexed on the elements that would affect the contents of the dep file, resulting in issue mozilla#2321. In the latter case, sccache currently doesn't handle the situation appropriately (issue mozilla#2194), which is why preprocessor cache mode is automatically disabled when the dependency flags are on the command line (mozilla#2195). Which also means we fallback to the case above.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2322 +/- ##
==========================================
- Coverage 30.91% 0 -30.92%
==========================================
Files 53 0 -53
Lines 20112 0 -20112
Branches 9755 0 -9755
==========================================
- Hits 6217 0 -6217
+ Misses 7922 0 -7922
+ Partials 5973 0 -5973 ☔ View full report in Codecov by Sentry. |
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
May 18, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A better fix will work as follows: - Always store the dep file in the cache - In non-preprocessor cache mode, which doesn't consider things like file name and included file names, so it can confuse cache entries with same preprocessed content but different dep files: do not restore the dep file. It is not necessary anyway because local preprocessing will produce the file. - In preprocessor cache mode, which uses input file names and hashes to distinguish cache entries, but does not run the preprocessor: *do* restore the dep file.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
May 24, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A better fix will work as follows: - Always store the dep file in the cache - In non-preprocessor cache mode, which doesn't consider things like file name and included file names, so it can confuse cache entries with same preprocessed content but different dep files: do not restore the dep file. It is not necessary anyway because local preprocessing will produce the file. - In preprocessor cache mode, which uses input file names and hashes to distinguish cache entries, but does not run the preprocessor: *do* restore the dep file. It is both safe and necessary.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jun 1, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jun 11, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jun 21, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
sylvestre
pushed a commit
to ahartmetz/sccache
that referenced
this pull request
Jun 23, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 7, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 7, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. A fix that is better than disabling preprocessor cache mode whenever the compiler generates a dep file seems possible.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 7, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 7, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 7, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 8, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 8, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 9, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 9, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 9, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 9, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Jul 11, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
ahartmetz
added a commit
to ahartmetz/sccache
that referenced
this pull request
Aug 4, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
sylvestre
pushed a commit
that referenced
this pull request
Aug 4, 2025
This reverts the "main" code changes of commit c0a0b6e but keeps the added test. That commit fixed getting wrong dep files from cache in non preprocessor cache mode, but made it impossible to support dep files in preprocessor cache mode. We can do better.
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
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.
sccache has two modes:
In the former case, the preprocessor is invoked and creates the dep file itself. Whatever sccache does after that is going to overwrite a fresh file with potentially wrong information, since the cache key is not indexed on the elements that would affect the contents of the dep file, resulting in issue #2321.
In the latter case, sccache currently doesn't handle the situation appropriately (issue #2194), which is why preprocessor cache mode is automatically disabled when the dependency flags are on the command line (#2195). Which also means we fallback to the case above.