aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
diff options
context:
space:
mode:
authorGravatar Marian Lobur <loburm@google.com>2015-09-14 08:44:25 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-09-14 15:39:33 +0000
commitfc567b333e4bb6d2f5f64024c4adba1f446da3b4 (patch)
tree7bcc1b83883e454a632d8383d28624d78d43d264 /src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
parentc9e52201d11765638101e570664b09eaf1357cbd (diff)
Fix a bug, when we have dependency from one aspect to another aspect1->aspect2 and aspect2 fails then aspect1 throws IllegalStateException.
-- MOS_MIGRATED_REVID=102976139
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
index 8067e60e7c..7fe19c5c78 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java
@@ -193,6 +193,9 @@ final class ConfiguredTargetFunction implements SkyFunction {
return ans;
} catch (DependencyEvaluationException e) {
throw new ConfiguredTargetFunctionException(e.getRootCauseSkyKey(), e.getCause());
+ } catch (AspectCreationException e) {
+ throw new ConfiguredTargetFunctionException(
+ new ConfiguredValueCreationException(e.getMessage()));
}
}
@@ -224,7 +227,7 @@ final class ConfiguredTargetFunction implements SkyFunction {
AspectDefinition aspectDefinition, AspectParameters aspectParameters,
Set<ConfigMatchingProvider> configConditions, RuleClassProvider ruleClassProvider,
BuildConfiguration hostConfiguration, NestedSetBuilder<Package> transitivePackages)
- throws DependencyEvaluationException {
+ throws DependencyEvaluationException, AspectCreationException {
// Create the map from attributes to list of (target, configuration) pairs.
ListMultimap<Attribute, Dependency> depValueNames;
@@ -483,7 +486,7 @@ final class ConfiguredTargetFunction implements SkyFunction {
private static ListMultimap<SkyKey, Aspect> resolveAspectDependencies(Environment env,
Map<SkyKey, ConfiguredTarget> configuredTargetMap, Iterable<Dependency> deps,
NestedSetBuilder<Package> transitivePackages)
- throws DependencyEvaluationException {
+ throws AspectCreationException {
ListMultimap<SkyKey, Aspect> result = ArrayListMultimap.create();
Set<SkyKey> aspectKeys = new HashSet<>();
for (Dependency dep : deps) {
@@ -517,12 +520,12 @@ final class ConfiguredTargetFunction implements SkyFunction {
} catch (ConfiguredValueCreationException e) {
// The configured target should have been created in resolveConfiguredTargetDependencies()
throw new IllegalStateException(e);
- } catch (NoSuchThingException | AspectCreationException e) {
+ } catch (NoSuchThingException e) {
AspectFactory<?, ?, ?> depAspectFactory =
AspectFactory.Util.create(depAspect.getAspectFactory());
- throw new DependencyEvaluationException(new ConfiguredValueCreationException(
+ throw new AspectCreationException(
String.format("Evaluation of aspect %s on %s failed: %s",
- depAspectFactory.getDefinition().getName(), dep.getLabel(), e.toString())));
+ depAspectFactory.getDefinition().getName(), dep.getLabel(), e.toString()));
}
if (aspectValue == null) {