diff options
author | 2017-04-18 18:56:03 +0200 | |
---|---|---|
committer | 2017-04-19 10:47:01 +0200 | |
commit | 9484d958ecc94b35182f92e5be31e7a1270b861b (patch) | |
tree | b329cfdb9bbf6e1283e01ad418c0ce6d4d15e34f /src/main/java/com/google/devtools/build/lib/skyframe | |
parent | 0b103074bf63b5dfe1b5a9b0bea8db63985a8deb (diff) |
Fix crash on graph cycle in configuration loading
PiperOrigin-RevId: 153473961
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | 7 |
1 files changed, 6 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 f572c26e27..fe5b1d4513 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 @@ -1048,10 +1048,15 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { EvaluationResult<ConfigurationCollectionValue> result = buildDriver.evaluate(Arrays.asList(skyKey), keepGoing, DEFAULT_THREAD_COUNT, eventHandler); if (result.hasError()) { - Throwable e = result.getError(skyKey).getException(); + ErrorInfo error = result.getError(skyKey); + Throwable e = error.getException(); // Wrap loading failed exceptions if (e instanceof NoSuchThingException) { e = new InvalidConfigurationException(e); + } else if (e == null && !Iterables.isEmpty(error.getCycleInfo())) { + getCyclesReporter().reportCycles(error.getCycleInfo(), skyKey, eventHandler); + e = new InvalidConfigurationException( + "cannot load build configuration because of this cycle"); } Throwables.propagateIfInstanceOf(e, InvalidConfigurationException.class); throw new IllegalStateException( |