Migrate TensoBoard builds to Bazel 8 - #7150
Open
psamanoelton wants to merge 10 commits into
Open
Conversation
Upgrade TensorBoard to Bazel 8.7.0, make Bzlmod the only dependency-resolution path, and migrate the Closure, Sass, Rust, protobuf/gRPC, Python, Java, and frontend build dependencies needed to remove the WORKSPACE bridge.
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.
Summary
This change upgrades TensorBoard's OSS build stack from Bazel 7.7.0 to Bazel 8.7.0 and completes the transition to Bazel Modules (Bzlmod).
Bzlmod is now TensorBoard's only dependency-resolution path. WORKSPACE evaluation is disabled by default, the transitional
WORKSPACE.bzlmodbridge and legacyWORKSPACEfile are removed, and the build succeeds with--noenable_workspace.The migration also updates the major Bazel rulesets and language toolchains needed by TensorBoard's Python, Java, TypeScript, Sass, Closure, protobuf/gRPC, and Rust targets. TensorFlow remains a pip/runtime dependency rather than a source-build dependency, so the Bazel stack can be upgraded independently.
Motivation
The earlier Bzlmod migration intentionally remained on Bazel 7.7.0 and kept a WORKSPACE compatibility bridge for dependencies that were not module-native. That limited the benefits of Bzlmod and left TensorBoard dependent on rules and repository patterns that are deprecated or incompatible with Bazel 8.
This change moves the supported build to Bazel 8.7.0, updates or replaces those dependencies, and makes the module graph the single source of truth for build dependency resolution.
Main changes
Upgrade and constrain Bazel
.bazelversion, CI, and the development container.>=8.7.0and<9.0.0inMODULE.bazel..bazelrc.WORKSPACE,WORKSPACE.bzlmod,third_party/workspace.bzl, andorphaned WORKSPACE compatibility repositories.
bazel mod graph --lockfile_mode=error.module-only repository.
Upgrade the module-native build stack
The Bazel module graph now uses current Bazel 8-compatible releases, including:
bazel_skylib1.9.2rules_cc0.2.22rules_java9.8.0rules_jvm_external7.1rules_python2.3.1rules_shell0.8.0rules_rust0.73.0rules_closure0.16.0aspect_rules_js3.4.0aspect_rules_ts3.10.0gzgz_rules_sass1.0.4The module lockfile and Maven lockfile are regenerated for the new graph. Small compatibility patches are documented in
patches/README.md, together with the condition for removing each patch.Migrate Closure, Sass, and Java dependencies
rules_closurerelease.bazelbuild/rules_sasswith the maintained Bazel 8-compatible gzgz_rules_sassfork and a TensorBoard adapter for the removednpm_sass_library` API.align Guava with the grpc-java dependency graph.
Migrate Rustboard to crate_universe
rules_rustcrate_universe extension.Cargo.lock.third_party/rustcargo-raze repository files.Modernize the frontend dependency path
rules_nodejs5.8.1 Yarn/concatjs stack through a Bzlmod extension instead of WORKSPACE.yarn_installfor deterministic setup.rules_js,rules_ts, and an isolated pnpm-backed package workspace.rules_tscanary target so production TypeScript targets can migrate incrementally without changing the existing provider graph in this PR.Update Python, protobuf, and CI behavior
Validation
The following workflows pass locally in fresh Linux containers:
Additional validation included:
Scope and follow-up work
This PR intentionally validates the Bazel build on Linux. Windows and macOS builds were not tested.
Recommended follow-up work:
rules_nodejs/Yarn/concatjs torules_js,rules_ts, and pnpm.rules_pythonimplicit__init__.pywarnings.Known limitation
The build no longer depends on WORKSPACE evaluation. However, production frontend targets still use the legacy
rules_nodejs5.8.1 concatjs APIs, instantiated and patched through Bzlmod. The parallelrules_js/rules_tsworkspace establishes the replacement path, but migrating every production TypeScript target is intentionally left for follow-up work.