Update PathPackageLocator to take a list of potential build file names,
instead of assuming BUILD.
- Default the list to the same value as PackageLookupFunction:
BUILD.bazel, BUILD.
- Move BuildFileNames to the packages package, so it is more generally
available.
Part of #4056.
Change-Id: Ie12512b492cd7d47a9e56ec3bc209f829feaf4b5
PiperOrigin-RevId: 177261295
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
index 63d39ff..fecdcca 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionFunctionTest.java
@@ -70,8 +70,12 @@
@Before
public void setUp() throws Exception {
artifactValueMap = new LinkedHashMap<>();
- AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>(new PathPackageLocator(
- rootDirectory.getFileSystem().getPath("/outputbase"), ImmutableList.of(rootDirectory)));
+ AtomicReference<PathPackageLocator> pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ rootDirectory.getFileSystem().getPath("/outputbase"),
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
RecordingDifferencer differencer = new SequencedRecordingDifferencer();
MemoizingEvaluator evaluator =
new InMemoryMemoizingEvaluator(
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTestCase.java
index 9408db8..046b0d7 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ArtifactFunctionTestCase.java
@@ -25,7 +25,6 @@
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.testutil.TestRuleClassProvider;
import com.google.devtools.build.lib.testutil.TestUtils;
@@ -75,8 +74,12 @@
@Before
public void baseSetUp() throws Exception {
setupRoot(new CustomInMemoryFs());
- AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>(new PathPackageLocator(
- root.getFileSystem().getPath("/outputbase"), ImmutableList.of(root)));
+ AtomicReference<PathPackageLocator> pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ root.getFileSystem().getPath("/outputbase"),
+ ImmutableList.of(root),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
BlazeDirectories directories =
new BlazeDirectories(new ServerDirectories(root, root), root, TestConstants.PRODUCT_NAME);
ExternalFilesHelper externalFilesHelper = new ExternalFilesHelper(
@@ -102,7 +105,7 @@
new PackageLookupFunction(
null,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)))
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY))
.put(
SkyFunctions.WORKSPACE_AST,
new WorkspaceASTFunction(TestRuleClassProvider.getRuleClassProvider()))
@@ -110,8 +113,10 @@
SkyFunctions.WORKSPACE_FILE,
new WorkspaceFileFunction(
TestRuleClassProvider.getRuleClassProvider(),
- TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING.builder().build(
- TestRuleClassProvider.getRuleClassProvider(), root.getFileSystem()),
+ TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING
+ .builder()
+ .build(
+ TestRuleClassProvider.getRuleClassProvider(), root.getFileSystem()),
directories))
.put(SkyFunctions.EXTERNAL_PACKAGE, new ExternalPackageFunction())
.put(
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunctionTest.java
index 19b0c95..b2a28a0 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/ContainingPackageLookupFunctionTest.java
@@ -36,7 +36,6 @@
import com.google.devtools.build.lib.rules.repository.RepositoryLoaderFunction;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.syntax.SkylarkSemantics;
import com.google.devtools.build.lib.testutil.FoundationTestCase;
import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor;
@@ -75,7 +74,11 @@
AnalysisMock analysisMock = AnalysisMock.get();
AtomicReference<PathPackageLocator> pkgLocator =
- new AtomicReference<>(new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)));
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
deletedPackages = new AtomicReference<>(ImmutableSet.<PackageIdentifier>of());
BlazeDirectories directories =
new BlazeDirectories(
@@ -96,7 +99,7 @@
new PackageLookupFunction(
deletedPackages,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(
SkyFunctions.PACKAGE, new PackageFunction(null, null, null, null, null, null, null));
skyFunctions.put(SkyFunctions.BLACKLISTED_PACKAGE_PREFIXES,
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
index e1379f2..e28fef3 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FileFunctionTest.java
@@ -42,7 +42,6 @@
import com.google.devtools.build.lib.rules.repository.RepositoryDelegatorFunction;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.syntax.SkylarkSemantics;
import com.google.devtools.build.lib.testutil.ManualClock;
import com.google.devtools.build.lib.testutil.TestConstants;
@@ -113,7 +112,11 @@
this.fs = fs;
pkgRoot = fs.getRootDirectory().getRelative("root");
outputBase = fs.getRootDirectory().getRelative("output_base");
- pkgLocator = new PathPackageLocator(outputBase, ImmutableList.of(pkgRoot));
+ pkgLocator =
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(pkgRoot),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY);
FileSystemUtils.createDirectoryAndParents(pkgRoot);
}
@@ -151,7 +154,7 @@
new PackageLookupFunction(
new AtomicReference<>(ImmutableSet.<PackageIdentifier>of()),
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)))
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY))
.put(
SkyFunctions.WORKSPACE_AST,
new WorkspaceASTFunction(TestRuleClassProvider.getRuleClassProvider()))
@@ -159,8 +162,9 @@
SkyFunctions.WORKSPACE_FILE,
new WorkspaceFileFunction(
TestRuleClassProvider.getRuleClassProvider(),
- TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING.builder().build(
- TestRuleClassProvider.getRuleClassProvider(), fs),
+ TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING
+ .builder()
+ .build(TestRuleClassProvider.getRuleClassProvider(), fs),
directories))
.put(SkyFunctions.EXTERNAL_PACKAGE, new ExternalPackageFunction())
.put(SkyFunctions.LOCAL_REPOSITORY_LOOKUP, new LocalRepositoryLookupFunction())
@@ -631,7 +635,11 @@
@Test
public void testSymlinkAcrossPackageRoots() throws Exception {
Path otherPkgRoot = fs.getRootDirectory().getRelative("other_root");
- pkgLocator = new PathPackageLocator(outputBase, ImmutableList.of(pkgRoot, otherPkgRoot));
+ pkgLocator =
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(pkgRoot, otherPkgRoot),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY);
symlink("a", "/other_root/b");
assertValueChangesIfContentsOfFileChanges("/other_root/b", true, "a");
}
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
index a9e0fbe..301fa74 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesetEntryFunctionTest.java
@@ -39,7 +39,6 @@
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.testutil.FoundationTestCase;
import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.util.Fingerprint;
@@ -81,8 +80,12 @@
@Before
public final void setUp() throws Exception {
- pkgLocator = new AtomicReference<>(
- new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)));
+ pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages =
new AtomicReference<>(ImmutableSet.<PackageIdentifier>of());
ExternalFilesHelper externalFilesHelper =
@@ -110,7 +113,7 @@
new PackageLookupFunction(
deletedPackages,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(SkyFunctions.BLACKLISTED_PACKAGE_PREFIXES,
new BlacklistedPackagePrefixesFunction());
skyFunctions.put(SkyFunctions.FILESET_ENTRY, new FilesetEntryFunction());
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
index f1b8b40..eb2d141 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java
@@ -40,7 +40,6 @@
import com.google.devtools.build.lib.skyframe.DirtinessCheckerUtils.BasicFilesystemDirtinessChecker;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.testutil.TestRuleClassProvider;
import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor;
@@ -102,8 +101,12 @@
FileSystemUtils.createDirectoryAndParents(pkgRoot);
FileSystemUtils.createEmptyFile(pkgRoot.getRelative("WORKSPACE"));
- AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>(new PathPackageLocator(
- fs.getPath("/output_base"), ImmutableList.of(pkgRoot)));
+ AtomicReference<PathPackageLocator> pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ fs.getPath("/output_base"),
+ ImmutableList.of(pkgRoot),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
BlazeDirectories directories =
new BlazeDirectories(
new ServerDirectories(pkgRoot, pkgRoot), pkgRoot, TestConstants.PRODUCT_NAME);
@@ -124,7 +127,7 @@
new PackageLookupFunction(
new AtomicReference<>(ImmutableSet.<PackageIdentifier>of()),
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(SkyFunctions.WORKSPACE_AST,
new WorkspaceASTFunction(TestRuleClassProvider.getRuleClassProvider()));
skyFunctions.put(SkyFunctions.WORKSPACE_FILE,
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
index 7724160..660d895 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java
@@ -36,7 +36,6 @@
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.GlobValue.InvalidGlobPatternException;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.syntax.SkylarkSemantics;
import com.google.devtools.build.lib.testutil.ManualClock;
import com.google.devtools.build.lib.testutil.TestConstants;
@@ -113,7 +112,10 @@
pkgLocator =
new AtomicReference<>(
- new PathPackageLocator(outputBase, ImmutableList.of(writableRoot, root)));
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(writableRoot, root),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
differencer = new SequencedRecordingDifferencer();
evaluator = new InMemoryMemoizingEvaluator(createFunctionMap(), differencer);
@@ -149,7 +151,7 @@
new PackageLookupFunction(
deletedPackages,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(SkyFunctions.BLACKLISTED_PACKAGE_PREFIXES,
new BlacklistedPackagePrefixesFunction());
skyFunctions.put(
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
index 7c4e309..a854d2e 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/LocalRepositoryLookupFunctionTest.java
@@ -30,7 +30,6 @@
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.syntax.SkylarkSemantics;
import com.google.devtools.build.lib.testutil.FoundationTestCase;
import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor;
@@ -67,7 +66,11 @@
public final void setUp() throws Exception {
AnalysisMock analysisMock = AnalysisMock.get();
AtomicReference<PathPackageLocator> pkgLocator =
- new AtomicReference<>(new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)));
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
deletedPackages = new AtomicReference<>(ImmutableSet.<PackageIdentifier>of());
BlazeDirectories directories =
new BlazeDirectories(
@@ -83,7 +86,7 @@
new PackageLookupFunction(
deletedPackages,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(
SkyFunctions.FILE_STATE,
new FileStateFunction(
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java
index d08f3d3..a8c2316 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java
@@ -79,7 +79,10 @@
packageCacheOptions.globbingThreads = 7;
getSkyframeExecutor()
.preparePackageLoading(
- new PathPackageLocator(outputBase, ImmutableList.copyOf(roots)),
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.copyOf(roots),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY),
packageCacheOptions,
Options.getDefaults(SkylarkSemanticsOptions.class),
"",
@@ -309,7 +312,10 @@
packageCacheOptions.globbingThreads = 7;
getSkyframeExecutor()
.preparePackageLoading(
- new PathPackageLocator(outputBase, ImmutableList.<Path>of(rootDirectory)),
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.<Path>of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY),
packageCacheOptions,
Options.getDefaults(SkylarkSemanticsOptions.class),
"",
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PackageLookupFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PackageLookupFunctionTest.java
index 27eef90..a90119c 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/PackageLookupFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/PackageLookupFunctionTest.java
@@ -27,6 +27,7 @@
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.events.NullEventHandler;
+import com.google.devtools.build.lib.packages.BuildFileName;
import com.google.devtools.build.lib.packages.BuildFileNotFoundException;
import com.google.devtools.build.lib.packages.PackageFactory;
import com.google.devtools.build.lib.packages.PackageFactory.EnvironmentExtension;
@@ -39,7 +40,6 @@
import com.google.devtools.build.lib.rules.repository.RepositoryLoaderFunction;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.skyframe.PackageLookupValue.ErrorReason;
import com.google.devtools.build.lib.skyframe.PackageLookupValue.IncorrectRepositoryReferencePackageLookupValue;
import com.google.devtools.build.lib.syntax.SkylarkSemantics;
@@ -88,8 +88,12 @@
scratch.file("parentpackage/BUILD");
AnalysisMock analysisMock = AnalysisMock.get();
- AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>(
- new PathPackageLocator(outputBase, ImmutableList.of(emptyPackagePath, rootDirectory)));
+ AtomicReference<PathPackageLocator> pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(emptyPackagePath, rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
deletedPackages = new AtomicReference<>(ImmutableSet.<PackageIdentifier>of());
BlazeDirectories directories =
new BlazeDirectories(
@@ -105,7 +109,7 @@
new PackageLookupFunction(
deletedPackages,
crossRepositoryLabelViolationStrategy(),
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(
SkyFunctions.PACKAGE,
new PackageFunction(null, null, null, null, null, null, null));
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
index e0d3bdf..c6b946f 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunctionTest.java
@@ -39,7 +39,6 @@
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction.FileOperationException;
import com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalValue.ResolvedFile;
import com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalValue.TraversalRequest;
@@ -86,8 +85,12 @@
@Before
public final void setUp() throws Exception {
AnalysisMock analysisMock = AnalysisMock.get();
- pkgLocator = new AtomicReference<>(
- new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)));
+ pkgLocator =
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages =
new AtomicReference<>(ImmutableSet.<PackageIdentifier>of());
BlazeDirectories directories =
@@ -114,7 +117,7 @@
new PackageLookupFunction(
deletedPackages,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)));
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
skyFunctions.put(SkyFunctions.BLACKLISTED_PACKAGE_PREFIXES,
new BlacklistedPackagePrefixesFunction());
skyFunctions.put(SkyFunctions.PACKAGE,
@@ -695,8 +698,11 @@
// to the definition of //a/b/ under pp1, not under pp2.
// Set the package paths.
- pkgLocator.set(new PathPackageLocator(outputBase,
- ImmutableList.of(rootDirectory.getRelative("pp1"), rootDirectory.getRelative("pp2"))));
+ pkgLocator.set(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory.getRelative("pp1"), rootDirectory.getRelative("pp2")),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
PrecomputedValue.PATH_PACKAGE_LOCATOR.set(differencer, pkgLocator.get());
Artifact aBuildArtifact = sourceArtifactUnderPackagePath("a/BUILD", "pp1");
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java
index 07a9914..63e900f 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeLabelVisitorTest.java
@@ -405,7 +405,10 @@
packageCacheOptions.globbingThreads = 7;
getSkyframeExecutor()
.preparePackageLoading(
- new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)),
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY),
packageCacheOptions,
Options.getDefaults(SkylarkSemanticsOptions.class),
loadingMock.getDefaultsPackageContent(),
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkFileContentHashTests.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkFileContentHashTests.java
index 719b9f0..ee996e0 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkFileContentHashTests.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkFileContentHashTests.java
@@ -163,7 +163,10 @@
packageCacheOptions.globbingThreads = 7;
getSkyframeExecutor()
.preparePackageLoading(
- new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)),
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY),
packageCacheOptions,
Options.getDefaults(SkylarkSemanticsOptions.class),
"",
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunctionTest.java
index c799c96..d71a7f3 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunctionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunctionTest.java
@@ -53,7 +53,10 @@
packageCacheOptions.globbingThreads = 7;
getSkyframeExecutor()
.preparePackageLoading(
- new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory, alternativeRoot)),
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory, alternativeRoot),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY),
packageCacheOptions,
Options.getDefaults(SkylarkSemanticsOptions.class),
"",
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
index 664ea53..3758bdc 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTestCase.java
@@ -63,7 +63,6 @@
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction;
import com.google.devtools.build.lib.skyframe.PackageLookupFunction.CrossRepositoryLabelViolationStrategy;
-import com.google.devtools.build.lib.skyframe.PackageLookupValue.BuildFileName;
import com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.ActionCompletedReceiver;
import com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.ProgressSupplier;
import com.google.devtools.build.lib.testutil.FoundationTestCase;
@@ -161,7 +160,11 @@
final boolean keepGoing,
@Nullable EvaluationProgressReceiver evaluationProgressReceiver) throws Exception {
AtomicReference<PathPackageLocator> pkgLocator =
- new AtomicReference<>(new PathPackageLocator(outputBase, ImmutableList.of(rootDirectory)));
+ new AtomicReference<>(
+ new PathPackageLocator(
+ outputBase,
+ ImmutableList.of(rootDirectory),
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY));
AtomicReference<TimestampGranularityMonitor> tsgmRef = new AtomicReference<>(tsgm);
BlazeDirectories directories =
new BlazeDirectories(
@@ -206,7 +209,7 @@
new PackageLookupFunction(
null,
CrossRepositoryLabelViolationStrategy.ERROR,
- ImmutableList.of(BuildFileName.BUILD_DOT_BAZEL, BuildFileName.BUILD)))
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY))
.put(
SkyFunctions.WORKSPACE_AST,
new WorkspaceASTFunction(TestRuleClassProvider.getRuleClassProvider()))
@@ -214,8 +217,11 @@
SkyFunctions.WORKSPACE_FILE,
new WorkspaceFileFunction(
TestRuleClassProvider.getRuleClassProvider(),
- TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING.builder().build(
- TestRuleClassProvider.getRuleClassProvider(), scratch.getFileSystem()),
+ TestConstants.PACKAGE_FACTORY_BUILDER_FACTORY_FOR_TESTING
+ .builder()
+ .build(
+ TestRuleClassProvider.getRuleClassProvider(),
+ scratch.getFileSystem()),
directories))
.put(SkyFunctions.EXTERNAL_PACKAGE, new ExternalPackageFunction())
.put(