Skip to content

Commit

Permalink
Fix non-Go transitions
Browse files Browse the repository at this point in the history
bazel-contrib#3108 introduced an
improvement that aims to remove Go-specific transitions on non-Go
dependencies.

This fix was incomplete. It did not cover the case where a setting
transitions from truthy to falsy. (e.g. `["bla"] => []`)

This further reduces duplicated non-Go targets, specifically reducing
the number of times Cgo C/C++ dependencies are rebuilt.
  • Loading branch information
riptl committed Jan 24, 2023
1 parent cf78385 commit 66a7cf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/private/rules/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def _non_go_transition_impl(settings, _attr):
# Reset to the original value of the setting before go_transition.
new_settings[key] = json.decode(original_value)
else:
new_settings[key] = settings[key]
new_settings[key] = _common_reset_transition_dict[key]

# Reset the value of the helper setting to its default for two reasons:
# 1. Performance: This ensures that the Go settings of non-Go
Expand Down

1 comment on commit 66a7cf0

@ripatel-fd
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is incorrect

Please sign in to comment.