From f5b8d6fc3b4859515dae6158c96e251bea929128 Mon Sep 17 00:00:00 2001 From: brandjon Date: Fri, 23 Jun 2017 18:03:28 +0200 Subject: [PATCH] Update --incompatible_* error messages RELNOTES: None PiperOrigin-RevId: 159954456 --- .../com/google/devtools/build/lib/syntax/LoadStatement.java | 2 +- .../com/google/devtools/build/lib/syntax/MethodLibrary.java | 5 +++-- .../devtools/build/lib/syntax/ValidationEnvironment.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/syntax/LoadStatement.java b/src/main/java/com/google/devtools/build/lib/syntax/LoadStatement.java index fb30f03c0e9565..da3430a4d91801 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/LoadStatement.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/LoadStatement.java @@ -66,7 +66,7 @@ void doExec(Environment env) throws EvalException, InterruptedException { throw new EvalException( getLocation(), "First argument of 'load' must be a label and start with either '//' or ':'. " - + "Use --incompatibleLoadArgumentIsLabel to temporarily disable this check."); + + "Use --incompatibleLoadArgumentIsLabel=false to temporarily disable this check."); } } diff --git a/src/main/java/com/google/devtools/build/lib/syntax/MethodLibrary.java b/src/main/java/com/google/devtools/build/lib/syntax/MethodLibrary.java index 2f25c3b1f9cc65..b9c76641f4bee5 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/MethodLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/MethodLibrary.java @@ -1617,8 +1617,9 @@ public Integer invoke(Object x, Location loc, Environment env) throws EvalExcept throw new EvalException( loc, EvalUtils.getDataTypeName(x) - + " is not iterable. Use --incompatible_depset_is_not_iterable=false to " - + "temporarily disable this check."); + + " is not iterable. You may use `len(.to_list())` instead. Use " + + "--incompatible_depset_is_not_iterable=false to temporarily disable this " + + "check."); } int l = EvalUtils.size(x); if (l == -1) { diff --git a/src/main/java/com/google/devtools/build/lib/syntax/ValidationEnvironment.java b/src/main/java/com/google/devtools/build/lib/syntax/ValidationEnvironment.java index cba8c348845d36..bed21bcc29b92a 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/ValidationEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/ValidationEnvironment.java @@ -155,8 +155,8 @@ private static void checkLoadAfterStatement(List statements) throws E "load() statements must be called before any other statement. " + "First non-load() statement appears at " + firstStatement - + ". Use --incompatible_bzl_disallow_load_after_statement to temporarily disable " - + "this check."); + + ". Use --incompatible_bzl_disallow_load_after_statement=false to temporarily " + + "disable this check."); } if (firstStatement == null) { @@ -173,7 +173,7 @@ private static void checkToplevelIfStatement(List statements) throws statement.getLocation(), "if statements are not allowed at the top level. You may move it inside a function " + "or use an if expression (x if condition else y). " - + "Use --incompatible_disallow_toplevel_if_statement to temporarily disable " + + "Use --incompatible_disallow_toplevel_if_statement=false to temporarily disable " + "this check."); } }