diff options
author | 2016-09-15 14:08:08 +0000 | |
---|---|---|
committer | 2016-09-15 15:43:37 +0000 | |
commit | e423fdb81d601886299f53081238bbe2874d26ce (patch) | |
tree | b8279314ab0a42751141314af747d42d08bd01d1 /src/main/java/com/google/devtools | |
parent | 0bcc98437eb549e49044f1109784a06d6b7df809 (diff) |
Remove some more occurences of deprecated getExecRoot() calls
--
MOS_MIGRATED_REVID=133257532
Diffstat (limited to 'src/main/java/com/google/devtools')
4 files changed, 18 insertions, 32 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java b/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java index 2513cecdf4..1c7c4be539 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/actions/BlazeExecutor.java @@ -46,7 +46,6 @@ import java.util.concurrent.atomic.AtomicBoolean; @ThreadSafe public final class BlazeExecutor implements Executor { - private final Path outputPath; private final boolean verboseFailures; private final boolean showSubcommands; private final Path execRoot; @@ -74,7 +73,6 @@ public final class BlazeExecutor implements Executor { * request, and shutdown() when you're done with this executor. */ public BlazeExecutor(Path execRoot, - Path outputPath, Reporter reporter, EventBus eventBus, Clock clock, @@ -85,7 +83,6 @@ public final class BlazeExecutor implements Executor { Map<String, SpawnActionContext> spawnActionContextMap, Iterable<ActionContextProvider> contextProviders) throws ExecutorInitException { - this.outputPath = outputPath; this.verboseFailures = verboseFailures; this.showSubcommands = showSubcommands; this.execRoot = execRoot; @@ -222,8 +219,4 @@ public final class BlazeExecutor implements Executor { public OptionsClassProvider getOptions() { return options; } - - public Path getOutputPath() { - return outputPath; - } } diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index cf838bce49..5ee730e022 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -118,7 +118,7 @@ import java.util.logging.Logger; * PackageCache. * * @see BuildTool - * @see BuildView + * @see com.google.devtools.build.lib.analysis.BuildView */ public class ExecutionTool { private static class StrategyConverter { @@ -164,7 +164,7 @@ public class ExecutionTool { } } - static final Logger LOG = Logger.getLogger(ExecutionTool.class.getName()); + static final Logger log = Logger.getLogger(ExecutionTool.class.getName()); private final CommandEnvironment env; private final BlazeRuntime runtime; @@ -300,7 +300,6 @@ public class ExecutionTool { throws ExecutorInitException { return new BlazeExecutor( env.getExecRoot(), - env.getOutputPath(), getReporter(), env.getEventBus(), runtime.getClock(), @@ -352,7 +351,8 @@ public class ExecutionTool { modifiedOutputFiles = outputService.startBuild(buildId, request.getBuildOptions().finalizeActions); } else { - startLocalOutputBuild(); // TODO(bazel-team): this could be just another OutputService + // TODO(bazel-team): this could be just another OutputService + startLocalOutputBuild(analysisResult.getWorkspaceName()); } List<BuildConfiguration> targetConfigurations = configurations.getTargetConfigurations(); @@ -360,17 +360,18 @@ public class ExecutionTool { ? targetConfigurations.get(0) : null; if (targetConfigurations.size() == 1) { String productName = runtime.getProductName(); + String workspaceName = analysisResult.getWorkspaceName(); OutputDirectoryLinksUtils.createOutputDirectoryLinks( - env.getWorkspaceName(), env.getWorkspace(), - getExecRoot(), env.getOutputPath(), getReporter(), - targetConfiguration, request.getBuildOptions().getSymlinkPrefix(productName), - productName); + workspaceName, env.getWorkspace(), env.getDirectories().getExecRoot(workspaceName), + env.getDirectories().getOutputPath(workspaceName), getReporter(), targetConfiguration, + request.getBuildOptions().getSymlinkPrefix(productName), productName); } ActionCache actionCache = getActionCache(); SkyframeExecutor skyframeExecutor = env.getSkyframeExecutor(); - Builder builder = - createBuilder(request, executor, actionCache, skyframeExecutor, modifiedOutputFiles); + Builder builder = createBuilder( + request, actionCache, skyframeExecutor, modifiedOutputFiles, + analysisResult.getWorkspaceName()); // // Execution proper. All statements below are logically nested in @@ -422,7 +423,6 @@ public class ExecutionTool { // skyframe full, this destroys the action graph as well, so we can only do it after the // action graph is no longer needed. env.getSkyframeBuildView().clearAnalysisCache(analysisResult.getTargetsToBuild()); - actionGraph = null; } configureResourceManager(request); @@ -539,9 +539,9 @@ public class ExecutionTool { /** * Prepare for a local output build. */ - private void startLocalOutputBuild() throws ExecutorInitException { + private void startLocalOutputBuild(String workspaceName) throws ExecutorInitException { try (AutoProfiler p = AutoProfiler.profiled("Starting local output build", ProfilerTask.INFO)) { - Path outputPath = env.getOutputPath(); + Path outputPath = env.getDirectories().getOutputPath(workspaceName); Path localOutputPath = env.getDirectories().getLocalOutputPath(); if (outputPath.isSymbolicLink()) { @@ -657,10 +657,10 @@ public class ExecutionTool { } private Builder createBuilder(BuildRequest request, - Executor executor, ActionCache actionCache, SkyframeExecutor skyframeExecutor, - ModifiedFileSet modifiedOutputFiles) { + ModifiedFileSet modifiedOutputFiles, + String workspaceName) { BuildRequest.BuildRequestOptions options = request.getBuildOptions(); boolean verboseExplanations = options.verboseExplanations; boolean keepGoing = request.getViewOptions().keepGoing; @@ -675,7 +675,7 @@ public class ExecutionTool { // Unfortunately, the exec root cache is not shared with caches in the remote execution // client. - fileCache = createBuildSingleFileCache(executor.getExecRoot()); + fileCache = createBuildSingleFileCache(env.getDirectories().getExecRoot(workspaceName)); skyframeExecutor.setActionOutputRoot(actionOutputRoot); ArtifactFactory artifactFactory = env.getSkyframeBuildView().getArtifactFactory(); return new SkyframeBuilder(skyframeExecutor, @@ -715,7 +715,7 @@ public class ExecutionTool { long actionCacheSizeInBytes = 0; long actionCacheSaveTimeInMs; - AutoProfiler p = AutoProfiler.profiledAndLogged("Saving action cache", ProfilerTask.INFO, LOG); + AutoProfiler p = AutoProfiler.profiledAndLogged("Saving action cache", ProfilerTask.INFO, log); try { actionCacheSizeInBytes = actionCache.save(); } catch (IOException e) { diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java index 63f533c3d1..798a31cdce 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java @@ -192,7 +192,7 @@ public class OutputDirectoryLinksUtils { Path link = base.getRelative(name); try { if (link.exists(Symlinks.NOFOLLOW)) { - ExecutionTool.LOG.finest("Removing " + link); + ExecutionTool.log.finest("Removing " + link); link.delete(); } return true; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java index bb6fb831a6..73c00d3fa2 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java @@ -292,13 +292,6 @@ public final class CommandEnvironment { } /** - * Returns the output path associated with this Blaze server process.. - */ - public Path getOutputPath() { - return getDirectories().getOutputPath(); - } - - /** * Returns the execution root directory associated with this Blaze server * process. This is where all input and output files visible to the actual * build reside. |