Skip to content

Commit

Permalink
Make incompatible_use_per_action_file_cache a no-op
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 222396132
  • Loading branch information
ulfjack authored and Copybara-Service committed Nov 21, 2018
1 parent 20bee32 commit b7ae7b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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". */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand All @@ -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.");
Expand All @@ -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
Expand Down Expand Up @@ -550,7 +541,7 @@ private ActionExecutionValue checkCacheAndExecuteIfNeeded(
}
try (ActionExecutionContext actionExecutionContext =
skyframeActionExecutor.getContext(
perActionFileCache,
metadataHandler,
metadataHandler,
Collections.unmodifiableMap(state.expandedArtifacts),
expandedFilesets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public final class SkyframeActionExecutor {
// findAndStoreArtifactConflicts, and is preserved across builds otherwise.
private ImmutableMap<ActionAnalysisMetadata, ConflictException> badActionMap = ImmutableMap.of();
private OptionsProvider options;
private boolean usePerActionFileCache;
private boolean hadExecutionError;
private MetadataProvider perBuildFileCache;
private ActionInputPrefetcher actionInputPrefetcher;
Expand Down Expand Up @@ -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;
Expand All @@ -386,10 +383,6 @@ public void setClientEnv(Map<String, String> clientEnv) {
this.clientEnv = ImmutableMap.copyOf(clientEnv);
}

boolean usePerActionFileCache() {
return usePerActionFileCache;
}

boolean usesActionFileSystem() {
return outputService != null && outputService.supportsActionFileSystem();
}
Expand Down

0 comments on commit b7ae7b0

Please sign in to comment.