{"action":"created","issue":{"url":"https://api.github.com/repos/pubref/rules_proto/issues/5","repository_url":"https://api.github.com/repos/pubref/rules_proto","labels_url":"https://api.github.com/repos/pubref/rules_proto/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pubref/rules_proto/issues/5/comments","events_url":"https://api.github.com/repos/pubref/rules_proto/issues/5/events","html_url":"https://github.com/pubref/rules_proto/issues/5","id":366044357,"node_id":"MDU6SXNzdWUzNjYwNDQzNTc=","number":5,"title":"Missing dependencies in installation instructions","user":{"login":"haikalpribadi","id":567679,"node_id":"MDQ6VXNlcjU2NzY3OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/567679?v=4","gravatar_id":"","url":"https://api.github.com/users/haikalpribadi","html_url":"https://github.com/haikalpribadi","followers_url":"https://api.github.com/users/haikalpribadi/followers","following_url":"https://api.github.com/users/haikalpribadi/following{/other_user}","gists_url":"https://api.github.com/users/haikalpribadi/gists{/gist_id}","starred_url":"https://api.github.com/users/haikalpribadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haikalpribadi/subscriptions","organizations_url":"https://api.github.com/users/haikalpribadi/orgs","repos_url":"https://api.github.com/users/haikalpribadi/repos","events_url":"https://api.github.com/users/haikalpribadi/events{/privacy}","received_events_url":"https://api.github.com/users/haikalpribadi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-02T19:24:25Z","updated_at":"2018-10-02T19:27:36Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nIn the [README.md](https://github.com/pubref/rules_proto/blob/master/README.md) it simply says that we need to add `{lang}:deps.bzl` to our `WORKSPACE` file. For example:\r\n```\r\ngit_repository(\r\n    name = \"org_pubref_rules_proto\",\r\n    remote = \"https://github.com/pubref/rules_proto\",\r\n    commit = \"27da2e7af9e4a1c43c584be2f05be8a301a642b6\",\r\n)\r\nload(\"@org_pubref_rules_proto//java:deps.bzl\", \"java_grpc_compile\")\r\njava_grpc_compile()\r\n```\r\n\r\nHowever, trying to run `java_grpc_compile` after this leads to an error:\r\n```\r\nERROR: /Users/haikalpribadi/Workspace/repos/graknlabs/grakn/protocol/BUILD:20:1: every rule of type proto_compile implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: no such package '@com_google_protobuf//'\r\n```\r\n\r\nSo then I added `@com_google_protobuf` as a dependency:\r\n```\r\nhttp_archive(\r\n    name = \"com_google_protobuf\",\r\n    sha256 = \"0a4c6d0678eb2f063df332cff1a41647ef692c067b5cfb19e51bca778e79d9e0\",\r\n    strip_prefix = \"protobuf-3.6.1\",\r\n    urls = [\"https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.zip\"],\r\n)\r\n```\r\n\r\nNow I get a different error:\r\n```\r\nERROR: /private/var/tmp/_bazel_haikalpribadi/3cdeaa1301f056ec7b4e7ee46bda5c79/external/com_github_grpc_grpc/BUILD:2039:1: no such target '//external:protobuf_headers': target 'protobuf_headers' not declared in package 'external' defined by /Users/haikalpribadi/Workspace/repos/graknlabs/grakn/WORKSPACE and referenced by '@com_github_grpc_grpc//:grpc++_config_proto'\r\nERROR: /private/var/tmp/_bazel_haikalpribadi/3cdeaa1301f056ec7b4e7ee46bda5c79/external/com_github_grpc_grpc/BUILD:388:1: no such target '//external:protobuf_clib': target 'protobuf_clib' not declared in package 'external' defined by /Users/haikalpribadi/Workspace/repos/graknlabs/grakn/WORKSPACE and referenced by '@com_github_grpc_grpc//:grpc_plugin_support'\r\n```\r\n\r\nSo I suspected that I'm missing `@com_github_grpc_grpc`, so I added:\r\n```\r\ngit_repository(\r\n    name = \"com_github_grpc_grpc\",\r\n    remote = \"https://github.com/grpc/grpc\",\r\n    tag = \"v1.15.1\"\r\n)\r\n```\r\n\r\nHowever, it still gives the error as shown above, so I checked in your [`WORKSPACE`](https://github.com/pubref/rules_proto/blob/master/WORKSPACE) file and saw that you had the following two lines to load `grpc_deps.bzl`, and I copied them into my `WORKSPACE` file.\r\n```\r\nload(\"@com_github_grpc_grpc//bazel:grpc_deps.bzl\", com_github_grpc_grpc_bazel_grpc_deps = \"grpc_deps\")\r\ncom_github_grpc_grpc_bazel_grpc_deps()\r\n```\r\n\r\nNow everything works fine, and the proto files compile. However, I'm worried that I'm doing something wrong/unnecessary above, as you did not put them in your documentation. Thus, my questions are:\r\n1. Is the above code needed in my `WORKSPACE`? Because I thought `{lang}:deps.bzl` was going to take care of it. But if it is needed, ...\r\na. Why is it needed? If not, then ...\r\nb. Is there a simpler approach which I should have taken?"},"comment":{"url":"https://api.github.com/repos/pubref/rules_proto/issues/comments/426400171","html_url":"https://github.com/pubref/rules_proto/issues/5#issuecomment-426400171","issue_url":"https://api.github.com/repos/pubref/rules_proto/issues/5","id":426400171,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjQwMDE3MQ==","user":{"login":"haikalpribadi","id":567679,"node_id":"MDQ6VXNlcjU2NzY3OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/567679?v=4","gravatar_id":"","url":"https://api.github.com/users/haikalpribadi","html_url":"https://github.com/haikalpribadi","followers_url":"https://api.github.com/users/haikalpribadi/followers","following_url":"https://api.github.com/users/haikalpribadi/following{/other_user}","gists_url":"https://api.github.com/users/haikalpribadi/gists{/gist_id}","starred_url":"https://api.github.com/users/haikalpribadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haikalpribadi/subscriptions","organizations_url":"https://api.github.com/users/haikalpribadi/orgs","repos_url":"https://api.github.com/users/haikalpribadi/repos","events_url":"https://api.github.com/users/haikalpribadi/events{/privacy}","received_events_url":"https://api.github.com/users/haikalpribadi/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T19:27:36Z","updated_at":"2018-10-02T19:27:36Z","author_association":"NONE","body":"Actually, after I added `com_github_grpc_grpc`, I can even delete `com_google_protobuf`:\r\n```\r\nhttp_archive(\r\n    name = \"com_google_protobuf\",\r\n    sha256 = \"0a4c6d0678eb2f063df332cff1a41647ef692c067b5cfb19e51bca778e79d9e0\",\r\n    strip_prefix = \"protobuf-3.6.1\",\r\n    urls = [\"https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.zip\"],\r\n)\r\n```\r\n\r\nAfter deleting the above, my build still works. So in the end, only `com_github_grpc_grpc` is needed. Why is that?"}}
{"actor":{"display_login":"haikalpribadi"}}