From fc567b333e4bb6d2f5f64024c4adba1f446da3b4 Mon Sep 17 00:00:00 2001 From: Marian Lobur Date: Mon, 14 Sep 2015 08:44:25 +0000 Subject: 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 --- .../build/lib/skyframe/ConfiguredTargetFunction.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java') 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 configConditions, RuleClassProvider ruleClassProvider, BuildConfiguration hostConfiguration, NestedSetBuilder transitivePackages) - throws DependencyEvaluationException { + throws DependencyEvaluationException, AspectCreationException { // Create the map from attributes to list of (target, configuration) pairs. ListMultimap depValueNames; @@ -483,7 +486,7 @@ final class ConfiguredTargetFunction implements SkyFunction { private static ListMultimap resolveAspectDependencies(Environment env, Map configuredTargetMap, Iterable deps, NestedSetBuilder transitivePackages) - throws DependencyEvaluationException { + throws AspectCreationException { ListMultimap result = ArrayListMultimap.create(); Set 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) { -- cgit v1.2.3