Reword and correct the preprocessor cache mode documentation#2362
Reword and correct the preprocessor cache mode documentation#2362sylvestre merged 4 commits intomozilla:mainfrom
Conversation
1fb6e20 to
fae1c11
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2362 +/- ##
==========================================
- Coverage 67.06% 67.06% -0.01%
==========================================
Files 64 64
Lines 34718 34718
==========================================
- Hits 23285 23284 -1
- Misses 11433 11434 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0c44acb to
ba85488
Compare
|
Draft because: The second commit needs review from someone who understands preprocessor cache mode! I think this explanation is much clearer, but I don't know if it is actually true. The previous text mentioned "caching the preprocessor result", but that doesn't seem to make any sense. If the preprocessor result is the same, compilation can be trivially skipped as well (except if only the compiler ID changed, seems to be a bit of a long shot). So I think what is actually happening is skipping from input files to output files directly if there is a cached result, not skipping anything if there is a cache miss. |
docs/Local.md
Outdated
| In non-preprocessor cache mode, sccache's compilation pipeline for one C/C++ source file is inputs → preprocessing → cache lookup → (return outputs if cached / compilation otherwise). In preprocessor cache mode, the compilation pipeline is inputs → cache lookup → (return outputs if cached / preprocessing → compilation otherwise). This can make it much faster to return compilation outputs from cache. | ||
|
|
||
| In order to cache the preprocessor step, [sccache] needs to remember, among other things, all files included by a given input file. To quote ccache's documentation: | ||
| To ensure that the cached outputs for a source file correspond to the un-preprocessed inputs, [sccache] needs to remember, among other things, all files included by that source file (i.e. the complete set of inputs). To quote ccache's documentation: |
There was a problem hiding this comment.
I'd be explicit about the issue with __TIME__ and __DATE__ macros and the config flag that allows one to handle the trade-off.
There was a problem hiding this comment.
Well, have a look now, I now mention the full list in two places but not everywhere.
drahnr
left a comment
There was a problem hiding this comment.
I think it needs one more pass to achieve its goal, the direction is good!
Thank you!
|
If you take a look into the code (older ref) Line 335 in cbe79c9 Box<dyn Compilation> type utilizing the preprocessor output as input for the C compiler.
|
f8f6125 to
56dbedb
Compare
56dbedb to
5d0838b
Compare
|
@ahartmetz is this ready for a review pass? |
The correction is that there is a *long* list of compiler options that disable preprocessor cache mode.
Most importantly, group similar things together. Also improve some of the wording and document previously undocumented restrictions. The list of restrictions is a little ridiculous at this point, but I'm trying to do something about it.
5d0838b to
ffc6335
Compare
It is now. |
The correction is that there is a long list of compiler options that disable preprocessor cache mode.