diff options
author | Ulf Adams <ulfjack@google.com> | 2016-02-01 20:27:13 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-02-02 14:57:36 +0000 |
commit | 4ecd05ed16ce58f755e0aa711461c165056c1aeb (patch) | |
tree | c0851619e335d986495ba2275fac51c9eabf64c1 /src/main/java/com/google | |
parent | d5ef2b4956619c44c9d17ac097857508e4d53b40 (diff) |
Move tests from SkyframeLoadingAndAnalysisTest to LoadingPhaseRunnerTest.
This exposes an issue with the new Skyframe-based implementation, which is
fixed here as well.
--
MOS_MIGRATED_REVID=113556169
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index bfc7fb3453..f60b333036 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -1760,9 +1760,19 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { ImmutableList.of(key), keepGoing, /*numThreads=*/10, eventHandler); if (evalResult.hasError()) { ErrorInfo errorInfo = evalResult.getError(key); - if (errorInfo != null && errorInfo.getException() != null) { + if (!Iterables.isEmpty(errorInfo.getCycleInfo())) { + String errorMessage = "cycles detected during target parsing"; + getCyclesReporter().reportCycles(errorInfo.getCycleInfo(), key, eventHandler); + throw new TargetParsingException(errorMessage); + } + if (errorInfo.getException() != null) { Exception e = errorInfo.getException(); Throwables.propagateIfInstanceOf(e, TargetParsingException.class); + if (!keepGoing) { + // This is the same code as in SkyframeTargetPatternEvaluator; we allow any exception + // and turn it into a TargetParsingException here. + throw new TargetParsingException(e.getMessage()); + } throw new IllegalStateException("Unexpected Exception type from TargetPatternPhaseValue " + "for '" + targetPatterns + "'' with root causes: " + Iterables.toString(errorInfo.getRootCauses()), e); |