From b7ae7b06a6a602f2eaf3ab386e7afbffd120fae1 Mon Sep 17 00:00:00 2001 From: ulfjack Date: Wed, 21 Nov 2018 05:56:02 -0800 Subject: [PATCH] Make incompatible_use_per_action_file_cache a no-op PiperOrigin-RevId: 222396132 --- .../build/lib/buildtool/BuildRequestOptions.java | 9 ++++----- .../build/lib/skyframe/ActionExecutionFunction.java | 13 ++----------- .../build/lib/skyframe/SkyframeActionExecutor.java | 7 ------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/BuildRequestOptions.java b/src/main/java/com/google/devtools/build/lib/buildtool/BuildRequestOptions.java index 4060a15d547464..afed40e4dc5a98 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/BuildRequestOptions.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/BuildRequestOptions.java @@ -410,18 +410,17 @@ public boolean useTopLevelTargetsForSymlinks() { help = "This option is deprecated and has no effect.") public boolean discardActionsAfterExecution; + @Deprecated @Option( name = "incompatible_use_per_action_file_cache", defaultValue = "false", documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, metadataTags = { - OptionMetadataTag.INCOMPATIBLE_CHANGE, - OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES + OptionMetadataTag.INCOMPATIBLE_CHANGE, + OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES }, - help = "Whether to use the per action file cache. We saw issues with a previous rollout " - + "attempt (which we could not track down to a root cause), so we are extra careful now " - + "and use a flag to enable the new code path.") + help = "Deprecated no-op.") public boolean usePerActionFileCache; /** Converter for jobs: [0, MAX_JOBS] or "auto". */ diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java index 9cca97488dcfe9..9dfbba84cf947b 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java @@ -39,7 +39,6 @@ import com.google.devtools.build.lib.actions.FileArtifactValue; import com.google.devtools.build.lib.actions.FilesetOutputSymlink; import com.google.devtools.build.lib.actions.LostInputsExecException.LostInputsActionExecutionException; -import com.google.devtools.build.lib.actions.MetadataProvider; import com.google.devtools.build.lib.actions.MissingDepException; import com.google.devtools.build.lib.actions.MissingInputFileException; import com.google.devtools.build.lib.actions.NotifyOnActionCacheHit; @@ -469,10 +468,6 @@ private ActionExecutionValue checkCacheAndExecuteIfNeeded( // This may be recreated if we discover inputs. // TODO(shahan): this isn't used when using ActionFileSystem so we can avoid creating some // unused objects. - MetadataProvider perActionFileCache = skyframeActionExecutor.usePerActionFileCache() - ? new PerActionFileCache( - state.inputArtifactData, /*missingArtifactsAllowed=*/ action.discoversInputs()) - : metadataHandler; if (action.discoversInputs()) { if (state.discoveredInputs == null) { try { @@ -485,7 +480,7 @@ private ActionExecutionValue checkCacheAndExecuteIfNeeded( } state.discoveredInputs = skyframeActionExecutor.discoverInputs( - action, perActionFileCache, metadataHandler, env, state.actionFileSystem); + action, metadataHandler, metadataHandler, env, state.actionFileSystem); Preconditions.checkState( env.valuesMissing() == (state.discoveredInputs == null), "discoverInputs() must return null iff requesting more dependencies."); @@ -512,10 +507,6 @@ private ActionExecutionValue checkCacheAndExecuteIfNeeded( state.actionFileSystem == null ? new OutputStore() : new MinimalOutputStore()); // Set the MetadataHandler to accept output information. metadataHandler.discardOutputMetadata(); - - perActionFileCache = skyframeActionExecutor.usePerActionFileCache() - ? new PerActionFileCache(state.inputArtifactData, /*missingArtifactsAllowed=*/ false) - : metadataHandler; } // Make sure this is a regular HashMap rather than ImmutableMapBuilder so that we are safe @@ -550,7 +541,7 @@ private ActionExecutionValue checkCacheAndExecuteIfNeeded( } try (ActionExecutionContext actionExecutionContext = skyframeActionExecutor.getContext( - perActionFileCache, + metadataHandler, metadataHandler, Collections.unmodifiableMap(state.expandedArtifacts), expandedFilesets, diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java index 1c20de20aeb563..02039d8b3db1f5 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java @@ -159,7 +159,6 @@ public final class SkyframeActionExecutor { // findAndStoreArtifactConflicts, and is preserved across builds otherwise. private ImmutableMap badActionMap = ImmutableMap.of(); private OptionsProvider options; - private boolean usePerActionFileCache; private boolean hadExecutionError; private MetadataProvider perBuildFileCache; private ActionInputPrefetcher actionInputPrefetcher; @@ -369,8 +368,6 @@ void prepareForExecution( this.actionCacheChecker = Preconditions.checkNotNull(actionCacheChecker); // Don't cache possibly stale data from the last build. this.options = options; - this.usePerActionFileCache = - options.getOptions(BuildRequestOptions.class).usePerActionFileCache; // Cache the finalizeActions value for performance, since we consult it on every action. this.finalizeActions = options.getOptions(BuildRequestOptions.class).finalizeActions; this.outputService = outputService; @@ -386,10 +383,6 @@ public void setClientEnv(Map clientEnv) { this.clientEnv = ImmutableMap.copyOf(clientEnv); } - boolean usePerActionFileCache() { - return usePerActionFileCache; - } - boolean usesActionFileSystem() { return outputService != null && outputService.supportsActionFileSystem(); }