From 4a6d056a8d058ab98a01348fb0c046660ee99a71 Mon Sep 17 00:00:00 2001 From: Ted Kaplan Date: Mon, 27 Feb 2023 02:02:09 -0800 Subject: [PATCH] Add host transition to lcov_merger in Java version of py_test Fixes #17568 Closes #17587. PiperOrigin-RevId: 512563828 Change-Id: If95b26f5b86b2848dbaaf6129d1daa1538a22826 --- .../build/lib/bazel/rules/python/BazelPyTestRule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java index a58c8eef1416bc..0ebab840205e60 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPyTestRule.java @@ -57,7 +57,10 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) attr("$launcher", LABEL) .cfg(ExecutionTransitionFactory.create()) .value(env.getToolsLabel("//tools/launcher:launcher"))) - .add(attr(":lcov_merger", LABEL).value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) + .add( + attr(":lcov_merger", LABEL) + .cfg(ExecutionTransitionFactory.create()) + .value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) // Add the script as an attribute in order for py_test to output code coverage results for // code covered by CC binaries invocations. .add(