Getting ready for the brave new Bazel Modules world

2025/09/29

Bazel modules promise to usher the era of trivial bazel dependency management. However, getting from here to there seems to be a journey fraught with peril. Migration guides are few and far between. And it’s never about the easy stuff what makes it fraught, it’s always the side quests and corner cases that create issues.

Since Bazel 9.0 promises to disable the old dependency management approaches based on WORKSPACE by the end of 2025, I figured we should better start preparing. This is my preparation central.

Realizations

I realized quickly that the overhead of migration can only be conquered by judiciously applying automation and simplification efforts.

In the past, we built jenga towers of dependencies, which we need to deconstruct and remake in the image of the new modules approach.

This is taking significant effort, but is worth it to me.

To manage the migration complexity, I adopted a few conventions which allow me to decouple my work on migrating the modules from BCR and publication. See the “Standardization” section below.

Repositories in topological order

You can expect that earlier listed repositories could be dependencies of later-listed repositories.

Standardization