aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar kchodorow <kchodorow@google.com>2017-06-21 18:15:36 +0200
committerGravatar Philipp Wollermann <philwo@google.com>2017-06-22 12:31:44 +0200
commit89659810e3048782dfb5e308e39aa8a0727e464e (patch)
tree0ebc5236708dd39b106620a0e11e5ec06fd73a65
parent29916a909f525501b49f7b751e633f27abf306b1 (diff)
Set correct execroot for info
Fixes #3055. RELNOTES: `bazel info execution_root` returns the corrrect directory name for the execution root. PiperOrigin-RevId: 159701171
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java3
-rwxr-xr-xsrc/test/shell/bazel/client_test.sh14
2 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
index 336342ba20..52894e7a73 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
@@ -181,7 +181,8 @@ public abstract class InfoItem {
public byte[] get(Supplier<BuildConfiguration> configurationSupplier, CommandEnvironment env)
throws AbruptExitException {
checkNotNull(env);
- return print(env.getDirectories().getExecRoot());
+ return print(env.getDirectories().getExecRoot(
+ configurationSupplier.get().getMainRepositoryName()));
}
}
diff --git a/src/test/shell/bazel/client_test.sh b/src/test/shell/bazel/client_test.sh
index e3eb6f5265..b38c40a80f 100755
--- a/src/test/shell/bazel/client_test.sh
+++ b/src/test/shell/bazel/client_test.sh
@@ -22,10 +22,14 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
function test_product_name_with_bazel_info() {
- bazel info >& "$TEST_log" || fail "Expected zero exit"
+ cat > WORKSPACE <<EOF
+workspace(name = 'blerp')
+EOF
+ bazel info >& "$TEST_log" || fail "Expected zero exit"
- expect_log "^bazel-bin:.*_bazel.*bazel-out.*bin\$"
- expect_log "^bazel-genfiles:.*_bazel.*bazel-out.*genfiles\$"
- expect_log "^bazel-testlogs:.*_bazel.*bazel-out.*testlogs\$"
- expect_log "^output_path:.*_bazel.*bazel-out\$"
+ expect_log "^bazel-bin:.*_bazel.*bazel-out.*bin\$"
+ expect_log "^bazel-genfiles:.*_bazel.*bazel-out.*genfiles\$"
+ expect_log "^bazel-testlogs:.*_bazel.*bazel-out.*testlogs\$"
+ expect_log "^output_path:.*_bazel.*bazel-out\$"
+ expect_log "^execution_root:.*/execroot/blerp\$"
}