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 https://github.com/bazelbuild/bazel/issues/16455
Fixes https://github.com/bazel-contrib/rules_python/issues/3215
---------
Co-authored-by: Richard Levasseur <rlevasseur@google.com>
Co-authored-by: Richard Levasseur <richardlev@gmail.com>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9d5000..6678148 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,10 @@
[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0
+{#v0-0-0-removed}
+### Removed
+
+* Nothing removed.
{#v0-0-0-changed}
### Changed
* Nothing changed.
@@ -40,9 +44,6 @@
### Added
* Nothing added.
-{#v0-0-0-removed}
-### Removed
-* Nothing removed.
END_UNRELEASED_TEMPLATE
-->
@@ -52,6 +53,12 @@
[0.0.0]: https://github.com/bazel-contrib/rules_python/releases/tag/0.0.0
+{#v0-0-0-removed}
+### Removed
+* (core rules) Support for Bazel's long deprecated "extra actions" has been
+ removed
+ ([#3215](https://github.com/bazel-contrib/rules_python/issues/3215)).
+
{#v0-0-0-changed}
### Changed
* Nothing changed.
@@ -66,9 +73,6 @@
### Added
* Nothing added.
-{#v0-0-0-removed}
-### Removed
-* Nothing removed.
{#v1-6-0}
## [1.6.0] - 2025-08-23
diff --git a/python/private/common.bzl b/python/private/common.bzl
index 96f8ebe..9fc3668 100644
--- a/python/private/common.bzl
+++ b/python/private/common.bzl
@@ -435,7 +435,6 @@
if PyInfo in target or (BuiltinPyInfo != None and BuiltinPyInfo in target):
py_info.merge(_get_py_info(target))
- deps_transitive_sources = py_info.transitive_sources.build()
py_info.transitive_sources.add(required_py_files)
# We only look at data to calculate uses_shared_libraries, if it's already
@@ -457,7 +456,7 @@
if py_info.get_uses_shared_libraries():
break
- return py_info.build(), deps_transitive_sources, py_info.build_builtin_py_info()
+ return py_info.build(), py_info.build_builtin_py_info()
def _get_py_info(target):
return target[PyInfo] if PyInfo in target or BuiltinPyInfo == None else target[BuiltinPyInfo]
diff --git a/python/private/py_executable.bzl b/python/private/py_executable.bzl
index 30f18b5..5fafc89 100644
--- a/python/private/py_executable.bzl
+++ b/python/private/py_executable.bzl
@@ -1838,7 +1838,7 @@
PyCcLinkParamsInfo(cc_info = cc_info),
)
- py_info, deps_transitive_sources, builtin_py_info = create_py_info(
+ py_info, builtin_py_info = create_py_info(
ctx,
original_sources = original_sources,
required_py_files = required_py_files,
@@ -1848,14 +1848,6 @@
imports = imports,
)
- # TODO(b/253059598): Remove support for extra actions; https://github.com/bazelbuild/bazel/issues/16455
- listeners_enabled = _py_builtins.are_action_listeners_enabled(ctx)
- if listeners_enabled:
- _py_builtins.add_py_extra_pseudo_action(
- ctx = ctx,
- dependency_transitive_python_sources = deps_transitive_sources,
- )
-
providers.append(py_info)
if builtin_py_info:
providers.append(builtin_py_info)
diff --git a/python/private/py_library.bzl b/python/private/py_library.bzl
index ea2e608..1f3e4d8 100644
--- a/python/private/py_library.bzl
+++ b/python/private/py_library.bzl
@@ -45,7 +45,6 @@
load(":precompile.bzl", "maybe_precompile")
load(":py_cc_link_params_info.bzl", "PyCcLinkParamsInfo")
load(":py_info.bzl", "PyInfo", "VenvSymlinkEntry", "VenvSymlinkKind")
-load(":py_internal.bzl", "py_internal")
load(":reexports.bzl", "BuiltinPyInfo")
load(":rule_builders.bzl", "ruleb")
load(
@@ -55,8 +54,6 @@
)
load(":version.bzl", "version")
-_py_builtins = py_internal
-
LIBRARY_ATTRS = dicts.add(
COMMON_ATTRS,
PY_SRCS_ATTRS,
@@ -164,7 +161,7 @@
imports, venv_symlinks = _get_imports_and_venv_symlinks(ctx, semantics)
cc_info = semantics.get_cc_info_for_library(ctx)
- py_info, deps_transitive_sources, builtins_py_info = create_py_info(
+ py_info, builtins_py_info = create_py_info(
ctx,
original_sources = direct_sources,
required_py_files = required_py_files,
@@ -175,14 +172,6 @@
venv_symlinks = venv_symlinks,
)
- # TODO(b/253059598): Remove support for extra actions; https://github.com/bazelbuild/bazel/issues/16455
- listeners_enabled = _py_builtins.are_action_listeners_enabled(ctx)
- if listeners_enabled:
- _py_builtins.add_py_extra_pseudo_action(
- ctx = ctx,
- dependency_transitive_python_sources = deps_transitive_sources,
- )
-
providers = [
DefaultInfo(files = default_outputs, runfiles = runfiles),
py_info,