aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar gregce <gregce@google.com>2017-05-03 22:04:46 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-05-04 13:13:40 +0200
commit655c07b87161030f73f8e2103aebcf8277051582 (patch)
tree95d02899c9bbc5a94e95c7514e126f881379fd11 /src/main/java/com/google/devtools/build
parentbfdad902c89b101fd39a9795ea493ca5e0531052 (diff)
Don't let latebound split attributes leave the host configuration.
This fixes a bug that put them out of sync from how all other attributes manage the host configuration. PiperOrigin-RevId: 154992583
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
index 440e7b56cd..6eea61a62f 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java
@@ -353,15 +353,17 @@ public abstract class DependencyResolver {
Collection<BuildOptions> splitOptions =
getSplitOptions(depResolver.rule, attribute, ruleConfig);
- if (!splitOptions.isEmpty()) {
+ if (!splitOptions.isEmpty() && !ruleConfig.isHostConfiguration()) {
// Late-bound attribute with a split transition:
// Since we want to get the same results as BuildConfiguration.evaluateTransition (but
// skip it since we've already applied the split), we want to make sure this logic
// doesn't do anything differently. evaluateTransition has additional logic
- // for host configs and attributes with configurators. So we check here that neither of
- // of those apply, in the name of keeping the fork as simple as possible.
+ // for host configs and attributes with configurators. To keep the fork as simple as
+ // possible, we don't support the configurator case. And when we're in the host
+ // configuration, we fall back to the non-split branch, which calls
+ // BuildConfiguration.evaluateTransition, which returns its "host mode" result without
+ // ever looking at the split.
Verify.verify(attribute.getConfigurator() == null);
- Verify.verify(!lateBoundDefault.useHostConfiguration());
Iterable<BuildConfiguration> splitConfigs;
if (!ruleConfig.useDynamicConfigurations()) {
@@ -374,8 +376,8 @@ public abstract class DependencyResolver {
}
}
for (BuildConfiguration splitConfig : splitConfigs) {
- for (Label dep : resolveLateBoundAttribute(
- depResolver.rule, attribute, splitConfig, attributeMap)) {
+ for (Label dep : resolveLateBoundAttribute(depResolver.rule, attribute,
+ lateBoundDefault.useHostConfiguration() ? hostConfig : splitConfig, attributeMap)) {
// Skip the normal config transition pipeline and directly feed the split config. This
// is because the split already had to be applied to determine the attribute's value.
// This makes the split logic in the normal pipeline redundant and potentially