Skip to content

Commit 8965981

Browse files
kchodorowphilwo
authored andcommitted
Set correct execroot for info
Fixes bazelbuild#3055. RELNOTES: `bazel info execution_root` returns the corrrect directory name for the execution root. PiperOrigin-RevId: 159701171
1 parent 29916a9 commit 8965981

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public ExecutionRootInfoItem() {
181181
public byte[] get(Supplier<BuildConfiguration> configurationSupplier, CommandEnvironment env)
182182
throws AbruptExitException {
183183
checkNotNull(env);
184-
return print(env.getDirectories().getExecRoot());
184+
return print(env.getDirectories().getExecRoot(
185+
configurationSupplier.get().getMainRepositoryName()));
185186
}
186187
}
187188

src/test/shell/bazel/client_test.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \
2222
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
2323

2424
function test_product_name_with_bazel_info() {
25-
bazel info >& "$TEST_log" || fail "Expected zero exit"
25+
cat > WORKSPACE <<EOF
26+
workspace(name = 'blerp')
27+
EOF
28+
bazel info >& "$TEST_log" || fail "Expected zero exit"
2629

27-
expect_log "^bazel-bin:.*_bazel.*bazel-out.*bin\$"
28-
expect_log "^bazel-genfiles:.*_bazel.*bazel-out.*genfiles\$"
29-
expect_log "^bazel-testlogs:.*_bazel.*bazel-out.*testlogs\$"
30-
expect_log "^output_path:.*_bazel.*bazel-out\$"
30+
expect_log "^bazel-bin:.*_bazel.*bazel-out.*bin\$"
31+
expect_log "^bazel-genfiles:.*_bazel.*bazel-out.*genfiles\$"
32+
expect_log "^bazel-testlogs:.*_bazel.*bazel-out.*testlogs\$"
33+
expect_log "^output_path:.*_bazel.*bazel-out\$"
34+
expect_log "^execution_root:.*/execroot/blerp\$"
3135
}

0 commit comments

Comments
 (0)