Open
Conversation
6640339 to
1833d12
Compare
0f84e6a to
6ca8c34
Compare
Motivation: These changes are required for P4Runtime to build successfully for downstream users who depend on it via the BCR. Issues were discovered while upstreaming P4Runtime v1.5.0 to the BCR (bazelbuild/bazel-central-registry#7594) and when adding Bazel 9 support. Dependency updates: - Upgrade googleapis and replace the switched_rules extension with the new per-language modules (googleapis-cc, googleapis-go, googleapis-python, googleapis-grpc-cc). The old switched_rules extension only processes use_languages() calls from the root module, which breaks BCR presubmit and downstream users who don't call it themselves. - Upgrade grpc 1.68.0 -> 1.76.0, protobuf 29.1 -> 33.5, bazel_skylib 1.7.1 -> 1.9.0, rules_go 0.59.0 -> 0.60.0, re2 -> 2025-11-05.bcr.1. - Remove rules_proto and gazelle deps (no longer needed). - Load proto_library from @protobuf//bazel:proto_library.bzl instead of the deprecated @rules_proto//proto:defs.bzl. CI coverage gap fix: - Our example project in bazel/example/using-bzlmod only exercised some @p4runtime targets transitively, allowing build issues to slip through. - Fix: run bazel build @p4runtime//... from the example workspace. Bazel 9 support: - Remove the <9.0.0 upper bound from bazel_compatibility. - Update .bazelversion to 9.0.0. - Add --incompatible_autoload_externally=+cc_library,+cc_binary to .bazelrc files. Bazel 9 removed native C++ rules from the global namespace; this flag restores the autoload. It is a no-op on Bazel 7/8. (Workaround for two gRPC 1.76.0 bundled files that still use native.cc_binary / native.cc_library; can be dropped once a fixed gRPC BCR release ships.) - Update CI to test on Bazel 7.x and 9.x. Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
6ca8c34 to
77269af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR does three things:
Fix BCR build issues (details on 1)
TL;DR: update various dependencies to newer versions. See the commit message for details.
Fix CI gap (details on 2)
bazel/example/using-bzlmodthat we build in CI to cover this case, but it was only exercising some@p4runtimetargets transitively.bazel build @p4runtime//...from the example workspace to close the gap.Bazel 9 support (details on 3)
<9.0.0upper bound frombazel_compatibilityand bump.bazelversionto9.0.0.--incompatible_autoload_externally=+cc_library,+cc_binaryto.bazelrcfiles. Bazel 9 removed native C++ rules from the global namespace; this flag restores them. It is a no-op on Bazel 7/8. Two files ingrpc 1.76.0still usenative.cc_*:bazel/cython_library.bzl(native.cc_binary)third_party/address_sorting/address_sorting.bzl(native.cc_library)re2to2025-11-05.bcr.1:grpc 1.76.0pulls inre2 2024-07-02, whoseBUILDusescc_testwithout aload()— a Bazel 9 hard error.The workarounds above can be dropped once
grpc 1.76.0.bcr.2lands in BCR (bazelbuild/bazel-central-registry#7749), which fixes bothnative.cc_*usages and there2issue.This also supersedes #597.