mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.69k stars 540 forks source link

Incorrect .ninja_deps generated during cache hits #2228

Open njames93 opened 1 month ago

njames93 commented 1 month ago

Compiling a c(++) project using cmake with ninja and gcc and an unpopulated cache results in a correct compilation and the .ninja_deps file being populated.

However removing the build directory and re-running cmake and ninja create a .ninja_deps file that contains no dependencies for each translation unit.

This is breaking ninja's dependency tracking and results in edits to header files not causing any translation units that include those headers to be re-compiled

Environment

sylvestre commented 1 month ago

would it be possible to provide some STR ? thanks

njames93 commented 1 month ago

would it be possible to provide some STR ? thanks

Sorry a little confused by STR, Is this some kind of minimal reproducer?

AJIOB commented 2 weeks ago

It looks similar to my #2073 issue, that contains a workaround for similar case.

@njames93, can you recheck this, please