buildcache
buildcache copied to clipboard
gcc_wrapper: Skip the -MF <file> argument.
If the -MF argument is present in the build command, it's because the caller uses dependency files. If we call the preprocessor command with -MF at this point, we will overwrite that file including our temporary preprocessed file in that dependency list. Hence we make sure to skip that when preprocessing.
The resoning here is that we should not produce arbitrary output, and that includes the file output from -MF.
One thing that needs to be checked is whether or not dependency files are generated on cache hits. I'm worried about #111 that I think is related to this PR, and #193. Originally posted by @mbitsnbites in https://github.com/mbitsnbites/buildcache/issues/209#issuecomment-805650521
Sorry for the delay... I think that this PR is correct - but it may have side effects that break existing build systems. I intend to test this more thoroughly before merging.