Move most BlazeRuntime methods related to workspace directories to CommandEnv.

--
MOS_MIGRATED_REVID=118561661
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 17298c3..0b1e95b 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
@@ -190,7 +190,7 @@
         getActionContextProvidersFromModules(
             runtime,
             new FilesetActionContextImpl.Provider(
-                env.getReporter(), runtime.getWorkspaceName()),
+                env.getReporter(), env.getWorkspaceName()),
             new SimpleActionContextProvider(
                 new SymlinkTreeStrategy(env.getOutputService(), runtime.getBinTools())));
     StrategyConverter strategyConverter = new StrategyConverter(actionContextProviders);
@@ -300,8 +300,8 @@
   private BlazeExecutor createExecutor()
       throws ExecutorInitException {
     return new BlazeExecutor(
-        runtime.getDirectories().getExecRoot(),
-        runtime.getDirectories().getOutputPath(),
+        env.getExecRoot(),
+        env.getOutputPath(),
         getReporter(),
         env.getEventBus(),
         runtime.getClock(),
@@ -360,8 +360,8 @@
         ? targetConfigurations.get(0) : null;
     if (targetConfigurations.size() == 1) {
       OutputDirectoryLinksUtils.createOutputDirectoryLinks(
-          runtime.getWorkspaceName(), getWorkspace(), getExecRoot(),
-          runtime.getOutputPath(), getReporter(), targetConfiguration,
+          env.getWorkspaceName(), env.getWorkspace(), getExecRoot(),
+          env.getOutputPath(), getReporter(), targetConfiguration,
           request.getBuildOptions().getSymlinkPrefix());
     }
 
@@ -531,7 +531,7 @@
   }
 
   private void createActionLogDirectory() throws ExecutorInitException {
-    Path directory = runtime.getDirectories().getActionConsoleOutputDirectory();
+    Path directory = env.getDirectories().getActionConsoleOutputDirectory();
     try {
       if (directory.exists()) {
         FileSystemUtils.deleteTree(directory);
@@ -547,8 +547,8 @@
    */
   private void startLocalOutputBuild() throws ExecutorInitException {
     try (AutoProfiler p = AutoProfiler.profiled("Starting local output build", ProfilerTask.INFO)) {
-      Path outputPath = runtime.getOutputPath();
-      Path localOutputPath = runtime.getDirectories().getLocalOutputPath();
+      Path outputPath = env.getOutputPath();
+      Path localOutputPath = env.getDirectories().getLocalOutputPath();
 
       if (outputPath.isSymbolicLink()) {
         try {
@@ -671,7 +671,7 @@
     boolean verboseExplanations = options.verboseExplanations;
     boolean keepGoing = request.getViewOptions().keepGoing;
 
-    Path actionOutputRoot = runtime.getDirectories().getActionConsoleOutputDirectory();
+    Path actionOutputRoot = env.getDirectories().getActionConsoleOutputDirectory();
     Predicate<Action> executionFilter = CheckUpToDateFilter.fromOptions(
         request.getOptions(ExecutionOptions.class));
 
@@ -735,7 +735,7 @@
 
   private ActionInputFileCache createBuildSingleFileCache(Path execRoot) {
     String cwd = execRoot.getPathString();
-    FileSystem fs = runtime.getDirectories().getFileSystem();
+    FileSystem fs = env.getDirectories().getFileSystem();
 
     ActionInputFileCache cache = null;
     for (BlazeModule module : runtime.getBlazeModules()) {
@@ -757,10 +757,10 @@
   }
 
   private Path getWorkspace() {
-    return runtime.getWorkspace();
+    return env.getWorkspace();
   }
 
   private Path getExecRoot() {
-    return runtime.getExecRoot();
+    return env.getExecRoot();
   }
 }