From 66bee49d5f369f62ae4f8bb9b3b1b3821155da43 Mon Sep 17 00:00:00 2001 From: Ted Kaplan Date: Wed, 1 Mar 2023 09:15:38 -0800 Subject: [PATCH] Apply exec transition to lcov_merger in sh_test and cc_test Fixes #17630 Closes #17631. PiperOrigin-RevId: 513254952 Change-Id: Id97892db8adca0d8bbb5ecd87a44e3f711a5b56c --- .../devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java | 5 ++++- .../devtools/build/lib/bazel/rules/sh/BazelShTestRule.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java index 70eb4c7303ccf8..8181dd80064343 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java @@ -48,7 +48,10 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) // to decorate data symbols imported from DLL. .override(attr("linkstatic", BOOLEAN).value(OS.getCurrent() == OS.WINDOWS)) .override(attr("stamp", TRISTATE).value(TriState.NO)) - .add(attr(":lcov_merger", LABEL).value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) + .add( + attr(":lcov_merger", LABEL) + .cfg(ExecutionTransitionFactory.create()) + .value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) .add( attr("$collect_cc_coverage", LABEL) .cfg(ExecutionTransitionFactory.create()) diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/sh/BazelShTestRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/sh/BazelShTestRule.java index b1fb50018d9515..e76fa6422ecc9c 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/sh/BazelShTestRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/sh/BazelShTestRule.java @@ -32,7 +32,10 @@ public final class BazelShTestRule implements RuleDefinition { public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment environment) { // TODO(bazel-team): Add :lcov_merger to every test rule as opposed to particular rules. builder - .add(attr(":lcov_merger", LABEL).value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) + .add( + attr(":lcov_merger", LABEL) + .cfg(ExecutionTransitionFactory.create()) + .value(BaseRuleClasses.getCoverageOutputGeneratorLabel())) .add( attr("$launcher", LABEL) .cfg(ExecutionTransitionFactory.create())