-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
I'm finding that repeated runs using clang-tidy
is not caching the report. This means that even with unchanged source files, clang-tidy is running on everything for several minutes.
I'm trying to figure out if this is expected behavior, or if I have a config error somewhere.
I'm using the tool with a hermetic clang toolchain, with the following bazelrc
:
# Enable the clang-tidy aspect
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --output_groups=report
# Override the .clang-tidy config file target
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=//:clang_tidy_config
# Use hermetic clang-tidy binary
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_executable=@llvm-project//clang-tools-extra/clang-tidy:clang-tidy
# Provide builtin headers (resource dir)
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_resource_dir=@llvm-project//clang:builtin_headers_gen
In my project, bazel build cache is used when I run:
bazel build //lib/... \
--config=clang-tidy
However, it always run the full clang-tidy checks again on every source file, even if I haven't changed any of the files.
INFO: Invocation ID: 41278bac-7ea8-4f69-ada2-b2490977cc13
INFO: Analyzed 7 targets (0 packages loaded, 0 targets configured).
[85 / 95] 10 actions running
Run clang-tidy on lib/writer.cpp; 260s disk-cache, darwin-sandbox
Run clang-tidy on lib/writer.hpp; 260s disk-cache, darwin-sandbox
Run clang-tidy on lib/tests/writer_tests.cpp; 260s disk-cache, darwin-sandbox
...
There are some outputs inside my bazel-bin
, but I'm unsure if those are relevant to the caching:
find . -name '*clang_tidy*'
./lib/tests/bazel_clang_tidy_lib
./lib/bazel_clang_tidy_lib
Metadata
Metadata
Assignees
Labels
No labels