Skip to content
Snippets Groups Projects
Commit f74eaa69 authored by Vijay Pai's avatar Vijay Pai
Browse files

Fix up protobuf submodule name to match bazel expectation

parent a935ae15
No related branches found
No related tags found
No related merge requests found
...@@ -35,12 +35,12 @@ load(":cc_grpc_library.bzl", "cc_grpc_library") ...@@ -35,12 +35,12 @@ load(":cc_grpc_library.bzl", "cc_grpc_library")
proto_library( proto_library(
name = "well_known_protos_list", name = "well_known_protos_list",
srcs = ["@submodule_protobuf//:well_known_protos"], srcs = ["@com_google_protobuf//:well_known_protos"],
) )
cc_grpc_library( cc_grpc_library(
name = "well_known_protos", name = "well_known_protos",
srcs = "well_known_protos_list", srcs = "well_known_protos_list",
deps = [],
proto_only = True, proto_only = True,
deps = [],
) )
...@@ -14,7 +14,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_externa ...@@ -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. the compiled code of any message that the services depend on.
well_known_protos: The target from protobuf library that exports well well_known_protos: The target from protobuf library that exports well
known protos. Currently it will only work if the value is 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 use_external: When True the grpc deps are prefixed with //external. This
allows grpc to be used as a dependency in other bazel projects. allows grpc to be used as a dependency in other bazel projects.
**kwargs: rest of arguments, e.g., compatible_with and visibility. **kwargs: rest of arguments, e.g., compatible_with and visibility.
......
...@@ -35,10 +35,10 @@ def generate_cc_impl(ctx): ...@@ -35,10 +35,10 @@ def generate_cc_impl(ctx):
well_known_proto_files = [] well_known_proto_files = []
if ctx.attr.well_known_protos: if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/submodule_protobuf/src/google/protobuf": if f != "external/com_google_protobuf/src/google/protobuf":
print("Error: Only @submodule_protobuf//:well_known_protos is supported") print("Error: Only @com_google_protobuf//:well_known_protos is supported")
else: 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. # add -I argument to protoc so it knows where to look for the proto files.
arguments += ["-I{0}".format(f + "/../..")] arguments += ["-I{0}".format(f + "/../..")]
well_known_proto_files = [f for f in ctx.attr.well_known_protos.files] well_known_proto_files = [f for f in ctx.attr.well_known_protos.files]
......
...@@ -33,30 +33,31 @@ package(default_visibility = ["//visibility:public"]) ...@@ -33,30 +33,31 @@ package(default_visibility = ["//visibility:public"])
load("//:bazel/grpc_build_system.bzl", "grpc_proto_library") load("//:bazel/grpc_build_system.bzl", "grpc_proto_library")
grpc_proto_library ( grpc_proto_library(
name = "monitoring_proto", name = "monitoring_proto",
srcs = [ srcs = [
"monitoring.proto", "monitoring.proto",
], ],
well_known_protos = "@com_google_protobuf//:well_known_protos",
deps = [ deps = [
":census_proto", ":census_proto",
], ],
well_known_protos = "@submodule_protobuf//:well_known_protos",
) )
grpc_proto_library ( grpc_proto_library(
name = "census_proto", name = "census_proto",
srcs = [ srcs = [
"census.proto", "census.proto",
], ],
well_known_protos = "@submodule_protobuf//:well_known_protos", well_known_protos = "@com_google_protobuf//:well_known_protos",
) )
cc_binary( cc_binary(
name = "grpcz_client", name = "grpcz_client",
srcs = ["grpcz_client.cc",], srcs = ["grpcz_client.cc"],
deps = [ deps = [
"//external:gflags",
"monitoring_proto", "monitoring_proto",
"//external:gflags",
"@mongoose_repo//:mongoose_lib",
], ],
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment