diff options
author | ccalvarin <ccalvarin@google.com> | 2018-01-22 07:53:56 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-22 07:56:03 -0800 |
commit | 28c20f79e3d265f897e8c644a4c31bd2b3d6ac67 (patch) | |
tree | 9bff0a6a653b741228dd352e6324a0f13946155a /src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java | |
parent | 4c8fa1bab507fa7f0a1cbeac0724751d9b574f89 (diff) |
Add option to optionally wipe state at the end of a build.
This will serve as an alternative to --batch, leaving behind a server without state from the previous build.
RELNOTES: Introduces --[no]keep_state_after_build
PiperOrigin-RevId: 182778500
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java index c9f87fad3b..d32e94602f 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java @@ -523,7 +523,7 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor { Preconditions.checkState(!active); BuildView.Options viewOptions = options.getOptions(BuildView.Options.class); BuildRequestOptions requestOptions = options.getOptions(BuildRequestOptions.class); - boolean oldState = trackIncrementalState; + boolean oldValueOfTrackIncrementalState = trackIncrementalState; // First check if the incrementality state should be kept around during the build. boolean explicitlyRequestedNoIncrementalData = @@ -532,6 +532,7 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor { batch && viewOptions != null && viewOptions.discardAnalysisCache; trackIncrementalState = !explicitlyRequestedNoIncrementalData && !implicitlyRequestedNoIncrementalData; + boolean keepStateAfterBuild = requestOptions != null && requestOptions.keepStateAfterBuild; if (explicitlyRequestedNoIncrementalData != implicitlyRequestedNoIncrementalData) { if (requestOptions != null && !explicitlyRequestedNoIncrementalData) { eventHandler.handle( @@ -541,17 +542,19 @@ public final class SequencedSkyframeExecutor extends SkyframeExecutor { + " to specify --notrack_incremental_state in the future if you want to " + "maximize memory savings.")); } - if (!batch) { + if (!batch && keepStateAfterBuild) { eventHandler.handle( Event.warn( - "--batch not specified with --notrack_incremental_state: the server will " - + "remain running, but the next build will not be incremental on this one.")); + "--notrack_incremental_state was specified, but without " + + "--nokeep_state_after_build. Inmemory state from this build will not be " + + "reusable, but it will not get fully wiped until the beginning of the next " + + "build. Use --nokeep_state_after_build to clean up eagerly.")); } } // Now check if it is necessary to wipe the previous state. We do this if either the previous // or current incrementalStateRetentionStrategy requires the build to have been isolated. - if (oldState != trackIncrementalState) { + if (oldValueOfTrackIncrementalState != trackIncrementalState) { logger.info("Set incremental state to " + trackIncrementalState); evaluatorNeedsReset = true; removeActionsAfterEvaluation.set(!trackIncrementalState); |