Bump to rules_proto 6.0.2, separate protobuf 21.7 #1623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Updates the build to depend on rules_proto 6.0.2, and the now separate protobuf v21.7.
Part of #1482.
As explained in the 6.0.0 release notes, rules_proto 6.x no longer depends directly on com_google_protobuf, so we need to import it separately. We're keeping the Protobuf version as 21.7 for now, because Protobuf 22.x requires C++14 at a minimum, which Bazel 6.x doesn't support by default:
The downside is that, unline rules_proto-5.3.0-21.7, we now end up building (and occasionally rebuilding)
protoc
as part of our build.Motivation
This is in preparation for adding a
MODULE.bazel
file, which will bring in dependencies that use rules_proto 6.x. This change avoids that warning, and changing it now ensures thatWORKSPACE
builds are still compatible.The flip side of the downside is that rules_proto 6.0.2 also enables clients to try "Protobuf Toolchainization" to download precompiled
protoc
binaries.For now, Protobuf Toolchainization requires Bazel 6.5.0 or Bazel >= 7 and the
--incompatible_enable_proto_toolchain_resolution
flag:I've got a working draft implementation of proto toolchainization in a separate branch, though that experiment is certainly not urgent.