Skip to content

Commit

Permalink
Mention incompatible flag name in error messages
Browse files Browse the repository at this point in the history
Let's make the error message clear which incompatible flag caused the failure.

RELNOTES: None.
PiperOrigin-RevId: 212405170
  • Loading branch information
hlopko authored and Copybara-Service committed Sep 11, 2018
1 parent c062b1f commit 1b73bc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,12 @@ public boolean disableDepsetInUserFlags() {
private void checkForToolchainSkylarkApiAvailability() throws EvalException {
if (cppOptions.disableLegacyToolchainSkylarkApi
|| !cppOptions.enableLegacyToolchainSkylarkApi) {
throw new EvalException(null, "Information about the C++ toolchain API is not accessible "
+ "anymore through ctx.fragments.cpp . Use CcToolchainInfo instead.");
throw new EvalException(
null,
"Information about the C++ toolchain API is not accessible "
+ "anymore through ctx.fragments.cpp "
+ "(See --incompatible_disable_legacy_cpp_toolchain_skylark_api). "
+ "Use CcToolchainInfo instead.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ private Label selectCcToolchainLabel(
errorMessage
+ String.format(
", you may want to add an entry for '%s|%s' into toolchains and "
+ "toolchain_identifier '%s' into the corresponding cc_toolchain rule.",
+ "toolchain_identifier '%s' into the corresponding cc_toolchain rule "
+ "(see --incompatible_disable_cc_toolchain_label_from_crosstool_proto).",
toolchain.getTargetCpu(),
toolchain.getCompiler(),
toolchain.getToolchainIdentifier()));
Expand Down

0 comments on commit 1b73bc3

Please sign in to comment.