Skip to content
Verified Commit 1d48d2e4 authored by Matthew Clarkson's avatar Matthew Clarkson
Browse files

fix(toolchain_local_select): use `label_keyed_string_dict` for `map` attribute

BREAKING CHANGE: `toolchain_local_select#map` is now flipped taking the labels as they keys rather than as the values.

Previous releases had the following setup:

```py
download_file(
    name = "abc-arm64-linux-gnu",
    output = "abc",
)

download_file(
    name = "abc-arm64-linux-musl",
    output = "abc",
)

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

This prevented eagarly overfetching all the repositories that would be
selected. As of Bazel 7.4.0+[1], it no longer overfetches so the `map`
attribute has been switched to a `label_keyed_string_dict`:

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

The repository rule will _only_ fetch the repostory label that has been selected due
to the triplet value matching.

Whilst this is a breaking change, it will introduce a regression on Bazel 7.3 and below
which will overfetch the repositories. It is *highly* recommended to use Bazel 7.4 and above.

[1]: https://github.com/bazelbuild/bazel/commit/6fabb1fc6869a204373e5ee0adde696a659415dd
parent 793273a2
Loading
Loading
Loading
Loading
  • GITLAB_TOKEN @group_3575_bot_1fa64dd2caebb37307063a803b95a420

    mentioned in commit 3a1c2725

    ·

    mentioned in commit 3a1c2725

    Toggle commit list
  • GITLAB_TOKEN @group_3575_bot_1fa64dd2caebb37307063a803b95a420

    mentioned in commit c742d96b

    ·

    mentioned in commit c742d96b

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment