For what it's worth it's very hard for developers to come in and actually use bazel to build protocol buffers at the moment if they don't already have a working build. There is a lot of information in various places online which seems valid for old versions of protobuf; for example, many sources say that you can load the functions that generate code from protocol buffers using the following:
Now it seems that cc_proto_library is not available this way. I tried consulting the Bazel documentation but I don't actually think there's information about how to load cc_proto_library on the docs page. Furthermore if you look on the protocol buffers bazel docs they point you to the deprecated rules_proto repository. However in the readme for that repository, it says that the rules have been migrated to the protobuf repo, but if I search the docs in that repo there is no mention of cc_proto_library at all.
Looking in the protobuf repo examples directory, there is a usage of cc_proto_library which apparently you can load by doing
# Needed because protobuf_deps brings rules_python 0.26.0 which is broken:
# https://github.com/bazelbuild/rules_python/issues/1543
http_archive(
name = "rules_python",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)
However for the project I'm working on, I'm trying to update the (currently broken) build system so that it actually runs; unfortunately doing this leads to other build errors which look an awful lot like the cc_proto_library and py_proto_library APIs have changed.
Anyway, it's not really in the scope of this issue to fix all of this, but I just wanted to say that it's currently quite hard for new Bazel users to come in and actually find a path forward. This is exacerbated by the fact that in addition to managing project dependencies, developers are required to manually manage Bazel rule dependencies, as well as Bazel versions via Bazelisk. If there's any way to update the docs with a working example of how to generate python and C++ code from protocol buffers, I'd be super grateful.
Page link:
https://bazel.build/reference/be/protocol-buffer
Problem description (include actual vs expected text, if applicable):
The https://github.com/bazelbuild/rules_proto/ repository is deprecated.
Where do you see this issue? (include link to specific section of the page, if applicable)
See this section: https://bazel.build/reference/be/protocol-buffer#proto_library
Any other information you'd like to share?
For what it's worth it's very hard for developers to come in and actually use bazel to build protocol buffers at the moment if they don't already have a working build. There is a lot of information in various places online which seems valid for old versions of protobuf; for example, many sources say that you can load the functions that generate code from protocol buffers using the following:
Now it seems that
cc_proto_library
is not available this way. I tried consulting the Bazel documentation but I don't actually think there's information about how to loadcc_proto_library
on the docs page. Furthermore if you look on the protocol buffers bazel docs they point you to the deprecatedrules_proto
repository. However in the readme for that repository, it says that the rules have been migrated to the protobuf repo, but if I search the docs in that repo there is no mention ofcc_proto_library
at all.Looking in the protobuf repo examples directory, there is a usage of
cc_proto_library
which apparently you can load by doingafter you've done
However there is a note about needing
However for the project I'm working on, I'm trying to update the (currently broken) build system so that it actually runs; unfortunately doing this leads to other build errors which look an awful lot like the
cc_proto_library
andpy_proto_library
APIs have changed.Anyway, it's not really in the scope of this issue to fix all of this, but I just wanted to say that it's currently quite hard for new Bazel users to come in and actually find a path forward. This is exacerbated by the fact that in addition to managing project dependencies, developers are required to manually manage Bazel rule dependencies, as well as Bazel versions via Bazelisk. If there's any way to update the docs with a working example of how to generate python and C++ code from protocol buffers, I'd be super grateful.