-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from bazel_clang_tidy
to aspect-build/rules_lint
for clang-tidy
validaton
#879
Conversation
This will allow using clang-tidy in `bazel test` targets, and different .clang-tidy files per directory. That will help with importing files from other repositories.
Test: bazel test '//...'
on my machine:
The jump in clean build times I am not so concerned about, but the incremental build jump is steep. Based on your last comment we could maybe split up some of our targets to get a speedup, but I would rather not make library structure decisions based on our tooling speeds. A quick search shows we could use something like I did test using https://bazel.build/docs/user-manual#build-tag-filters) I would prefer something like the |
The incremental build time is still good for specific targets like |
From our lunch conversations, I can just build the |
... as suggested by cjreynol@. This enables running ``` bazel build --build_tag_filters="-clang-tidy" "//..." ```
Added the "clang_tidy" and "clang-tidy" tags to enable this strategy. |
Thanks for reviewing! |
This comes with some tradeoffs:
.clang-tidy
files for subdirectories, as long as they are exported to the linting rule.clang_tidy
invocation now happens at abuild
step, concurrent with other compilation operations.test
step, which reports success or failure based on thebuild
step.//cuttlefish/common/libs/utils
took about 2 minutes. Based on CPU utilization, it seems likeclang_tidy
is being run serially for all source files in a build target, and only different build targets can be validated in parallel with each other.