Skip to content

build(bazel): converge every subtree on Bazel 9.1.1 - #525

Merged
balajinvda merged 2 commits into
mainfrom
build/bazel-9-convergence
Jul 29, 2026
Merged

build(bazel): converge every subtree on Bazel 9.1.1#525
balajinvda merged 2 commits into
mainfrom
build/bazel-9-convergence

Conversation

@balajinvda

@balajinvda balajinvda commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why

Phase 3 of docs/dev/bazel-consolidation.md (#445).

Fourteen subtrees were on Bazel 8.6.0 while the root and the four worker services were already on 9.1.1. A nested module on a different Bazel version than the root cannot be folded into it, so this gates every migration that follows.

What changed

sh_test is no longer a native global in Bazel 9. Eight subtrees used it without loading it — fine on 8.6.0, impossible on 9. They now declare rules_shell and load the symbol, matching the root.

The protoc toolchain is the interesting half, and the fix removes the coupling instead of re-pinning it.

Every subtree paired toolchains_protoc with an explicit protoc version. protobuf's authenticity check requires an exact match against the protobuf module:

grep -q "^libprotoc ${RELEASE_VERSION}"    # RELEASE_VERSION = "v33.4"

So protobuf@33.4 demands protoc 33.4, and toolchains_protoc@0.6.1 ships only up to v33.0:

Pin attempted Result
v29.0 (what every subtree had) mismatch
v33.0 (what root has) mismatch
v33.4 (what protobuf wants) key "v33.4" not found in dictionary

The pairing is unsatisfiable, not misconfigured.

protobuf already ships prebuilt protoc for all nine platforms and registers the toolchain itself, so it can just provide protoc:

-bazel_dep(name = "toolchains_protoc", version = "0.6.1")
-protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
-protoc.toolchain(google_protobuf = "com_google_protobuf", version = "v29.0")
+bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")

That deletes ten per-subtree version pins. The protoc version is now derived from the protobuf module rather than restated beside it, so the two cannot drift apart again — the same shape as declaring the Go toolchain once and deriving it everywhere (#473).

Count
Subtrees moved 8.6.0 → 9.1.1 14
toolchains_protoc deps removed 10
protoc version pins removed 10
rules_shell deps added 8
sh_test loads added 10

The change removes more than it adds.

Customer Release Notes

Not customer visible.

Plan Summary

Not applicable.

Usage

Not applicable.

Testing

Built locally on 9.1.1:

  • ratelimiter — clean, 2203 actions
  • nvca — clean, 2133 actions (the heavy-proto case, vendored tree)
  • stargate — fails on a Cap'n Proto build script, but fails identically on its original 8.6.0 state, so it is pre-existing and unrelated to this change

The remaining eleven are validated by the per-subtree CI matrix, which builds each module independently, so any failure names its subtree directly.

Notes

Root is deliberately untouched. It carries the same stale toolchains_protoc + v33.0 pairing against protobuf@33.4 and only escapes the authenticity check because nothing in its graph triggers validation today. That is a latent disagreement, not a healthy configuration, but changing root has a far wider blast radius than changing subtrees that were already off-version. It follows as a separate change once this pattern has proven itself in CI.

References

None

Related Merge Requests/Pull Requests

Phase 2: #484, #491. Toolchain single-source precedent: #473. Plan: #445.

Dependencies

Removes toolchains_protoc from ten modules. Adds protobuf 33.4 (already in the resolved graph) and rules_shell 0.8.0 (already used by the root).

Summary by CodeRabbit

  • Build & Compatibility
    • Upgraded Bazel tooling to 9.1.1 across multiple services and libraries.
    • Improved shell test support by switching to a compatible sh_test implementation.
    • Standardized and pinned protobuf/compiler tooling for more consistent builds.
  • Bug Fixes
    • Fixed build setup for automated shell tests.
    • Removed conflicting protoc toolchain wiring to prevent build inconsistencies.
  • Chores
    • Updated the byoo-otel-collector recorded version.

Phase 3 of docs/dev/bazel-consolidation.md. Fourteen subtrees were on
Bazel 8.6.0 while the root and the four workers were on 9.1.1. Nested
modules on a different Bazel version than the root cannot be folded into
it, so this gates every migration that follows.

Two things had to change to make 9.1.1 work.

sh_test is no longer a native global. Eight subtrees used it without
loading it, which worked on 8.6.0 and cannot on 9. They now declare
rules_shell and load the symbol, matching what the root already does.

The protoc toolchain was the harder half, and the fix removes the
problem rather than re-pinning it. Every subtree paired
toolchains_protoc with an explicit protoc version, and protobuf's
authenticity check requires protoc to match the protobuf module exactly:

  grep -q "^libprotoc ${RELEASE_VERSION}"    # RELEASE_VERSION = v33.4

protobuf 33.4 therefore demands protoc 33.4, and toolchains_protoc 0.6.1
only ships up to v33.0. No pin value satisfies both: v29.0 mismatches,
v33.0 mismatches, and v33.4 is not in its dictionary. The pairing is
unsatisfiable, not misconfigured.

protobuf already ships prebuilt protoc for all nine platforms and
registers the toolchain itself, so it can simply provide protoc. Drop
toolchains_protoc and the ten per-subtree version pins with it. The
protoc version is now derived from the protobuf module instead of
restated next to it, so the two cannot disagree again. This is the same
shape as declaring the Go toolchain once and deriving it everywhere.

Root is deliberately untouched. It carries the same stale pairing and
only escapes the check because nothing in its graph triggers validation
today. Changing it has a wider blast radius than changing subtrees that
were already off-version, so it follows separately once this has proven
itself.

Verified locally on 9.1.1: ratelimiter builds clean (2203 actions), and
nvca builds clean (2133 actions), which is the heavy-proto case with a
vendored tree. stargate fails on a Cap'n Proto build script, but it fails
identically on its original 8.6.0 state, so that is pre-existing and
unrelated. The remaining eleven are validated by the per-subtree CI
matrix, which builds each independently.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@balajinvda
balajinvda requested review from a team as code owners July 29, 2026 14:26
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fa64da75-a7b7-475a-8eec-976689588fb0

📥 Commits

Reviewing files that changed from the base of the PR and between f0041dd and a4cb97a.

⛔ Files ignored due to path filters (1)
  • src/invocation-plane-services/http-invocation/MODULE.bazel.lock is excluded by !**/*.lock, !**/MODULE.bazel.lock
📒 Files selected for processing (2)
  • src/compute-plane-services/byoo-otel-collector/VERSION
  • src/invocation-plane-services/http-invocation/MODULE.bazel

📝 Walkthrough

Walkthrough

Bazel version pins are upgraded to 9.1.1 across services. Shell tests explicitly use rules_shell, while several modules replace toolchains_protoc configuration with pinned protobuf module tooling. The OpenTelemetry collector version is also bumped to 0.157.2.

Changes

Bazel 9 migration

Layer / File(s) Summary
Bazel version baseline
src/**/.bazelversion, src/compute-plane-services/byoo-otel-collector/VERSION
Bazel version pins change from 8.6.0 to 9.1.1, and the collector version changes from 0.157.1 to 0.157.2.
External sh_test rule wiring
src/**/MODULE.bazel, src/**/BUILD.bazel
rules_shell 0.8.0 is added and existing shell-test BUILD files load sh_test explicitly.
Protobuf protoc toolchain migration
src/**/MODULE.bazel
Pinned protobuf dependencies replace or supplement toolchains_protoc configuration for protoc resolution.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • NVIDIA/nvcf#506: Contains the matching OpenTelemetry collector version bump.

Suggested reviewers: kristinapathak

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the build-system Bazel 9.1.1 convergence across subtrees.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build/bazel-9-convergence

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/invocation-plane-services/grpc-proxy/.bazelversion`:
- Line 1: Update the grpc-proxy Bazel version reference in README.md to 9.1.1,
replacing the outdated 8.6.0 pin while preserving the surrounding documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cf07c3f5-887e-4376-a427-b3714dea055c

📥 Commits

Reviewing files that changed from the base of the PR and between 2c3661b and f0041dd.

⛔ Files ignored due to path filters (2)
  • src/compute-plane-services/nvca/MODULE.bazel.lock is excluded by !**/*.lock, !**/MODULE.bazel.lock
  • src/libraries/rust/stargate/MODULE.bazel.lock is excluded by !**/*.lock, !**/MODULE.bazel.lock
📒 Files selected for processing (38)
  • src/compute-plane-services/byoo-otel-collector/.bazelversion
  • src/compute-plane-services/byoo-otel-collector/BUILD.bazel
  • src/compute-plane-services/byoo-otel-collector/MODULE.bazel
  • src/compute-plane-services/ess-agent/.bazelversion
  • src/compute-plane-services/ess-agent/BUILD.bazel
  • src/compute-plane-services/ess-agent/MODULE.bazel
  • src/compute-plane-services/image-credential-helper/.bazelversion
  • src/compute-plane-services/image-credential-helper/MODULE.bazel
  • src/compute-plane-services/image-credential-helper/cmd/image-credential-helper/BUILD.bazel
  • src/compute-plane-services/nvca/.bazelversion
  • src/compute-plane-services/nvca/MODULE.bazel
  • src/compute-plane-services/nvcf-unbound/.bazelversion
  • src/compute-plane-services/nvcf-unbound/MODULE.bazel
  • src/compute-plane-services/nvcf-unbound/cmd/webhook/BUILD.bazel
  • src/control-plane-services/function-autoscaler/.bazelversion
  • src/control-plane-services/function-autoscaler/MODULE.bazel
  • src/control-plane-services/helm-reval/.bazelversion
  • src/control-plane-services/helm-reval/MODULE.bazel
  • src/control-plane-services/helm-reval/cmd/reval-service/BUILD.bazel
  • src/control-plane-services/nats-auth-callout/.bazelversion
  • src/control-plane-services/nats-auth-callout/MODULE.bazel
  • src/control-plane-services/nats-auth-callout/cmd/nvcf-nats-auth-callout-service/BUILD.bazel
  • src/invocation-plane-services/grpc-proxy/.bazelversion
  • src/invocation-plane-services/grpc-proxy/MODULE.bazel
  • src/invocation-plane-services/http-invocation/.bazelversion
  • src/invocation-plane-services/http-invocation/MODULE.bazel
  • src/invocation-plane-services/llm-api-gateway/.bazelversion
  • src/invocation-plane-services/llm-api-gateway/MODULE.bazel
  • src/invocation-plane-services/ratelimiter/.bazelversion
  • src/invocation-plane-services/ratelimiter/MODULE.bazel
  • src/invocation-plane-services/vanity-gateway/.bazelversion
  • src/invocation-plane-services/vanity-gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/MODULE.bazel
  • src/libraries/rust/stargate/.bazelversion
  • src/libraries/rust/stargate/MODULE.bazel
  • src/libraries/rust/stargate/crates/pylon/BUILD.bazel
  • src/libraries/rust/stargate/crates/stargate-k8s-router/BUILD.bazel
  • src/libraries/rust/stargate/crates/stargate/BUILD.bazel
💤 Files with no reviewable changes (2)
  • src/control-plane-services/function-autoscaler/MODULE.bazel
  • src/invocation-plane-services/http-invocation/MODULE.bazel

Comment thread src/invocation-plane-services/grpc-proxy/.bazelversion
Two CI failures from the previous commit.

http-invocation kept a third reference to the protoc extension,
use_repo(protoc, "com_google_protobuf"), which the scripted edit did not
match: it handled the bazel_dep and the protoc.toolchain call but not
use_repo. Removing the extension left that line pointing at an undefined
name, so the module failed to load. The service already declares protobuf
directly for its cargo_build_script, so the use_repo was redundant once
protobuf provides protoc; the surrounding comment described the old
toolchains_protoc arrangement and is corrected.

Rescanned every module for protoc references including use_repo forms.
http-invocation was the only one, and it now builds clean locally.

This commit also bumps the byoo collector version. Changing its
.bazelversion and MODULE.bazel trips check-byoo-otel-collector-version,
which requires a bump whenever anything under byoo-otel-collector/
changes. 0.157.2 is the value #506 was opening to set, for the
same underlying reason: #444 changed collector files while its own bump
was neutralised by a rebase, leaving two builds sharing 0.157.1. Folding
it here keeps a single PR touching VERSION rather than two that would
conflict; #506 is superseded.

Co-authored-by: Balaji Ganesan <bganesan@nvidia.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@balajinvda
balajinvda added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 846bde4 Jul 29, 2026
30 checks passed
@balajinvda
balajinvda deleted the build/bazel-9-convergence branch July 29, 2026 17:42
@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-function-autoscaler-v1.18.9 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-helm-reval-api-v0.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-grpc-proxy-v1.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-ratelimiter-v1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-invocation-service-v0.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version stargate-v0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-llm-api-gateway-v0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-ai-api-gateway-service-v1.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-unbound-v0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-ess-agent-v1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@balajinvda

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version nvcf-image-credential-helper-v0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants