bazelbuild / bazel-central-registry

The central registry of Bazel modules for the Bzlmod external dependency system.
https://registry.bazel.build
Apache License 2.0
260 stars 339 forks source link

Switch `toolchain_utils@toolchain_local_select#map` to a `label_keyed_string_dict` #3230

Closed mattyclarkson closed 5 days ago

mattyclarkson commented 5 days ago

bazelbuild/bazel#6fabb1f changed Bazel 7.4.0+ to not overfetch repository rule labels.

Switching toolchain_local_select#map to a label_keyed_string_dict is a breaking change but has few benefits:

Whilst a breaking change, this removes one of the warts in the module and increases the confidence to move to a stable 1.0.0 release.

The fix for downstream modules is simple: flip the key/value pairs. Usage such as:

toolchain_local_select(
    name = "abc",
    map = {
        "arm64-linux-gnu": "@abc-arm64-linux-gnu",
        "arm64-linux-musl": "@abc-arm64-linux-musl",
    },
)

Would switch to:

toolchain_local_select(
    name = "abc",
    map = {
        "@abc-arm64-linux-gnu", "arm64-linux-gnu" ,
        "@abc-arm64-linux-musl", "arm64-linux-musl",
    },
)