-
Notifications
You must be signed in to change notification settings - Fork 635
Description
We currently return CannotCache(no output file) if a C compilation doesn't include -o output or the MSVC equivalent. Compilers use pretty simple rules to generate the output file here, we should just support that case. This shows up a lot in sccache logs from building servo because autoconf does this a lot. I'm not sure it will help much, but it should be easy to support and there's no good reason not to.
GCC's documentation says "By default, the object file name for a source file is made by replacing the suffix ‘.c’, ‘.i’, ‘.s’, etc., with ‘.o’. " MSVC's documentation says "If you do not use this option, the object file uses the base name of the source file and the .obj extension." Related: @vvuk mentioned to me that he had hit an issue because he was building a project with MSVC+sccache that used -Fosome\dir\, which I didn't know was a thing you could do (even though it's mentioned in the docs I just linked), which causes MSVC to generate the object file in some\dir with the default object file name.