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

Bump to rules_proto 6.0.2, separate protobuf 21.7 #1623

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Oct 16, 2024

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 that WORKSPACE 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.

@mbland
Copy link
Contributor Author

mbland commented Oct 17, 2024

CI still only failing on Bazel green head again. Still don't know why this presumably optional run is failing the build now.

Also, because I forgot earlier, I meant to cc: @BillyAutrey @jayconrod @benjaminp @TheGrizzlyDev

mbland added a commit to mbland/rules_scala that referenced this pull request Oct 17, 2024
Depends on the rules_proto 6.0.2 bump from bazelbuild#1623. This is another
measure to preemptively avoid a warning under Bzlmod that a dependency
uses a newer version or rules_go.
mbland added a commit to mbland/rules_scala that referenced this pull request Oct 17, 2024
Depends on the rules_proto 6.0.2 bump from bazelbuild#1623. This is another
measure to preemptively avoid a warning under Bzlmod that a dependency
uses a newer version of rules_go.
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 that `WORKSPACE` builds are still
compatible.

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:

- https://protobuf.dev/news/v22/#c11-support
- https://github.com/protocolbuffers/protobuf/releases/tag/v22.0

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. However, this also enables clients to try "Protobuf
Toolchainization" to download precompiled `protoc` binaries.

- https://github.com/bazelbuild/rules_proto/releases/tag/6.0.0
- https://docs.google.com/document/d/1CE6wJHNfKbUPBr7-mmk_0Yo3a4TaqcTPE0OWNuQkhPs/edit

For now, Protobuf Toolchainization  requires Bazel 6.5.0 or Bazel >= 7
and the `--incompatible_enable_proto_toolchain_resolution` flag:

- https://bazel.build/reference/command-line-reference#flag--incompatible_enable_proto_toolchain_resolution

I've got a working draft implementation in a separate branch, though
that experiment is certainly not urgent.
I'd previously checked for an existing `protobuf` rule, not
`com_google_protobuf`. D'oh!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant