[ccache] Speeding up builds with clang-tidy, clang-analyzer and iwyu

Steffen Dettmer steffen.dettmer at gmail.com
Fri Dec 4 16:00:53 UTC 2020


On Sun, Aug 2, 2020 at 6:55 PM Christian Ledergerber via ccache <
ccache at lists.samba.org> wrote:
> for our builds currently clang-tidy is currently the limiting factor in
> terms of speed.
> There is one utility out there which tries to cache the output of
> clang-tidy, however it seems to be stale:
> https://github.com/ejfitzgerald/clang-tidy-cache
> Yet, I have the impression that my case is much simpler:

Do you have any new regarding caching clang-tidy?

Here we also occasionally discuss things and we found the following
opinions in our teams:
1) clang-tidy shall be in the IDE: it can apply fixes which needs
2) clang-tidy shall be a Jenkins job: When you are using it for a while,
number of warnings reduce a lot and it is not necessary to run it every time
3) clang-tidy shall be ran at every compilation: it is -Wall -Wextra -Wtidy
made correctly

For 3), which seems to be close to your use case, someone proposed in
context of a legacy project to run clang-tidy along with the compiler. The
discussed approach was to have a wrapper script to be used as a compiler,
but the wrapper script also called clang-tidy before it ran the compiler.

In this case, ccache would not call the compiler in case of a cache hit,
which here means it would not call the wrapper script and thus not
clang-tidy, so I think this could help you. Maybe.

(the idea was quickly discarded because there was absolutely no way to fix
the legacy code due to its ancient C++ and we joked about adding a
--museum-mode to clang-tidy :))


More information about the ccache mailing list