Automated rollback of commit 52c4d05d1bfd54ea901e9926be7b262dd45e34de.
*** Reason for rollback ***
http://b/109733929
*** Original change description ***
Add LabelLateBoundDefault to :coverage_report_generator attribute
RELNOTES:none
PiperOrigin-RevId: 199308190
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
index aa45dba..2e5c1d5 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
@@ -92,17 +92,6 @@
(rule, attributes, configuration) -> configuration.getCoverageSupport());
}
- public static final String DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE =
- "//tools/test:coverage_report_generator";
-
- public static LabelLateBoundDefault<TestConfiguration> coverageReportGeneratorAttribute(
- Label defaultValue) {
- return LabelLateBoundDefault.fromTargetConfiguration(
- TestConfiguration.class,
- defaultValue,
- (rule, attributes, configuration) -> configuration.getCoverageReportGenerator());
- }
-
// TODO(b/65746853): provide a way to do this without passing the entire configuration
/** Implementation for the :run_under attribute. */
@AutoCodec
@@ -178,11 +167,9 @@
coverageSupportAttribute(env.getToolsLabel(DEFAULT_COVERAGE_SUPPORT_VALUE))))
// Used in the one-per-build coverage report generation action.
.add(
- attr(":coverage_report_generator", LABEL)
+ attr("$coverage_report_generator", LABEL)
.cfg(HostTransition.INSTANCE)
- .value(
- coverageReportGeneratorAttribute(
- env.getToolsLabel(DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE)))
+ .value(env.getLabel("//tools/defaults:coverage_report_generator"))
.singleArtifact())
// The target itself and run_under both run on the same machine. We use the DATA config
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
index 5c38617..73236d4 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java
@@ -191,13 +191,9 @@
toolsRepository + BaseRuleClasses.DEFAULT_COVERAGE_SUPPORT_VALUE))))
// Used in the one-per-build coverage report generation action.
.add(
- attr(":coverage_report_generator", LABEL)
+ attr("$coverage_report_generator", LABEL)
.cfg(HostTransition.INSTANCE)
- .value(
- BaseRuleClasses.coverageReportGeneratorAttribute(
- labelCache.getUnchecked(
- toolsRepository
- + BaseRuleClasses.DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE)))
+ .value(labelCache.getUnchecked("//tools/defaults:coverage_report_generator"))
.singleArtifact())
.add(attr(":run_under", LABEL).cfg(lipoDataTransition).value(RUN_UNDER))
.build();
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java
index e421c155..b6b5941 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java
@@ -329,7 +329,7 @@
// contain rules with baseline coverage but no test rules that have coverage enabled, and in
// that case, we still need the report generator.
reportGenerator = ruleContext.getPrerequisiteArtifact(
- ":coverage_report_generator", Mode.HOST);
+ "$coverage_report_generator", Mode.HOST);
}
return new TestParams(runsPerTest, shards, TestTimeout.getTestTimeout(ruleContext.getRule()),
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
index 72a2499..17495289 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
@@ -180,9 +180,7 @@
@Override
public FragmentOptions getHost() {
TestOptions hostOptions = (TestOptions) getDefault();
- //Need co copy LateBound attribute to make sut its are not null in HostConfiguration.
hostOptions.coverageSupport = this.coverageSupport;
- hostOptions.coverageReportGenerator = this.coverageReportGenerator;
return hostOptions;
}
}