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/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,