diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java | 20 |
1 files changed, 11 insertions, 9 deletions
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 7e11859c38..59e447eecd 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 @@ -184,6 +184,7 @@ public class ExecutionTool { this.runtime = env.getRuntime(); this.request = request; + // Create tools before getting the strategies from the modules as some of them need tools to // determine whether the host actually supports certain strategies (e.g. sandboxing). createToolsSymlinks(); @@ -332,7 +333,7 @@ public class ExecutionTool { TopLevelArtifactContext topLevelArtifactContext) throws BuildFailedException, InterruptedException, TestExecException, AbruptExitException { Stopwatch timer = Stopwatch.createStarted(); - prepare(packageRoots); + prepare(packageRoots, analysisResult.getWorkspaceName()); ActionGraph actionGraph = analysisResult.getActionGraph(); @@ -346,7 +347,7 @@ public class ExecutionTool { request.getBuildOptions().finalizeActions); } else { // TODO(bazel-team): this could be just another OutputService - startLocalOutputBuild(); + startLocalOutputBuild(analysisResult.getWorkspaceName()); } List<BuildConfiguration> targetConfigurations = configurations.getTargetConfigurations(); @@ -354,9 +355,10 @@ public class ExecutionTool { ? targetConfigurations.get(0) : null; if (targetConfigurations.size() == 1) { String productName = runtime.getProductName(); - String workspaceName = env.getWorkspaceName(); + String dirName = env.getWorkspaceName(); + String workspaceName = analysisResult.getWorkspaceName(); OutputDirectoryLinksUtils.createOutputDirectoryLinks( - workspaceName, env.getWorkspace(), env.getDirectories().getExecRoot(workspaceName), + dirName, env.getWorkspace(), env.getDirectories().getExecRoot(workspaceName), env.getDirectories().getOutputPath(workspaceName), getReporter(), targetConfiguration, request.getBuildOptions().getSymlinkPrefix(productName), productName); } @@ -489,7 +491,7 @@ public class ExecutionTool { } } - private void prepare(ImmutableMap<PackageIdentifier, Path> packageRoots) + private void prepare(ImmutableMap<PackageIdentifier, Path> packageRoots, String workspaceName) throws ExecutorInitException { // Prepare for build. Profiler.instance().markPhase(ProfilePhase.PREPARE); @@ -500,7 +502,7 @@ public class ExecutionTool { // Plant the symlink forest. try { new SymlinkForest( - packageRoots, getExecRoot(), runtime.getProductName(), env.getWorkspaceName()) + packageRoots, getExecRoot(), runtime.getProductName(), workspaceName) .plantSymlinkForest(); } catch (IOException e) { throw new ExecutorInitException("Source forest creation failed", e); @@ -509,7 +511,7 @@ public class ExecutionTool { private void createToolsSymlinks() throws ExecutorInitException { try { - env.getBlazeWorkspace().getBinTools().setupBuildTools(env.getWorkspaceName()); + env.getBlazeWorkspace().getBinTools().setupBuildTools(); } catch (ExecException e) { throw new ExecutorInitException("Tools symlink creation failed", e); } @@ -530,9 +532,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.getDirectories().getOutputPath(env.getWorkspaceName()); + Path outputPath = env.getDirectories().getOutputPath(workspaceName); Path localOutputPath = env.getDirectories().getLocalOutputPath(); if (outputPath.isSymbolicLink()) { |