Closed gioannidis closed 3 years ago
Investigating this further, the root cause is at the rules_proto
repository end, which fetches an older commit from rules_cc
.
The rules_proto_dependencies()
loads the rules_cc
dependencies at commit b7fe969
(2019-07-22). However, the action_names.bzl
(history) was created at a later point: 4a1c578
(2019-08-21).
One workaround is to add the following to the WORKSPACE
file, after rules_proto_toolchains()
, which resolves the issue by fetching the latest commit.
http_archive(
name = "rules_cc",
sha256 = "3cde212ccda3ba152897e7fd354c42eba275878b6d98fe4f2125c684a73f3842",
strip_prefix = "rules_cc-d66a13e2a01630afcafc4ba411d83e291ecf02bd",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/d66a13e2a01630afcafc4ba411d83e291ecf02bd.tar.gz",
"https://github.com/bazelbuild/rules_cc/archive/d66a13e2a01630afcafc4ba411d83e291ecf02bd.tar.gz",
],
)
I am not very experienced with the bazel rules, though. Is there a cleaner way to apply a patch to the rules_cc
dependency?
I ran into the same issue. Thanks @gioannidis for figuring out the root cause. For me, the build only succeeded after including your WORKSPACE
snippet and the git_repository
declaration for bazel_clang_tidy
before declaring protobuf/gRPC dependencies.
Thanks for reporting this. As a tactical measure, we can drop the dependency on "CPP_COMPILE_ACTION_NAME", and hardcode its current value.
Overview
bazel_clang_tidy
seems to conflict with protobuf rules fromrules_proto
. The error I am getting is:Details below.
Steps to reproduce
Clone the
bazel_clang_tidy
repository (as of this commit).Apply the 0001-Added-protobuf-external-dependency-and-sample-proto.patch.gz patch.
rules_proto
repository, updated to the latest commit.test.proto
file.Build without invoking
clang-tidy
: works normally$ bazel build //example:app
Build with
clang-tidy
aspect: raises error (see below)bazel build //example:app \ --aspects clang_tidy/clang_tidy.bzl%clang_tidy_aspect \ --output_groups=report
Detailed error message
Invoking the
clang-tidy
aspect with protobuf rules generates the following errors:Offending line
Removing the following rule from
WORKSPACE
fixes theclang-tidy
error, but breaks of course the compilation of//example:test.proto
: