Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto_library does not document its implicit dependency on @com_google_protobuf//:protoc #3668

Open
endobson opened this issue Sep 2, 2017 · 7 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-Server Issues for serverside rules included with Bazel type: documentation (cleanup)

Comments

@endobson
Copy link
Contributor

endobson commented Sep 2, 2017

I'm attempting to use proto_library and getting the following error message.

ERROR: /Users/endobson/proj/bes-example/BUILD:1:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: no such package '@com_google_protobuf//': The repository could not be resolved.

The documentation of proto_library has no mention of this implicit dependency so I need to go into the bazel repo to find out how that repo does it and mimic that. This dependency should be mentioned in the documentation and a recommended solution should be provided.

@aj-michael
Copy link
Contributor

I agree the documentation should be improved, however if you're still stuck, there is a guide to setting up the protobuf dependencies here: https://blog.bazel.build/2017/02/27/protocol-buffers.html

@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) type: documentation (cleanup) labels Sep 4, 2017
@laurentlb laurentlb added the team-Rules-Server Issues for serverside rules included with Bazel label Nov 21, 2018
@martinw1982
Copy link

Tried doing this now and given that the blogpost is more than a year old, there is quite some additional work needed on Bazel V 0.21, which is hard for a newbie to figure out:

First I got build:
aborted: no such package '@com_google_protobuf//': The native http_archive rule is deprecated. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.

Next up:
The value 'REPOSITORY_NAME' has been removed in favor of 'repository_name()', please use the latter (https://docs.bazel.build/versions/master/skylark/lib/native.html#repository_name). You can temporarily allow the old name by using --incompatible_package_name_is_a_function=false

When adding the flag the build succeeded, but obviously it's suboptimal if I have to specify this flag every time.

How do I reference a newer version of the protobuf library? Also, would it be possible to have a documentation page describing the up-to-date steps to avoid people getting stuck?

@jin
Copy link
Member

jin commented Jan 2, 2019

@martinw1982 check out this comment (#6984 (comment)) for instructions to use protobuf 3.6.1.3, which includes the fix for the REPOSITORY_NAME incompatible change issue.

@jin
Copy link
Member

jin commented Jan 2, 2019

Also created a PR to update the blogpost with the minimum version required: https://github.com/bazelbuild/bazel-blog/pull/146/files?short_path=bde5ec7#diff-bde5ec77860ad065de8fd8ab1862de03

@martinw1982
Copy link

Thanks Jin, this worked like a charm!

@RezaMehrabian
Copy link

I agree the documentation should be improved, however if you're still stuck, there is a guide to setting up the protobuf dependencies here: https://blog.bazel.build/2017/02/27/protocol-buffers.html

I have the same problem but I did not get how I can fix it by your suggested link. Could you explain more?

@lberki lberki removed their assignment Nov 18, 2020
@sgowroji sgowroji added the team-Documentation Documentation improvements that cannot be directly linked to other team labels label Jan 11, 2023
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-Rules-Server Issues for serverside rules included with Bazel type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

9 participants