diff --git a/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java b/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java index e01e7a4a7b4b85..d8fe5a4a12fe23 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java @@ -28,32 +28,6 @@ public interface Preprocessor { /** Factory for {@link Preprocessor} instances. */ interface Factory { - /** Supplier for {@link Factory} instances. */ - interface Supplier { - /** - * Returns a Preprocessor factory to use for getting Preprocessor instances. - * - * @param loc a package locator for preprocessors to look up other BUILD files - * @param outputBase allows non-hermetic access to the file system and output base; use with - * extreme caution - */ - Factory getFactory(CachingPackageLocator loc, Path outputBase); - - /** Supplier that always returns {@code NullFactory.INSTANCE}. */ - static class NullSupplier implements Supplier { - - public static final NullSupplier INSTANCE = new NullSupplier(); - - private NullSupplier() { - } - - @Override - public Factory getFactory(CachingPackageLocator loc, Path outputBase) { - return NullFactory.INSTANCE; - } - } - } - /** * Returns whether this {@link Factory} is still suitable for providing {@link Preprocessor}s. * If not, all previous preprocessing results should be assumed to be invalid and a new diff --git a/src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java b/src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java index 241d5690a1b74e..8930fa169aca88 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/WorkspaceBuilder.java @@ -23,7 +23,6 @@ import com.google.devtools.build.lib.analysis.WorkspaceStatusAction; import com.google.devtools.build.lib.analysis.config.BinTools; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.skyframe.DiffAwareness; import com.google.devtools.build.lib.skyframe.PrecomputedValue; import com.google.devtools.build.lib.skyframe.PrecomputedValue.Injected; @@ -51,7 +50,6 @@ public final class WorkspaceBuilder { private final ImmutableList.Builder diffAwarenessFactories = ImmutableList.builder(); private Predicate allowedMissingInputs; - private Preprocessor.Factory.Supplier preprocessorFactorySupplier; // We use an immutable map builder for the nice side effect that it throws if a duplicate key // is inserted. private final ImmutableMap.Builder skyFunctions = @@ -79,9 +77,6 @@ BlazeWorkspace build( if (allowedMissingInputs == null) { allowedMissingInputs = Predicates.alwaysFalse(); } - if (preprocessorFactorySupplier == null) { - preprocessorFactorySupplier = Preprocessor.Factory.Supplier.NullSupplier.INSTANCE; - } SkyframeExecutor skyframeExecutor = skyframeExecutorFactory.create( packageFactory, @@ -91,7 +86,6 @@ BlazeWorkspace build( ruleClassProvider.getBuildInfoFactories(), diffAwarenessFactories.build(), allowedMissingInputs, - preprocessorFactorySupplier, skyFunctions.build(), precomputedValues.build(), customDirtinessCheckers.build(), @@ -150,23 +144,6 @@ public WorkspaceBuilder setAllowedMissingInputs(Predicate allowedM return this; } - /** - * Sets a supplier that provides factories for the Preprocessor to apply. Only one factory per - * workspace is allowed. - * - *

The factory yielded by the supplier will be checked with - * {@link Preprocessor.Factory#isStillValid} at the beginning of each incremental build. This - * allows modules to have preprocessors customizable by flags. - */ - public WorkspaceBuilder setPreprocessorFactorySupplier( - Preprocessor.Factory.Supplier preprocessorFactorySupplier) { - Preconditions.checkState(this.preprocessorFactorySupplier == null, - "At most one module defines a preprocessor factory supplier. But found two: %s and %s", - this.preprocessorFactorySupplier, preprocessorFactorySupplier); - this.preprocessorFactorySupplier = Preconditions.checkNotNull(preprocessorFactorySupplier); - return this; - } - /** Add an "extra" SkyFunction for SkyValues. */ public WorkspaceBuilder addSkyFunction(SkyFunctionName name, SkyFunction skyFunction) { Preconditions.checkNotNull(name); @@ -207,4 +184,4 @@ public WorkspaceBuilder addCustomDirtinessChecker( this.customDirtinessCheckers.add(Preconditions.checkNotNull(customDirtinessChecker)); return this; } -} \ No newline at end of file +} 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 e6b18384e7714a..7255bc17464d61 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 @@ -37,7 +37,6 @@ import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.profiler.AutoProfiler; @@ -119,7 +118,6 @@ private SequencedSkyframeExecutor( ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, Iterable customDirtinessCheckers, @@ -135,7 +133,6 @@ private SequencedSkyframeExecutor( workspaceStatusActionFactory, buildInfoFactories, allowedMissingInputs, - preprocessorFactorySupplier, extraSkyFunctions, extraPrecomputedValues, ExternalFileAction.DEPEND_ON_EXTERNAL_PKG_FOR_EXTERNAL_REPO_PATHS, @@ -155,7 +152,6 @@ public static SequencedSkyframeExecutor create( ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, Iterable customDirtinessCheckers, @@ -170,7 +166,6 @@ public static SequencedSkyframeExecutor create( buildInfoFactories, diffAwarenessFactories, allowedMissingInputs, - preprocessorFactorySupplier, extraSkyFunctions, extraPrecomputedValues, customDirtinessCheckers, @@ -188,7 +183,6 @@ private static SequencedSkyframeExecutor create( ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, Iterable customDirtinessCheckers, @@ -206,7 +200,6 @@ private static SequencedSkyframeExecutor create( buildInfoFactories, diffAwarenessFactories, allowedMissingInputs, - preprocessorFactorySupplier, extraSkyFunctions, extraPrecomputedValues, customDirtinessCheckers, @@ -219,14 +212,15 @@ private static SequencedSkyframeExecutor create( } @VisibleForTesting - public static SequencedSkyframeExecutor create(PackageFactory pkgFactory, - BlazeDirectories directories, BinTools binTools, + public static SequencedSkyframeExecutor create( + PackageFactory pkgFactory, + BlazeDirectories directories, + BinTools binTools, WorkspaceStatusAction.Factory workspaceStatusActionFactory, ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, PathFragment blacklistedPackagePrefixesFile, - String productName, - Preprocessor.Factory.Supplier preprocessorFactorySupplier) { + String productName) { return create( pkgFactory, directories, @@ -235,7 +229,6 @@ public static SequencedSkyframeExecutor create(PackageFactory pkgFactory, buildInfoFactories, diffAwarenessFactories, Predicates.alwaysFalse(), - preprocessorFactorySupplier, ImmutableMap.of(), ImmutableList.of(), ImmutableList.of(), diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorFactory.java b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorFactory.java index 4c92f23612f728..b82f740dc3aa65 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorFactory.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutorFactory.java @@ -21,7 +21,6 @@ import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory; import com.google.devtools.build.lib.analysis.config.BinTools; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy; import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName; import com.google.devtools.build.lib.vfs.PathFragment; @@ -42,7 +41,6 @@ public SkyframeExecutor create( ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, Iterable customDirtinessCheckers, @@ -55,7 +53,6 @@ public SkyframeExecutor create( buildInfoFactories, diffAwarenessFactories, allowedMissingInputs, - preprocessorFactorySupplier, extraSkyFunctions, extraPrecomputedValues, customDirtinessCheckers, 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 182a14a215e401..f572c26e27fce7 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 @@ -90,7 +90,6 @@ import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Package.Builder; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Preprocessor.AstAfterPreprocessing; import com.google.devtools.build.lib.packages.RuleClassProvider; import com.google.devtools.build.lib.packages.RuleVisibility; @@ -244,9 +243,6 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { protected boolean active = true; private final SkyframePackageManager packageManager; - private final Preprocessor.Factory.Supplier preprocessorFactorySupplier; - private Preprocessor.Factory preprocessorFactory; - private final ResourceManager resourceManager; /** Used to lock evaluator on legacy calls to get existing values. */ @@ -301,7 +297,6 @@ protected SkyframeExecutor( Factory workspaceStatusActionFactory, ImmutableList buildInfoFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, ExternalFileAction externalFileAction, @@ -323,7 +318,6 @@ protected SkyframeExecutor( this.directories = Preconditions.checkNotNull(directories); this.buildInfoFactories = buildInfoFactories; this.allowedMissingInputs = allowedMissingInputs; - this.preprocessorFactorySupplier = preprocessorFactorySupplier; this.extraSkyFunctions = extraSkyFunctions; this.extraPrecomputedValues = extraPrecomputedValues; this.externalFileAction = externalFileAction; @@ -982,7 +976,6 @@ public void preparePackageLoading( this.pkgFactory.setGlobbingThreads(packageCacheOptions.globbingThreads); this.pkgFactory.setMaxDirectoriesToEagerlyVisitInGlobbing( packageCacheOptions.maxDirectoriesToEagerlyVisitInGlobbing); - checkPreprocessorFactory(); emittedEventState.clear(); // If the PackageFunction was interrupted, there may be stale entries here. @@ -1012,17 +1005,6 @@ private void setPackageLocator(PathPackageLocator pkgLocator) { protected abstract void onNewPackageLocator(PathPackageLocator oldLocator, PathPackageLocator pkgLocator); - private void checkPreprocessorFactory() { - if (preprocessorFactory == null) { - preprocessorFactory = - preprocessorFactorySupplier.getFactory(packageManager, directories.getOutputBase()); - } else if (!preprocessorFactory.isStillValid()) { - preprocessorFactory = - preprocessorFactorySupplier.getFactory(packageManager, directories.getOutputBase()); - invalidate(SkyFunctionName.functionIs(SkyFunctions.PACKAGE)); - } - } - public SkyframeBuildView getSkyframeBuildView() { return skyframeBuildView; } diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutorFactory.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutorFactory.java index 9a92aea21653e1..98f1e9d651764b 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutorFactory.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutorFactory.java @@ -21,7 +21,6 @@ import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory; import com.google.devtools.build.lib.analysis.config.BinTools; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.util.AbruptExitException; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.skyframe.SkyFunction; @@ -43,7 +42,6 @@ public interface SkyframeExecutorFactory { * @param buildInfoFactories list of BuildInfoFactories * @param diffAwarenessFactories * @param allowedMissingInputs - * @param preprocessorFactorySupplier * @param extraSkyFunctions * @param extraPrecomputedValues * @param customDirtinessCheckers @@ -59,7 +57,6 @@ SkyframeExecutor create( ImmutableList buildInfoFactories, Iterable diffAwarenessFactories, Predicate allowedMissingInputs, - Preprocessor.Factory.Supplier preprocessorFactorySupplier, ImmutableMap extraSkyFunctions, ImmutableList extraPrecomputedValues, Iterable customDirtinessCheckers, diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java index d877c41fdb8c9a..032599f4e3d8d3 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java @@ -41,7 +41,6 @@ import com.google.devtools.build.lib.exec.ExecutionOptions; import com.google.devtools.build.lib.flags.InvocationPolicyEnforcer; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.util.MockToolsConfig; import com.google.devtools.build.lib.pkgcache.LoadingOptions; @@ -175,7 +174,6 @@ protected void useRuleClassProvider(ConfiguredRuleClassProvider ruleClassProvide ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - Preprocessor.Factory.Supplier.NullSupplier.INSTANCE, analysisMock.getSkyFunctions(), getPrecomputedValues(), ImmutableList.of(), diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java index 47a59a4d866052..140f99efb6600e 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java @@ -107,7 +107,6 @@ import com.google.devtools.build.lib.packages.OutputFile; import com.google.devtools.build.lib.packages.PackageFactory; import com.google.devtools.build.lib.packages.PackageFactory.EnvironmentExtension; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.RawAttributeMapper; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; @@ -227,7 +226,6 @@ public final void initializeSkyframeExecutor() throws Exception { ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - getPreprocessorFactorySupplier(), analysisMock.getSkyFunctions(), getPrecomputedValues(), ImmutableList.of(), @@ -276,10 +274,6 @@ protected ImmutableList getPrecomputedValues() { return ImmutableList.of(); } - protected Preprocessor.Factory.Supplier getPreprocessorFactorySupplier() { - return Preprocessor.Factory.Supplier.NullSupplier.INSTANCE; - } - protected ResourceSet getStartingResources() { // Effectively disable ResourceManager by default. return ResourceSet.createWithRamCpuIo(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE); diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/ConfigurationTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/ConfigurationTestCase.java index 469d0b26c6b14e..490b642668fb1a 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/ConfigurationTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/ConfigurationTestCase.java @@ -33,7 +33,6 @@ import com.google.devtools.build.lib.cmdline.RepositoryName; import com.google.devtools.build.lib.flags.InvocationPolicyEnforcer; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.util.MockToolsConfig; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; @@ -111,7 +110,6 @@ public final void initializeSkyframeExecutor() throws Exception { ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - Preprocessor.Factory.Supplier.NullSupplier.INSTANCE, analysisMock.getSkyFunctions(), ImmutableList.of(), ImmutableList.of(), diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/PackageLoadingTestCase.java b/src/test/java/com/google/devtools/build/lib/packages/util/PackageLoadingTestCase.java index 98b4bd6d9d8c76..56d37d5529f916 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/PackageLoadingTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/PackageLoadingTestCase.java @@ -27,7 +27,6 @@ import com.google.devtools.build.lib.packages.NoSuchTargetException; import com.google.devtools.build.lib.packages.PackageFactory; import com.google.devtools.build.lib.packages.PackageFactory.EnvironmentExtension; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.RuleVisibility; import com.google.devtools.build.lib.packages.Target; @@ -88,7 +87,7 @@ public final void initializeSkyframeExecutor() throws Exception { loadingMock .getPackageFactoryForTesting() .create(ruleClassProvider, null, getEnvironmentExtensions(), scratch.getFileSystem()); - skyframeExecutor = createSkyframeExecutor(getPreprocessorFactorySupplier()); + skyframeExecutor = createSkyframeExecutor(); setUpSkyframe(parsePackageCacheOptions()); } @@ -97,8 +96,7 @@ protected List getExtraRules() { return ImmutableList.of(); } - private SkyframeExecutor createSkyframeExecutor( - Preprocessor.Factory.Supplier preprocessorFactorySupplier) { + private SkyframeExecutor createSkyframeExecutor() { SkyframeExecutor skyframeExecutor = SequencedSkyframeExecutor.create( packageFactory, @@ -109,7 +107,6 @@ private SkyframeExecutor createSkyframeExecutor( ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - preprocessorFactorySupplier, ImmutableMap.of(), ImmutableList.of(), ImmutableList.of(), @@ -123,10 +120,6 @@ protected Iterable getEnvironmentExtensions() { return ImmutableList.of(); } - protected Preprocessor.Factory.Supplier getPreprocessorFactorySupplier() { - return Preprocessor.Factory.Supplier.NullSupplier.INSTANCE; - } - protected void setUpSkyframe(RuleVisibility defaultVisibility, String defaultsPackageContents) { PackageCacheOptions packageCacheOptions = Options.getDefaults(PackageCacheOptions.class); packageCacheOptions.defaultVisibility = defaultVisibility; diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/PreprocessorUtils.java b/src/test/java/com/google/devtools/build/lib/packages/util/PreprocessorUtils.java deleted file mode 100644 index eb2848f0f51d72..00000000000000 --- a/src/test/java/com/google/devtools/build/lib/packages/util/PreprocessorUtils.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.packages.util; - -import com.google.devtools.build.lib.packages.CachingPackageLocator; -import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.vfs.Path; - -import javax.annotation.Nullable; - -/** - * Testing utilities for {@link Preprocessor}. - */ -public class PreprocessorUtils { - - public static class MutableFactorySupplier implements Preprocessor.Factory.Supplier { - - @Nullable private Preprocessor preprocessor; - private boolean valid = true; - private Factory factory = new Factory(); - - public MutableFactorySupplier(@Nullable Preprocessor preprocessor) { - this.preprocessor = preprocessor; - } - - public void inject(@Nullable Preprocessor preprocessor) { - this.valid = false; - this.preprocessor = preprocessor; - } - - @Override - public Factory getFactory(CachingPackageLocator loc, Path outputBase) { - valid = true; - return factory; - } - - private class Factory implements Preprocessor.Factory { - - @Override - public boolean isStillValid() { - return valid; - } - - @Override - public boolean considersGlobs() { - return false; - } - - @Override - @Nullable - public Preprocessor getPreprocessor() { - return preprocessor; - } - } - } -} diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java index bc5800e246e735..60c5853c659bbf 100644 --- a/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java +++ b/src/test/java/com/google/devtools/build/lib/pkgcache/IncrementalLoadingTest.java @@ -32,7 +32,6 @@ import com.google.devtools.build.lib.packages.NoSuchTargetException; import com.google.devtools.build.lib.packages.NoSuchThingException; import com.google.devtools.build.lib.packages.Package; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.util.LoadingMock; @@ -109,7 +108,7 @@ public FileStatus stat(Path path, boolean followSymlinks) throws IOException { } protected PackageCacheTester createTester(FileSystem fs, ManualClock clock) throws Exception { - return new PackageCacheTester(fs, clock, Preprocessor.Factory.Supplier.NullSupplier.INSTANCE); + return new PackageCacheTester(fs, clock); } @Test @@ -456,9 +455,7 @@ public DiffAwareness maybeCreate(Path pathEntry) { private boolean everythingModified = false; private ModifiedFileSet modifiedFileSet; - public PackageCacheTester( - FileSystem fs, ManualClock clock, Preprocessor.Factory.Supplier supplier) - throws IOException { + public PackageCacheTester(FileSystem fs, ManualClock clock) throws IOException { this.clock = clock; workspace = fs.getPath("/workspace"); workspace.createDirectory(); @@ -482,7 +479,6 @@ public PackageCacheTester( loadingMock.createRuleClassProvider().getBuildInfoFactories(), ImmutableList.of(new ManualDiffAwarenessFactory()), Predicates.alwaysFalse(), - supplier, ImmutableMap.of(), ImmutableList.of(), ImmutableList.of(), diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java index 4ca07f9bd955b8..731d5c52f05bc8 100644 --- a/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java +++ b/src/test/java/com/google/devtools/build/lib/pkgcache/LoadingPhaseRunnerTest.java @@ -42,7 +42,6 @@ import com.google.devtools.build.lib.events.StoredEventHandler; import com.google.devtools.build.lib.packages.ConstantRuleVisibility; import com.google.devtools.build.lib.packages.PackageFactory; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.util.MockToolsConfig; import com.google.devtools.build.lib.skyframe.DiffAwareness; @@ -622,7 +621,6 @@ public LoadingPhaseTester(boolean useNewImpl) throws IOException { ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - Preprocessor.Factory.Supplier.NullSupplier.INSTANCE, analysisMock.getSkyFunctions(), ImmutableList.of(), ImmutableList.of(), diff --git a/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java b/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java index 3c6bbe4321c1d4..26f8f1ef040401 100644 --- a/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java +++ b/src/test/java/com/google/devtools/build/lib/pkgcache/PackageCacheTest.java @@ -37,7 +37,6 @@ import com.google.devtools.build.lib.packages.NoSuchPackageException; import com.google.devtools.build.lib.packages.NoSuchTargetException; import com.google.devtools.build.lib.packages.Package; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.skyframe.DiffAwareness; @@ -92,7 +91,6 @@ public final void initializeSkyframeExecutor() throws Exception { ruleClassProvider.getBuildInfoFactories(), ImmutableList.of(), Predicates.alwaysFalse(), - Preprocessor.Factory.Supplier.NullSupplier.INSTANCE, AnalysisMock.get().getSkyFunctions(), ImmutableList.of(), ImmutableList.of(), diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTestCase.java index 292a1fa11d0620..17f27ca56ebc5c 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTestCase.java @@ -31,10 +31,8 @@ import com.google.devtools.build.lib.events.EventKind; import com.google.devtools.build.lib.packages.ConstantRuleVisibility; import com.google.devtools.build.lib.packages.NoSuchThingException; -import com.google.devtools.build.lib.packages.Preprocessor; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.util.PackageLoadingTestCase; -import com.google.devtools.build.lib.packages.util.PreprocessorUtils; import com.google.devtools.build.lib.pkgcache.TransitivePackageLoader; import com.google.devtools.build.lib.testutil.ManualClock; import com.google.devtools.build.lib.vfs.FileStatus; @@ -62,13 +60,6 @@ abstract public class SkyframeLabelVisitorTestCase extends PackageLoadingTestCas protected static final boolean EXPECT_ERROR = true; protected TransitivePackageLoader visitor = null; protected CustomInMemoryFs fs = new CustomInMemoryFs(new ManualClock()); - protected PreprocessorUtils.MutableFactorySupplier preprocessorFactorySupplier = - new PreprocessorUtils.MutableFactorySupplier(null); - - @Override - protected Preprocessor.Factory.Supplier getPreprocessorFactorySupplier() { - return preprocessorFactorySupplier; - } @Override protected FileSystem createFileSystem() {