Correctly flag loading errors in the interleaved case.
In the interleaved case, loading errors can now also be discovered during the
analysis phase. Add a boolean flag to the SkyframeAnalysisResult to indicate
that such an error happened, and pass it through in BuildView.
Also refactor BuildView to simplify the code a bit - simply pass the
SkyframeAnalysisResult to the createResult method.
There is already an integration test for this - I'm adding a faster unit test
in BuildViewTest, as this is part of the BuildView contract.
--
MOS_MIGRATED_REVID=113716870
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
index cd7ec79..ac289bb 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
@@ -999,6 +999,18 @@
assertThat(loadingFailureRecorder.events).isEmpty();
}
+ @Test
+ public void testLoadingErrorReportedCorrectly() throws Exception {
+ scratch.file("a/BUILD", "cc_library(name='a')");
+ scratch.file("b/BUILD", "cc_library(name='b', deps = ['//missing:lib'])");
+
+ reporter.removeHandler(failFastHandler);
+ AnalysisResult result = update(defaultFlags().with(Flag.KEEP_GOING), "//a", "//b");
+ assertThat(result.hasError()).isTrue();
+ assertThat(result.getError())
+ .contains("execution phase succeeded, but there were loading phase errors");
+ }
+
/** Runs the same test with the reduced loading phase. */
@TestSpec(size = Suite.SMALL_TESTS)
@RunWith(JUnit4.class)