Add command line information in aspect?

28 views
Skip to first unread message

zhang kai

unread,
Jul 27, 2022, 1:46:32 PMJul 27
to bazel-dev
Hi,

Bazel aspect is a great tool. bazel_clang_tidy uses it to run clang-tidy on c-family target. However, we must assemble the command line flags by hand in an aspect implementation. This is not as easy as it seems. For example, currently, bazel_clang_tidy assumes all targets using c++-compile which apparently it's not the case. It's easy to fix bugs like this. But we may miss some flags without noticing, which is tricker. It would be much better if the command line is actually available in aspect implementations like in action query. If we use aquery to get the command line and then run clang-tidy with it, we lose the wonderful built-in cache support from bazel. So is there any chance bazel can provide command line(and param file) in aspects in the future or is it technically impossible?

Thanks.
Kai
Reply all
Reply to author
Forward
0 new messages