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
unexpected results when using -MD or -MMD compiler options #134
Comments
Is it possible that this issue also causes issue #133? I ask because I see the -MD switch used in the .cmd files the kernel build process creates. |
Thanks for the bug report and excellent reproduction example! This is regression introduced as a side effect of #88. First affected ccache version: 3.3. |
I haven't had time to look at #133 in detail yet (I have a two weeks old daughter that competes with my spare time), but my current guess is that #133 and #134 are unrelated. I think that your "there is another more hidden issue" problem in #133 might be caused by #134, though. |
5908e65 introduced a regression: If a source file is compiled in directory A and an identical source file in directory B results in a preprocessed hit, then the dependency file from the first compilation will be overwritten by the second compilation. Since the source path is part of the dependency file, an incorrect dependency file will be retrieved from the cache when recompiling the source in directory A. The solution is to include the source path part in the object hash if a dependency file is being generated. Fixes #134.
Fixed in ccache 3.3.2. |
This still doesn't work for situations where the source file stays in the same place, but the include paths change. Consider the following:
|
This is still broken in 3.3.3. Can this bug be reopened? |
Thanks! I hope to find time to have a look at this this weekend. |
I remember in mailing list of ccache were mentioned problems with kernel having zero hits on second fresh compilation: https://www.mail-archive.com/ccache@lists.samba.org/msg01055.html |
Don't think so, since this issue was a regression in ccache 3.3, which was released 2016, while the mail thread you refer to is from 2014.
Don't know. |
The resulting dependency file is not always correct when specifying the -MD or -MMD options to the compiler.
example:
The Ninja generator of CMake uses the
-MMD
compiler option to cache dependencies. This means that anyone using Ninja with a CMake project will encounter this bug if the source code is moved.The text was updated successfully, but these errors were encountered: