Skip to content

Add missing BUILD rules for service config proto.#59

Closed
markdroth wants to merge 2 commits intogrpc:masterfrom
markdroth:service_config_proto
Closed

Add missing BUILD rules for service config proto.#59
markdroth wants to merge 2 commits intogrpc:masterfrom
markdroth:service_config_proto

Conversation

@markdroth
Copy link
Copy Markdown
Member

I forgot the build rules in #58.

@markdroth markdroth requested review from dfawley and ejona86 June 26, 2019 19:42

proto_library(
name = "service_config_proto",
srcs = ["grpc/service_config/service_config.proto"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will need the other deps (imported .proto files).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown

@noahdietz noahdietz Jun 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can submit a PR with these changes if you'd prefer to avoid the toil, just lmk

@markdroth
Copy link
Copy Markdown
Member Author

Closing this in favor of #74.

@markdroth markdroth closed this Feb 10, 2020
@markdroth markdroth deleted the service_config_proto branch February 10, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants