diff options
author | ulfjack <ulfjack@google.com> | 2018-08-02 05:16:00 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-02 05:17:26 -0700 |
commit | 36fbbde3a5a0e570ba55ea1e7d4dc3b26b135a20 (patch) | |
tree | 2cd4b100b7711339243d33046c4099007177e7fa /src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java | |
parent | 13ebd67cf8ea756a0e82eaa03f0f4a9581ccf9be (diff) |
Add a flag to evaluate the top level transitions in Skyframe
This adds a new PrepareAnalysisPhaseFunction, which started out as a copy of
some existing code from SkyframeExecutor, BuildView, AnalysisPhaseRunner,
AnalysisUtils, and ConfigurationResolver, which was then modified to work
inside Skyframe.
Most of our tests already work with the new code, except for some of the tests
related to configuration trimming in combination with dependency cycles. The
reason for this is that we can only recover from dependency cycles at the end
of a Skyframe invocation, but never inside a Skyframe invocation. The new code
therefore cannot return partial results like the old code.
This seems to make null builds a bit faster. In my testing, I saw null build
times for a single test target go from ~50ms to ~40ms. This is probably due to
slightly better caching - it seems that computing the configuration transitions
and top-level targets is non-negligible, even if there's only a single
top-level configuration for a single top-level target.
This might be an even bigger win if there are a lot of top-level targets and
configurations.
PiperOrigin-RevId: 207083192
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java | 54 |
1 files changed, 54 insertions, 0 deletions
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 48e4baf5d1..b6107f4915 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 @@ -1353,4 +1353,58 @@ public class BuildViewTest extends BuildViewTestBase { return super.defaultFlags().with(Flag.TRIMMED_CONFIGURATIONS); } } + + /** Runs the same test with the Skyframe-based analysis prep. */ + @TestSpec(size = Suite.SMALL_TESTS) + @RunWith(JUnit4.class) + public static class WithSkyframePrepareAnalysis extends BuildViewTest { + @Override + protected FlagBuilder defaultFlags() { + return super.defaultFlags().with(Flag.SKYFRAME_PREPARE_ANALYSIS); + } + } + + /** Runs the same test with the Skyframe-based analysis prep and trimmed configurations. */ + @TestSpec(size = Suite.SMALL_TESTS) + @RunWith(JUnit4.class) + public static class WithSkyframePrepareAnalysisAndTrimmedConfigurations extends BuildViewTest { + @Override + protected FlagBuilder defaultFlags() { + return super.defaultFlags() + .with(Flag.SKYFRAME_PREPARE_ANALYSIS) + .with(Flag.TRIMMED_CONFIGURATIONS); + } + + // We can't recover from dependency cycles in TransitiveTargetFunction, so we disable the tests + // for now. We will likely have to fix this before we can enable the new code by default. + @Override + @Test + public void testCircularDependency() { + } + + @Override + @Test + public void testErrorBelowCycleKeepGoing() { + } + + @Override + @Test + public void testCircularDependencyBelowTwoTargets() { + } + + @Override + @Test + public void testCycleReporting_TargetCycleWhenPackageInError() { + } + + @Override + @Test + public void testCircularDependencyWithKeepGoing() { + } + + @Override + @Test + public void testErrorBelowCycle() { + } + } } |