bazel_clang_tidy
bazel_clang_tidy copied to clipboard
Add `-resource-dir` override
We use a clang-tidy from the llvm releases binaries, previously we used clang-tidy built from LLVM itself with bazel. In both of these cases I've had to manually specify -resource-dir or clang-tidy goes and tries to find it from the sysroot, or the system, which in either case can lead to errors if the version doesn't match perfectly.
I've done this with hacky patches, but it seems like something we should try to support natively so that other folks can more easily do this too. One option would be to try to support it with skylib's directory rule, which could be given by the user as a root to the resource-dir
If I'm not mistaken, the equivalent for using clang-tidy with gcc would be --gcc-install-dir. I think it's also required for using clang-tidy with an hermetic gcc toolchain.
https://github.com/erenon/bazel_clang_tidy/commit/9e9bfc5582ee8acc453a3539e69bfe90efff94f2