-
Notifications
You must be signed in to change notification settings - Fork 480
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
PCH timestamp is not restored / ignored #549
Comments
I'm not so sure about that since that isn't how a compiler behaves: too my knowledge a compiler always creates files with a fresh timestamp. If ccache would remember the timestamp of There is a sloppiness value called |
|
Adding The log file contained: The log file is here. Adding Actually I would like to have ccache ignore the timestap of the Otherwise storing a gch file, which afterwards gets re-generated is just a waste of space. |
Ah, I forgot about include_file_ctime. Could you provide a cache miss log with include_file_ctime set as well? I would have expected it to work and I don't see how mtime or ctime could have the effect the outcome if both include_file_mtime and include_file_ctime are set.
Right, I now see the (or at least a) problem: The "include file too new" checks in do_remember_include_file are not supposed to be made for the main (header) file when precompiling a header. I think that ccache may get sidetracked by the use of Note that the log talks about too new
The "include file mtime/ctime" checks only affect the direct mode, so I would expect there to be preprocessed cache hits during ≈1 second and then direct mode hits. Thus I suspect that the real problem is something else. To find out what you could try enabling debug mode and comparing the NB: I don't use PCH headers myself so I have to refresh my memory each time a question arises. I may very well be missing something. Maybe #160 is related to your problem? |
|
As it turns out I was using a different cmake-dev version, which didn't have the MR #4400 PCH: Copy the timestamp from an absolute header file in. Now I've retested with I would also like to point out that I've backported my CMake changes to I still have to backport my Visual C++ changes, and I will try to re-release the 3.7.6 and 3.7.7 versions as they should be. |
|
OK, thanks for the update! |
How to reproduce
While working on CMake's MR #4400 PCH: Copy the timestamp from an absolute header file I've noticed that ccache is not restoring the timestamp of the cached PCH file.
I tested with #MR4400 and gcc and a Hello World application:
pch.hpp
CMakeLists.txt
With the following ccache results:
Actual behavior
The preprocessed file is from ccache not restoring the timestamp of the
cmake_pch.gchfile:Expected behavior
ccache should have restored the PCH file timestamp, and have a direct hit for the source file.
Environment
I used my own master (wrong 3.7.7) ccache build.
MinGW GCC.
The text was updated successfully, but these errors were encountered: