From 26ed88d196782ca5d5c296c5d8a674512e4a6e01 Mon Sep 17 00:00:00 2001 From: lberki Date: Fri, 22 Apr 2022 02:37:49 -0700 Subject: [PATCH] Remove SkyframeExecutor.getArtifactRoots(). It's unused. RELNOTES: None. PiperOrigin-RevId: 443610268 --- .../build/lib/skyframe/SkyframeExecutor.java | 53 ------------------- 1 file changed, 53 deletions(-) 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 9aec4a687d3872..ef5929b7071ab5 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 @@ -359,8 +359,6 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory, Configur private final PathResolverFactory pathResolverFactory = new PathResolverFactoryImpl(); - private boolean siblingRepositoryLayout = false; - // A Semaphore to limit the number of in-flight execution of certain SkyFunctions to prevent OOM. // TODO(b/185987566): Remove this semaphore. private static final int DEFAULT_SEMAPHORE_SIZE = ResourceUsage.getAvailableProcessors(); @@ -1233,56 +1231,6 @@ public Collection getWorkspaceStatusArtifacts(ExtendedEventHandler eve return ImmutableList.of(value.getStableArtifact(), value.getVolatileArtifact()); } - public Map getArtifactRootsForFiles( - final ExtendedEventHandler eventHandler, Iterable execPaths) - throws InterruptedException { - return getArtifactRoots(eventHandler, execPaths, true); - } - - public Map getArtifactRoots( - final ExtendedEventHandler eventHandler, Iterable execPaths) - throws InterruptedException { - return getArtifactRoots(eventHandler, execPaths, false); - } - - private Map getArtifactRoots( - final ExtendedEventHandler eventHandler, Iterable execPaths, boolean forFiles) - throws InterruptedException { - final Map packageKeys = new HashMap<>(); - for (PathFragment execPath : execPaths) { - PackageIdentifier pkgIdentifier = - PackageIdentifier.discoverFromExecPath(execPath, forFiles, siblingRepositoryLayout); - packageKeys.put(execPath, ContainingPackageLookupValue.key(pkgIdentifier)); - } - - EvaluationResult result; - EvaluationContext evaluationContext = - newEvaluationContextBuilder() - .setKeepGoing(true) - .setNumThreads(1) - .setEventHandler(eventHandler) - .build(); - - synchronized (valueLookupLock) { - result = memoizingEvaluator.evaluate(packageKeys.values(), evaluationContext); - } - - if (result.hasError()) { - return new HashMap<>(); - } - - Map roots = new HashMap<>(); - for (PathFragment execPath : execPaths) { - ContainingPackageLookupValue value = result.get(packageKeys.get(execPath)); - if (value.hasContainingPackage()) { - roots.put(execPath, value.getContainingPackageRoot()); - } else { - roots.put(execPath, null); - } - } - return roots; - } - @VisibleForTesting public SkyFunctionEnvironmentForTesting getSkyFunctionEnvironmentForTesting( ExtendedEventHandler eventHandler) { @@ -1407,7 +1355,6 @@ public void preparePackageLoading( } private void setSiblingDirectoryLayout(boolean experimentalSiblingRepositoryLayout) { - this.siblingRepositoryLayout = experimentalSiblingRepositoryLayout; this.artifactFactory.setSiblingRepositoryLayout(experimentalSiblingRepositoryLayout); }