protobuf
protobuf copied to clipboard
Why is rules_ruby needed in 3.23.0? Is there a way to skip it?
I've upgraded my Bazel workspace from using protobuf 3.11.3 to 3.23.0 and it's now trying to depend on rules_ruby. Why? What's the use case? How can I cut this out?
rules_ruby was added to build the Ruby implementation under Bazel. In a later version (26.x), it was made a development only dependency (see https://github.com/protocolbuffers/protobuf/commit/571b727cb66ad51f89fbef565d3a6c123366a1f5).
Can you try upgrading to at least 26.x and see if this is still an issue for you?
@JasonLunn yes, though it sounds terribly scary. With large updates like this I always worry what else can break. I will let you know how it went
I was right to worry. 26.0 breaks in yet another place:
(12:03:14) ERROR: /home/grepwood/.cache/bazel/_bazel_grepwood/.../external/com_google_protobuf/src/google/protobuf/compiler/BUILD.bazel:174:11: no such package '@com_google_absl//absl/log': The repository '@com_google_absl' could not be resolved: Repository '@com_google_absl' is not defined and referenced by '@com_google_protobuf//src/google/protobuf/compiler:protoc_lib'
(12:03:14) ERROR: Analysis of target '//tools:buildifier-fix' failed; build aborted:
The error doesn’t explicitly state why //tools:buildifier-fix was aborted unless the previous message is the cause. In which case I'm still wondering what sense does it make to give the reason for an error before declaring the error occurred. I've never seen a tool do it in this order.
Could you clarify why the issue is marked with "wontfix," @tonyliaoss?
Is there a version that isn't more encumbered than 3.11.3 with extra dependencies, but newer than 3.23.0? The reason that I've gone after this particular version is because it fixes the following issues:
- https://github.com/protocolbuffers/protobuf/issues/10205
- https://github.com/protocolbuffers/protobuf/issues/6419
- https://github.com/protocolbuffers/protobuf/issues/10377
I'm sorry but this is the first time I'm facing a case like this, that a Bazel rule will straight up not download its own dependencies and tax the user with this toil which is unlike rules_python [1] and rules_scala [2] to name a few examples, and this is really rubbing me the wrong way.
Citations:
- https://github.com/bazelbuild/rules_python/blob/0.35.0/python/private/coverage_deps.bzl, https://github.com/bazelbuild/rules_python/blob/0.35.0/python/private/pypi/deps.bzl, https://github.com/bazelbuild/rules_python/blob/0.35.0/WORKSPACE, https://github.com/bazelbuild/rules_python/blob/0.35.0/python/private/python_repositories.bzl
- https://github.com/bazelbuild/rules_scala/blob/v6.6.0/scala/private/macros/scala_repositories.bzl#L74-L121, https://github.com/bazelbuild/rules_scala/blob/v6.6.0/WORKSPACE, https://github.com/bazelbuild/rules_scala/blob/v6.6.0/private/format.bzl
Hi grepwood@,
This issue is marked as "wontfix" because the original title of the issue is resolved: rules_ruby is already removed from the build definition in our latest release.
The remaining work seems to be troubleshooting your version upgrades -- without knowledge of your system, unfortunately we won't be able to help you too much.
Is there a version that isn't more encumbered than 3.11.3 with extra dependencies, but newer than 3.23.0?
According to https://protobuf.dev/support/version-support/#ruby, we are currently supporting 4.28.x and 3.25.x distributions. You can find our latest release artifacts here: https://github.com/protocolbuffers/protobuf/releases
If you run into trouble installing the latest release, please file a new issue.
4.28.x doesn't exist
Protobuf's version scheme (explained in detail at https://protobuf.dev/support/version-support/) means that the "major" version is language specific, and Ruby Protobuf is currently on major version 4. What you see on https://github.com/protocolbuffers/protobuf/releases will just have the minor and patch versions noted because the releases there cover all languages supported by Protobuf. Last week we released v28.3 and v29.0-rc2.
If you're looking for the Ruby artifacts corresponding to these release, see our Ruby Gems site: https://rubygems.org/gems/google-protobuf in general, v4.29.0-rc2 and v4.28.3 in specific.