bazel_clang_tidy icon indicating copy to clipboard operation
bazel_clang_tidy copied to clipboard

Doesn't work with --experimental_cc_implementation_deps

Open HappyCerberus opened this issue 3 years ago • 3 comments

It seems that the implementation dependencies are not included in the compilation context, so clang-tidy doesn't see the headers.

I tried to debug this problem, but I actually have no idea where bazel puts the implementation dependencies since they are not in the sandbox directory.

HappyCerberus avatar Nov 04 '22 15:11 HappyCerberus

FYI ran into the same issue, one suggestion I got to my question on the bazel slack channel was to walk the implementation_deps manually, which seems to work. It was by design that the compilation context only returns public properties.

Unsure whether manually combining all the depset propererties of the target's compilation context, as well as the implementation_dep's compilation contexts, is a general solution, but it seems to work in our case.

jelle282 avatar Feb 21 '23 09:02 jelle282

  1. I overcome this by adding implementation compilation_contexts https://github.com/zpzjzj/bazel_clang_tidy/commit/867182a4683a4357b940498ef4d544738d34b5cc
  2. Bazel 6.0.0 may fix this, I did not tested yet : https://github.com/bazelbuild/bazel/issues/14731

zpzjzj avatar Mar 14 '23 10:03 zpzjzj