Disable layering_check
in lint_clang_tidy_aspect
evaluation
#472
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
layering_check
is a toolchain feature that can track whether#include
dependencies are properly represented in the bazel dependency graph. It is only supported withclang
as the compiler. Turning on this feature affects the internals of the c++ build rules, breaking an interaction withlint_clang_tidy_aspect
. This leads to a build error looking like:This commit disables the
layering_check
toolchain feature while runninglint_clang_tidy_aspect
without affecting the behavior of non-aspect builds, making it possible to use both in the same project.References:
layering_check
bazel-contrib/rules_foreign_cc#630Small reproduction case:
BUILD.bazel:
direct.h:
executable.cc:
indirect.h:
linters.bzl:
MODULE.bazel:
REPO.bazel:
Changes are visible to end-users: yes
"Adds workaround for incompatibility between
lint_clang_tidy_aspect
rule andlayering_check
toolchain feature"Test plan