Skip to content

Bazel 8 upgrade#433

Open
lolski wants to merge 19 commits intomasterfrom
bazel-8-upgrade
Open

Bazel 8 upgrade#433
lolski wants to merge 19 commits intomasterfrom
bazel-8-upgrade

Conversation

@lolski
Copy link
Member

@lolski lolski commented Feb 27, 2026

Motivation

Update Bazel version from 6.2 to 8.5.1.

The upgrade is done in a backwards-compatible way, such that "upstream" repositories that are yet to be upgraded may depend on this repository. This is done by preserving WORKSPACE and the deps.bzl loader files alongside the new Bazel 8 ones. Once every repository has been upgraded to Bazel 8, these files will be removed.

Implementation

Create MODULE.bazel

The new module declaration is organized into these sections:

  1. Common (bazel_skylib, rules_pkg)
  2. Languages & toolchains: Rust, Python, Kotlin, Java
  3. Package managers: Rust crates, Maven
  4. TypeDB repos (typedb_dependencies, typedb_bazel_distribution, typedb_behaviour)

Syntactic and rule changes

  • Update behaviour test feature path resolution through the new construct $(rootpath) to resolve directory of the feature file

lolski and others added 18 commits February 27, 2026 16:46
Documents the strategy for migrating from WORKSPACE (Bazel 6.2.0)
to Bzlmod (Bazel 8.0.0), including MODULE.bazel structure, dependency
handling, and verification steps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 20 targets build successfully with Bazel 8.0.0.

Changes:
- Add MODULE.bazel with local path overrides and isolated crate extension
- Update .bazelversion from 6.2.0 to 8.0.0
- Update .bazelrc with Bzlmod config and experimental flags
- Update BUILD to remove rust_analyzer_toolchain_tools reference
  (not automatically created by Bzlmod extension, optional for IDE)
- Replace migration plan with status document
- Add MODULE.bazel.lock for reproducible builds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove isolate=True from crate extension to share crate types across
all TypeDB modules. This ensures type compatibility when typeql is
used as a dependency of typedb.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In Bazel 8 Bzlmod, external repos use canonical names with a `+`
suffix in the execroot, so the hardcoded `../typedb_behaviour/` path
no longer resolves. Use $(rootpath) to let Bazel provide the correct
path at build time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
$(rootpath) requires the label to be a direct prerequisite of the
rule. The file was only transitively available via the features
filegroup, which is insufficient for make variable expansion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lolski lolski marked this pull request as ready for review February 27, 2026 17:05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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