Skip to content

Commit

Permalink
Fix header compilation error message when toolchain attributes are mi…
Browse files Browse the repository at this point in the history
…ssing

In Bazel, the toolchain may be from a different repo, so we should print the full label.

Context: fc19a96#r122870976
PiperOrigin-RevId: 551546416
Change-Id: I103eda18d0febbd068bc4c932434101af7d56e54
  • Loading branch information
hvadehra authored and copybara-github committed Jul 27, 2023
1 parent 35ed674 commit 1cfa007
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,13 @@ def _should_use_header_compilation(ctx, toolchain):
if not toolchain.has_header_compiler():
fail(
"header compilation was requested but it is not supported by the " +
"current Java toolchain '" +
"//" + str(toolchain.label.package) + ":" + toolchain.label.name +
"current Java toolchain '" + str(toolchain.label) +
"'; see the java_toolchain.header_compiler attribute",
)
if not toolchain.has_header_compiler_direct():
fail(
"header compilation was requested but it is not supported by the " +
"current Java toolchain '" +
"//" + str(toolchain.label.package) + ":" + toolchain.label.name +
"current Java toolchain '" + str(toolchain.label) +
"'; see the java_toolchain.header_compiler_direct attribute",
)
return True
Expand Down

0 comments on commit 1cfa007

Please sign in to comment.