buildcache icon indicating copy to clipboard operation
buildcache copied to clipboard

gcc_wrapper: Skip the -MF <file> argument.

Open farre opened this issue 3 years ago • 3 comments

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.

farre avatar Mar 24 '21 12:03 farre

The resoning here is that we should not produce arbitrary output, and that includes the file output from -MF.

farre avatar Mar 24 '21 14:03 farre

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

farre avatar Mar 24 '21 15:03 farre

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.

mbitsnbites avatar Apr 13 '21 10:04 mbitsnbites