Add missing BUILD rules for service config proto.#59
Add missing BUILD rules for service config proto.#59markdroth wants to merge 2 commits intogrpc:masterfrom
Conversation
|
|
||
| proto_library( | ||
| name = "service_config_proto", | ||
| srcs = ["grpc/service_config/service_config.proto"], |
There was a problem hiding this comment.
I think this will need the other deps (imported .proto files).
There was a problem hiding this comment.
Good catch!
I've attempted to add the external deps, but I'm running into problems trying to get the one from the googleapis repo working. Here's the error I'm seeing:
roth@segfault:~/grpc-proto> bazel build --incompatible_disable_deprecated_attr_params=false service_config_proto
ERROR: /usr/local/google/home/roth/grpc-proto/BUILD.bazel:139:1: error loading package '@com_google_googleapis//google/rpc': Unable to find package for @io_bazel_rules_go//proto:def.bzl: The repository '@io_bazel_rules_go' could not be resolved. and referenced by '//:service_config_proto'
ERROR: Analysis of target '//:service_config_proto' failed; build aborted: error loading package '@com_google_googleapis//google/rpc': Unable to find package for @io_bazel_rules_go//proto:def.bzl: The repository '@io_bazel_rules_go' could not be resolved.
INFO: Elapsed time: 0.152s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\
igured)
currently loading: @com_google_googleapis//google/rpc
@nicolasnoble, any idea what's going on here? Thanks!
There was a problem hiding this comment.
Hi Mark, I was just checking up on this after you sent me the PR earlier in the week and I had to do something similar at one point. What worked for me (this is using the latest-as-of-writing-this commit from googelapis) was the following in WORKSPACE:
http_archive(
name = "com_google_googleapis",
sha256 = "eccaa7c65f1ba78448c5bb3fbf2f1e8d60ec0f9b3c0e0eddf843cb7c7ea51141",
strip_prefix = "googleapis-84c8ad4e52f8eec8f08a60636cfa597b86969b5c",
urls = ["https://github.com/googleapis/googleapis/archive/84c8ad4e52f8eec8f08a60636cfa597b86969b5c.zip"],
)
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language(
name = "com_google_googleapis_imports",
)
However, it looks like the build might be broken anyways because when I run any of the build targets on master I get some errors with the @com_google_protobuf dependency (maybe this is just me!).
I fixed this by upgrading to protoc 3.8.0 (and adding its dependencies) as follows:
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)
http_archive(
name = "bazel_skylib",
sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d",
strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
)
http_archive(
name = "com_google_protobuf",
sha256 = "1e622ce4b84b88b6d2cdf1db38d1a634fe2392d74f0b7b74ff98f3a51838ee53",
strip_prefix = "protobuf-3.8.0",
urls = ["https://github.com/google/protobuf/archive/v3.8.0.zip"],
)
I'm not super experienced with bazel, so there might be a better way to do these things, but this got the targets building!
There was a problem hiding this comment.
I can submit a PR with these changes if you'd prefer to avoid the toil, just lmk
|
Closing this in favor of #74. |
I forgot the build rules in #58.