Migrating to Bazel Modules (a.k.a. Bzlmod) - Toolchainization
Part of the promise of Bazel modules is that they are largely self-initializing in an order-independent way. Rule sets, in particular, no longer need to burden users with importing and invoking macros to instantiate repositories and toolchains in a specific order. This burden now shifts to rule set maintainers, but the existing implementation may not provide this ease of use without modification.
This post describes the introduction of a new "toolchainized" API for
rules_scala v7.0.0 that better encapsulates toolchain configurations and
dependencies. We'll see how this new design enables optimal Bzlmod
compatibility, while simultaneously shrinking the legacy WORKSPACE
API surface
without losing functionality. We'll also see how the Bzlmod and legacy
WORKSPACE
APIs provide similar interfaces while sharing the same underlying
implementation, facilitating Bzlmod migrations.