Skip to content

Commit 6046e9e

Browse files
comiusrickeylev
andauthored
cleanup: remove support for extra actions (#3210)
This removes the support for Bazel "extra actions". These have been long deprecated and little to no usage. Because of how long they've been deprecated, their lack of use, and how long their replacement (aspects) has been available, this is not being considered a breaking change. Fixes bazelbuild/bazel#16455 Fixes #3215 --------- Co-authored-by: Richard Levasseur <[email protected]> Co-authored-by: Richard Levasseur <[email protected]>
1 parent 5ac4521 commit 6046e9e

File tree

4 files changed

+13
-29
lines changed

4 files changed

+13
-29
lines changed

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ BEGIN_UNRELEASED_TEMPLATE
2828
2929
[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0
3030
31+
{#v0-0-0-removed}
32+
### Removed
33+
34+
* Nothing removed.
3135
{#v0-0-0-changed}
3236
### Changed
3337
* Nothing changed.
@@ -40,9 +44,6 @@ BEGIN_UNRELEASED_TEMPLATE
4044
### Added
4145
* Nothing added.
4246
43-
{#v0-0-0-removed}
44-
### Removed
45-
* Nothing removed.
4647
4748
END_UNRELEASED_TEMPLATE
4849
-->
@@ -52,6 +53,12 @@ END_UNRELEASED_TEMPLATE
5253

5354
[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0
5455

56+
{#v0-0-0-removed}
57+
### Removed
58+
* (core rules) Support for Bazel's long deprecated "extra actions" has been
59+
removed
60+
([#3215](https://github.com/bazel-contrib/rules_python/issues/3215)).
61+
5562
{#v0-0-0-changed}
5663
### Changed
5764
* Nothing changed.
@@ -66,9 +73,6 @@ END_UNRELEASED_TEMPLATE
6673
### Added
6774
* Nothing added.
6875

69-
{#v0-0-0-removed}
70-
### Removed
71-
* Nothing removed.
7276

7377
{#v1-6-0}
7478
## [1.6.0] - 2025-08-23

python/private/common.bzl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ def create_py_info(
435435
if PyInfo in target or (BuiltinPyInfo != None and BuiltinPyInfo in target):
436436
py_info.merge(_get_py_info(target))
437437

438-
deps_transitive_sources = py_info.transitive_sources.build()
439438
py_info.transitive_sources.add(required_py_files)
440439

441440
# We only look at data to calculate uses_shared_libraries, if it's already
@@ -457,7 +456,7 @@ def create_py_info(
457456
if py_info.get_uses_shared_libraries():
458457
break
459458

460-
return py_info.build(), deps_transitive_sources, py_info.build_builtin_py_info()
459+
return py_info.build(), py_info.build_builtin_py_info()
461460

462461
def _get_py_info(target):
463462
return target[PyInfo] if PyInfo in target or BuiltinPyInfo == None else target[BuiltinPyInfo]

python/private/py_executable.bzl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ def _create_providers(
18381838
PyCcLinkParamsInfo(cc_info = cc_info),
18391839
)
18401840

1841-
py_info, deps_transitive_sources, builtin_py_info = create_py_info(
1841+
py_info, builtin_py_info = create_py_info(
18421842
ctx,
18431843
original_sources = original_sources,
18441844
required_py_files = required_py_files,
@@ -1848,14 +1848,6 @@ def _create_providers(
18481848
imports = imports,
18491849
)
18501850

1851-
# TODO(b/253059598): Remove support for extra actions; https://github.com/bazelbuild/bazel/issues/16455
1852-
listeners_enabled = _py_builtins.are_action_listeners_enabled(ctx)
1853-
if listeners_enabled:
1854-
_py_builtins.add_py_extra_pseudo_action(
1855-
ctx = ctx,
1856-
dependency_transitive_python_sources = deps_transitive_sources,
1857-
)
1858-
18591851
providers.append(py_info)
18601852
if builtin_py_info:
18611853
providers.append(builtin_py_info)

python/private/py_library.bzl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ load(":normalize_name.bzl", "normalize_name")
4545
load(":precompile.bzl", "maybe_precompile")
4646
load(":py_cc_link_params_info.bzl", "PyCcLinkParamsInfo")
4747
load(":py_info.bzl", "PyInfo", "VenvSymlinkEntry", "VenvSymlinkKind")
48-
load(":py_internal.bzl", "py_internal")
4948
load(":reexports.bzl", "BuiltinPyInfo")
5049
load(":rule_builders.bzl", "ruleb")
5150
load(
@@ -55,8 +54,6 @@ load(
5554
)
5655
load(":version.bzl", "version")
5756

58-
_py_builtins = py_internal
59-
6057
LIBRARY_ATTRS = dicts.add(
6158
COMMON_ATTRS,
6259
PY_SRCS_ATTRS,
@@ -164,7 +161,7 @@ def py_library_impl(ctx, *, semantics):
164161
imports, venv_symlinks = _get_imports_and_venv_symlinks(ctx, semantics)
165162

166163
cc_info = semantics.get_cc_info_for_library(ctx)
167-
py_info, deps_transitive_sources, builtins_py_info = create_py_info(
164+
py_info, builtins_py_info = create_py_info(
168165
ctx,
169166
original_sources = direct_sources,
170167
required_py_files = required_py_files,
@@ -175,14 +172,6 @@ def py_library_impl(ctx, *, semantics):
175172
venv_symlinks = venv_symlinks,
176173
)
177174

178-
# TODO(b/253059598): Remove support for extra actions; https://github.com/bazelbuild/bazel/issues/16455
179-
listeners_enabled = _py_builtins.are_action_listeners_enabled(ctx)
180-
if listeners_enabled:
181-
_py_builtins.add_py_extra_pseudo_action(
182-
ctx = ctx,
183-
dependency_transitive_python_sources = deps_transitive_sources,
184-
)
185-
186175
providers = [
187176
DefaultInfo(files = default_outputs, runfiles = runfiles),
188177
py_info,

0 commit comments

Comments
 (0)