[9.0.0] Add attr.label_list_dict
#27550
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivating examples for adding this type:
patchesparameters on their module extensions that accept lists of patches to apply per external dependency. With WORKSPACE, they relied onattr.string_list_dict, but the lack of repo mapping means that there is no direct port. Users would need to migrate to individual tags per hub repo and dep to supply patches.Adding this type doesn't incur a significant maintenance cost:
LABEL_LIST_DICTalready exists (added forexec_group_compatible_with), so this only requires wiring it up in Starlark. In fact, some of the added logic (duplicate checking) is relevant for this existing use case, we just forgot to add it.attr.string_list_dict), so there is no need for tooling to explicitly support the new type.Fixes #7989
RELNOTES[NEW]: The new
attr.label_list_dicttype accepts a dict in which keys are strings and values are lists of labels.Closes #27119.
PiperOrigin-RevId: 828510272
Change-Id: Ibf5ba97d049e592af2f61d91dbaa42cfe264f0bb
Commit b0f51a9