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 997b9e750431d7..0d435f2b02c501 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 @@ -359,10 +359,9 @@ void executeBuild(UUID buildId, AnalysisResult analysisResult, if (targetConfigurations.size() == 1) { String productName = runtime.getProductName(); String dirName = env.getWorkspaceName(); - String workspaceName = analysisResult.getWorkspaceName(); OutputDirectoryLinksUtils.createOutputDirectoryLinks( - dirName, env.getWorkspace(), env.getDirectories().getExecRoot(workspaceName), - env.getDirectories().getOutputPath(workspaceName), getReporter(), targetConfiguration, + dirName, env.getWorkspace(), env.getDirectories().getExecRoot(), + env.getDirectories().getOutputPath(), getReporter(), targetConfiguration, request.getBuildOptions().getSymlinkPrefix(productName), productName); } diff --git a/src/test/shell/bazel/execroot_test.sh b/src/test/shell/bazel/execroot_test.sh index 4f64e09851434c..720230a119f7bc 100755 --- a/src/test/shell/bazel/execroot_test.sh +++ b/src/test/shell/bazel/execroot_test.sh @@ -38,7 +38,10 @@ genrule( EOF bazel build -s //dir:use-srcs &> $TEST_log || fail "expected success" - test -e "$(bazel info execution_root)/../${ws_name}" + execroot="$(bazel info execution_root)" + test -e "$execroot/../${ws_name}" + ls -l bazel-out | tee out + assert_contains "$execroot/bazel-out" out } run_suite "execution root tests"