Fix up protobuf submodule name to match bazel expectation

pull/10639/head
Vijay Pai 8 years ago
parent a935ae1505
commit f74eaa6957
  1. 4
      bazel/BUILD
  2. 2
      bazel/cc_grpc_library.bzl
  3. 6
      bazel/generate_cc.bzl
  4. 13
      tools/grpcz/BUILD

@ -35,12 +35,12 @@ load(":cc_grpc_library.bzl", "cc_grpc_library")
proto_library(
name = "well_known_protos_list",
srcs = ["@submodule_protobuf//:well_known_protos"],
srcs = ["@com_google_protobuf//:well_known_protos"],
)
cc_grpc_library(
name = "well_known_protos",
srcs = "well_known_protos_list",
deps = [],
proto_only = True,
deps = [],
)

@ -14,7 +14,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_externa
the compiled code of any message that the services depend on.
well_known_protos: The target from protobuf library that exports well
known protos. Currently it will only work if the value is
"@submodule_protobuf//:well_known_protos"
"@com_google_protobuf//:well_known_protos"
use_external: When True the grpc deps are prefixed with //external. This
allows grpc to be used as a dependency in other bazel projects.
**kwargs: rest of arguments, e.g., compatible_with and visibility.

@ -35,10 +35,10 @@ def generate_cc_impl(ctx):
well_known_proto_files = []
if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/submodule_protobuf/src/google/protobuf":
print("Error: Only @submodule_protobuf//:well_known_protos is supported")
if f != "external/com_google_protobuf/src/google/protobuf":
print("Error: Only @com_google_protobuf//:well_known_protos is supported")
else:
# f points to "external/submodule_protobuf/src/google/protobuf"
# f points to "external/com_google_protobuf/src/google/protobuf"
# add -I argument to protoc so it knows where to look for the proto files.
arguments += ["-I{0}".format(f + "/../..")]
well_known_proto_files = [f for f in ctx.attr.well_known_protos.files]

@ -33,30 +33,31 @@ package(default_visibility = ["//visibility:public"])
load("//:bazel/grpc_build_system.bzl", "grpc_proto_library")
grpc_proto_library (
grpc_proto_library(
name = "monitoring_proto",
srcs = [
"monitoring.proto",
],
well_known_protos = "@com_google_protobuf//:well_known_protos",
deps = [
":census_proto",
],
well_known_protos = "@submodule_protobuf//:well_known_protos",
)
grpc_proto_library (
grpc_proto_library(
name = "census_proto",
srcs = [
"census.proto",
],
well_known_protos = "@submodule_protobuf//:well_known_protos",
well_known_protos = "@com_google_protobuf//:well_known_protos",
)
cc_binary(
name = "grpcz_client",
srcs = ["grpcz_client.cc",],
srcs = ["grpcz_client.cc"],
deps = [
"//external:gflags",
"monitoring_proto",
"//external:gflags",
"@mongoose_repo//:mongoose_lib",
],
)

Loading…
Cancel
Save