Skip to content

Add p4runtime 1.5.0 (initial release to BCR)#7594

Merged
dzbarsky merged 2 commits into
bazelbuild:mainfrom
smolkaj:add-p4runtime-1.5.0
Feb 20, 2026
Merged

Add p4runtime 1.5.0 (initial release to BCR)#7594
dzbarsky merged 2 commits into
bazelbuild:mainfrom
smolkaj:add-p4runtime-1.5.0

Conversation

@smolkaj

@smolkaj smolkaj commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@bazel-io

Copy link
Copy Markdown
Member

Hello @bazelbuild/bcr-maintainers, modules without existing maintainers (p4runtime) have been updated in this PR.
Please review the changes. You can view a diff against the previous version in the "Generate module diff" check.

@meteorcloudy meteorcloudy added the presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval label Feb 18, 2026
meteorcloudy
meteorcloudy previously approved these changes Feb 18, 2026
@smolkaj

smolkaj commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

Weird, why is this failing here but passing with the same OS and bazel versions on github.com/p4lang/p4runtime/actions?

(10:17:50) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/a72a9b81d01ed8800ad7e163da9445b4/external/googleapis+/google/rpc/BUILD.bazel: no such target '@@googleapis+//google/rpc:status_go_proto': target 'status_go_proto' not declared in package 'google/rpc' defined by /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/a72a9b81d01ed8800ad7e163da9445b4/external/googleapis+/google/rpc/BUILD.bazel (did you mean status_proto, or status.proto?)
--
(10:17:50) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/a72a9b81d01ed8800ad7e163da9445b4/external/p4runtime+/proto/p4/v1/BUILD.bazel:50:17: no such target '@@googleapis+//google/rpc:status_go_proto': target 'status_go_proto' not declared in package 'google/rpc' defined by /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/a72a9b81d01ed8800ad7e163da9445b4/external/googleapis+/google/rpc/BUILD.bazel (did you mean status_proto, or status.proto?) and referenced by '@@p4runtime+//proto/p4/v1:p4runtime_go_proto'

@smolkaj

smolkaj commented Feb 19, 2026

Copy link
Copy Markdown
Contributor Author

I think Claude figured it out:

The googleapis extension (switched_rules) in googleapis@0.0.0-20240819-fe8ba054a
only configures language support when called from the root module. In the BCR's
anonymous module test, the synthetic root module doesn't call
switched_rules.use_languages(go = True), so @googleapis//google/rpc:status_go_proto
is never defined as a target. This causes @p4runtime//proto/p4/v1:p4runtime_go_proto
(which depends on it) and its build_test wrapper to fail analysis.

@bazel-io bazel-io dismissed meteorcloudy’s stale review February 19, 2026 06:13

Require module maintainers' approval for newly pushed changes.

@smolkaj smolkaj force-pushed the add-p4runtime-1.5.0 branch 8 times, most recently from 7c0d73c to 8ac49c7 Compare February 19, 2026 08:25
…lly.

The older version's switched_rules extension only configured language
support (including Go) when called from the root module, so building
@p4runtime//... from the BCR's anonymous module test failed because
@googleapis//google/rpc:status_go_proto was never defined. The newer
version provides com_google_googleapis_imports unconditionally via
googleapis-rules-registry, fixing Go proto support for downstream
consumers.

Remove the now-unnecessary switched_rules extension block from MODULE.bazel
(no BUILD file in p4runtime used the googleapis_imports alias anyway).
Apply the same MODULE.bazel change to the source archive via a patch.

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
@smolkaj smolkaj force-pushed the add-p4runtime-1.5.0 branch from 8ac49c7 to 6b8df55 Compare February 19, 2026 08:31
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Feb 19, 2026
Motivation: These changes are required for P4Runtime to build
successfuly for downstream users who depend on it in their own projects.
This was dicovered while upstreaming P4Runtime v1.5.0 to the BCR, see
bazelbuild/bazel-central-registry#7594.

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

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
@smolkaj smolkaj requested a review from meteorcloudy February 19, 2026 08:47
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Feb 20, 2026
…her Bazel workspace.

Details:
- In Bazel, it is possible and not uncommon that a project builds from its own workspace, but fails to build when depended on from another workspace.
- We have an example project in example/using-bzlmod that we build in our CI script to ensure both direct and transitive builds work.
- Despite this, in bazelbuild/bazel-central-registry#7594, P4Runtime did not build even though our CI script passed.
- The gap: our example project exercises some, but not all @p4runtime targets in a transitive fashion.
- The solution: run bazel build @p4runtime//... from the example workspace to close the gap.
- The proof: I reproduced the issue seen in bazelbuild/bazel-central-registry#7594 in #591.

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Feb 20, 2026
…her Bazel workspace.

Details:
- In Bazel, it is possible and not uncommon that a project builds from its own workspace, but fails to build when depended on from another workspace.
- We have an example project in example/using-bzlmod that we build in our CI script to ensure both direct and transitive builds work.
- Despite this, in bazelbuild/bazel-central-registry#7594, P4Runtime did not build even though our CI script passed.
- The gap: our example project exercises some, but not all @p4runtime targets in a transitive fashion.
- The solution: run bazel build @p4runtime//... from the example workspace to close the gap.
- The proof: I reproduced the issue seen in bazelbuild/bazel-central-registry#7594 in #591.

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Feb 20, 2026
…her Bazel workspace.

Details:
- In Bazel, it is possible and not uncommon that a project builds from its own workspace, but fails to build when depended on from another workspace.
- We have an example project in example/using-bzlmod that we build in our CI script to ensure both direct and transitive builds work.
- Despite this, in bazelbuild/bazel-central-registry#7594, P4Runtime did not build even though our CI script passed.
- The gap: our example project exercises some, but not all @p4runtime targets in a transitive fashion.
- The solution: run bazel build @p4runtime//... from the example workspace to close the gap.
- The proof: I reproduced the issue seen in bazelbuild/bazel-central-registry#7594 in #591.

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Feb 20, 2026
…her Bazel workspace.

Details:
- In Bazel, it is possible and not uncommon that a project builds from its own workspace, but fails to build when depended on from another workspace.
- We have an example project in example/using-bzlmod that we build in our CI script to ensure both direct and transitive builds work.
- Despite this, in bazelbuild/bazel-central-registry#7594, P4Runtime did not build even though our CI script passed.
- The gap: our example project exercises some, but not all @p4runtime targets in a transitive fashion.
- The solution: run bazel build @p4runtime//... from the example workspace to close the gap.
- The proof: I reproduced the issue seen in bazelbuild/bazel-central-registry#7594 in #591.

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
@smolkaj

smolkaj commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

All checks passing, would be grateful for a review so this can be merged.

@dzbarsky dzbarsky merged commit 2c8b5c4 into bazelbuild:main Feb 20, 2026
15 checks passed
@smolkaj smolkaj deleted the add-p4runtime-1.5.0 branch February 20, 2026 04:25
@smolkaj

smolkaj commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! 🚀 🚀

smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 1, 2026
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>
smolkaj added a commit to p4lang/p4runtime that referenced this pull request Mar 13, 2026
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>
ileitch pushed a commit to ileitch/bazel-central-registry that referenced this pull request Apr 7, 2026
cc @chrispsommers @matthewtlam @Eshaan-byte

This fixes p4lang/p4runtime#572

---------

Signed-off-by: Steffen Smolka <steffen.smolka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

presubmit-auto-run Presubmit jobs will be triggered for new changes automatically without reviewer's approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add P4Runtime to the Bazel Central Registry (BCR)

4 participants