Skip to content

Commit

Permalink
Use shorthand display form in Label#debugPrint
Browse files Browse the repository at this point in the history
This makes the output, which is meant to be friendly to humans, more concise. If users want `//foo` to be `print`ed as `//foo:foo`, they can specify `sep = ""` and also print `:foo`, but stripping the name off is not possible without this change.

Closes #24840.

PiperOrigin-RevId: 713207601
Change-Id: I474fc4eccb1419304368a5c90a22c13b2197b699
  • Loading branch information
fmeum authored and copybara-github committed Jan 8, 2025
1 parent 0d02e69 commit e0fada9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public void debugPrint(Printer printer, StarlarkThread thread) {
// ignore
}
}
printer.append(getDisplayForm(mainRepoMapping));
printer.append(getShorthandDisplayForm(mainRepoMapping));
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/test/shell/bazel/workspace_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,8 @@ EOF
cd main
bazel build @foo//:bar \
>& "$TEST_log" || fail "Expected build to succeed"
expect_log "@b//blah:blah"
expect_not_log "@a//blah:blah"
expect_log "@b//blah"
expect_not_log "@a//blah"
}

function test_workspace_addition_change_aspect() {
Expand Down

0 comments on commit e0fada9

Please sign in to comment.