From bd7f428b5cb1e509a04f7ddc99aee523cf02233e Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Thu, 13 Oct 2022 12:17:30 -0700 Subject: [PATCH] Expose py extra action registration to Starlark. This is to allow the Starlark implementation to register the extra actions. Work towards #15897 PiperOrigin-RevId: 480954594 Change-Id: Idd10e1f135211ec163a1a12d65626f4a7f0f7a78 --- .../google/devtools/build/lib/rules/python/PyCommon.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java index be1fe8afa8dc55..ca6a40e883a6a7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java @@ -767,6 +767,13 @@ void addPyExtraActionPseudoAction() { if (ruleContext.getConfiguration().getActionListeners().isEmpty()) { return; } + registerPyExtraActionPseudoAction(ruleContext, dependencyTransitivePythonSources); + } + + // Public so that Starlark bindings can access it. Should only be called by PyStarlarkBuiltins. + // TODO(b/253059598): Remove support for this; https://github.com/bazelbuild/bazel/issues/16455 + public static void registerPyExtraActionPseudoAction( + RuleContext ruleContext, NestedSet dependencyTransitivePythonSources) { ruleContext.registerAction( makePyExtraActionPseudoAction( ruleContext.getActionOwner(),