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 e62c57cebf37af..d89ca18df21d28 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 @@ -319,8 +319,7 @@ protected void onPkgLocatorChange(PathPackageLocator oldLocator, PathPackageLoca invalidate(SkyFunctionName.functionIsIn(PACKAGE_LOCATOR_DEPENDENT_VALUES)); } - @Override - protected void invalidate(Predicate pred) { + void invalidate(Predicate pred) { recordingDiffer.invalidate(Iterables.filter(memoizingEvaluator.getValues().keySet(), pred)); } diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index 478b26af41f129..0921bfb8995faf 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -278,14 +278,13 @@ */ public abstract class SkyframeExecutor implements WalkableGraphFactory { private static final GoogleLogger logger = GoogleLogger.forEnclosingClass(); - protected MemoizingEvaluator memoizingEvaluator; protected final EmittedEventState emittedEventState = new EmittedEventState(); protected final PackageFactory pkgFactory; private final WorkspaceStatusAction.Factory workspaceStatusActionFactory; protected final FileSystem fileSystem; protected final BlazeDirectories directories; - protected final ExternalFilesHelper externalFilesHelper; + final ExternalFilesHelper externalFilesHelper; protected final BugReporter bugReporter; /** @@ -298,7 +297,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { private final FilesMetricConsumer outputArtifactsFromActionCache = new FilesMetricConsumer(); private final FilesMetricConsumer topLevelArtifactsMetric = new FilesMetricConsumer(); - @Nullable protected OutputService outputService; + @Nullable OutputService outputService; // TODO(bazel-team): Figure out how to handle value builders that block internally. Blocking // operations may need to be handled in another (bigger?) thread pool. Also, we should detect @@ -332,17 +331,17 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { // AtomicReferences are used here as mutable boxes shared with value builders. private final AtomicBoolean showLoadingProgress = new AtomicBoolean(); - protected final AtomicReference pkgLocator = new AtomicReference<>(); - protected final AtomicReference> deletedPackages = + private final AtomicReference pkgLocator = new AtomicReference<>(); + final AtomicReference> deletedPackages = new AtomicReference<>(ImmutableSet.of()); private final AtomicReference eventBus = new AtomicReference<>(); - protected final AtomicReference tsgm = new AtomicReference<>(); - protected final AtomicReference> clientEnv = new AtomicReference<>(); + final AtomicReference tsgm = new AtomicReference<>(); + private final AtomicReference> clientEnv = new AtomicReference<>(); private final ArtifactFactory artifactFactory; private final ActionKeyContext actionKeyContext; - protected boolean active = true; + boolean active = true; private final SkyframePackageManager packageManager; private final QueryTransitivePackagePreloader queryTransitivePackagePreloader; @@ -355,7 +354,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { private ActionExecutionFunction actionExecutionFunction; private BuildDriverFunction buildDriverFunction; private GlobFunction globFunction; - protected SkyframeProgressReceiver progressReceiver; + SkyframeProgressReceiver progressReceiver; private CyclesReporter cyclesReporter = null; @VisibleForTesting boolean lastAnalysisDiscarded = false; @@ -371,8 +370,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { private final ImmutableMap extraSkyFunctions; - protected SkyframeIncrementalBuildMonitor incrementalBuildMonitor = - new SkyframeIncrementalBuildMonitor(); + SkyframeIncrementalBuildMonitor incrementalBuildMonitor = new SkyframeIncrementalBuildMonitor(); private final SkyFunction ignoredPackagePrefixesFunction; @@ -447,7 +445,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { protected Duration sourceDiffCheckingDuration = Duration.ofSeconds(-1L); - class PathResolverFactoryImpl implements PathResolverFactory { + final class PathResolverFactoryImpl implements PathResolverFactory { @Override public boolean shouldCreatePathResolverForArtifactValues() { return outputService != null && outputService.supportsPathResolverForArtifactValues(); @@ -1326,8 +1324,6 @@ public AtomicReference getPackageLocator() { return pkgLocator; } - protected abstract void invalidate(Predicate pred); - protected Differencer.Diff getDiff( TimestampGranularityMonitor tsgm, ModifiedFileSet modifiedFileSet, @@ -2239,11 +2235,6 @@ public Optional maybeGetHardcodedUniverseScope() { return Optional.empty(); } - @ForOverride - protected SkyKey getUniverseKey(Collection patterns, PathFragment offset) { - return PrepareDepsOfPatternsValue.key(ImmutableList.copyOf(patterns), offset); - } - /** Returns the generating action of a given artifact ({@code null} if it's a source artifact). */ @Nullable private ActionAnalysisMetadata getGeneratingAction( @@ -2802,9 +2793,10 @@ protected class SkyframeProgressReceiver implements EvaluationProgressReceiver { * cache because of --discard_analysis_cache flag. For that case we want to keep the legacy data * but get rid of the Skyframe data. */ - protected boolean ignoreInvalidations = false; + boolean ignoreInvalidations = false; + /** This receiver is only needed for execution, so it is null otherwise. */ - @Nullable EvaluationProgressReceiver executionProgressReceiver = null; + @Nullable private EvaluationProgressReceiver executionProgressReceiver = null; /** * As the ActionLookupValues are marked done in the graph, put it in the map. This map will be @@ -3689,11 +3681,6 @@ public ConfiguredRuleClassProvider getRuleClassProviderForTesting() { return ruleClassProvider; } - @VisibleForTesting - public PackageFactory getPackageFactoryForTesting() { - return pkgFactory; - } - @VisibleForTesting public PackageSettings getPackageSettingsForTesting() { return pkgFactory.getPackageSettingsForTesting();