aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar dbabkin <dbabkin@google.com>2018-06-05 09:25:03 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-05 09:27:07 -0700
commitc04ce79e4f719df54e3564f58a2ea26529ac1494 (patch)
tree7ce5aa924bf1d68ade5561ecd08790788b3736fa
parent1fb9fa7cddf00859f9f56d18f60b457b2804bdf9 (diff)
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
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java17
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkRuleClassFunctions.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java2
4 files changed, 5 insertions, 24 deletions
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 aa45dba3a1..2e5c1d56c9 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 @@ public class BaseRuleClasses {
(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 @@ public class BaseRuleClasses {
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 5c386177b8..73236d45da 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 @@ public class SkylarkRuleClassFunctions implements SkylarkRuleFunctionsApi<Artifa
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 e421c15596..b6b59414f6 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 @@ public final class TestActionBuilder {
// 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 72a2499ea4..1749528904 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 @@ public class TestConfiguration extends Fragment {
@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;
}
}