From d0242ce4a87929f2528f4602d0fb09d1ccfcea94 Mon Sep 17 00:00:00 2001 From: kchodorow Date: Thu, 4 May 2017 20:42:52 +0200 Subject: [PATCH] Make symlinks consistent PiperOrigin-RevId: 155105523 --- .../google/devtools/build/lib/buildtool/ExecutionTool.java | 5 ++--- src/test/shell/bazel/execroot_test.sh | 5 ++++- 2 files changed, 6 insertions(+), 4 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 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"