Skip to content

Commit

Permalink
fix: don't set distribs in version transitioning rule (#1412)
Browse files Browse the repository at this point in the history
This makes the version-aware transition rule compatible with an upcoming
Bazel change that
disallows setting unknown attributes to None (the `distribs` attribute,
in this case).

The `distribs` attribute was common to all rules, but it has been long
deprecated and
it won't be part of every rule in upcoming Bazel versions. The previous
implementation
resulted in setting `distribs = None` on the target. Bazel won't support
setting
undefined attributes to None.

Addresses: bazelbuild/bazel#19403

---------

Co-authored-by: Richard Levasseur <[email protected]>
  • Loading branch information
comius and rickeylev authored Sep 12, 2023
1 parent 5ea804f commit 4250824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ A brief description of the categories of changes:

## Unreleased

### Changed
* (multi-version) The `distribs` attribute is no longer propagated. This
attribute has been long deprecated by Bazel and shouldn't be used.

### Added

* (bzlmod, entry_point) Added
Expand Down
2 changes: 0 additions & 2 deletions python/config_settings/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _py_rule(rule_impl, transition_rule, name, python_version, **kwargs):
# https://bazel.build/reference/be/common-definitions#common-attributes
compatible_with = kwargs.pop("compatible_with", None)
deprecation = kwargs.pop("deprecation", None)
distribs = kwargs.pop("distribs", None)
exec_compatible_with = kwargs.pop("exec_compatible_with", None)
exec_properties = kwargs.pop("exec_properties", None)
features = kwargs.pop("features", None)
Expand All @@ -166,7 +165,6 @@ def _py_rule(rule_impl, transition_rule, name, python_version, **kwargs):
common_attrs = {
"compatible_with": compatible_with,
"deprecation": deprecation,
"distribs": distribs,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
"features": features,
Expand Down

0 comments on commit 4250824

Please sign in to comment.