spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject spark git commit: [SPARK-13277][BUILD] Follow-up ANTLR warnings are treated as build errors
Date Fri, 12 Feb 2016 02:23:45 GMT
Repository: spark
Updated Branches:
  refs/heads/master b10af5e23 -> 8121a4b1c


[SPARK-13277][BUILD] Follow-up ANTLR warnings are treated as build errors

It is possible to create faulty but legal ANTLR grammars. ANTLR will produce warnings but
also a valid compileable parser. This PR makes sure we treat such warnings as build errors.

cc rxin / viirya

Author: Herman van Hovell <hvanhovell@questtec.nl>

Closes #11174 from hvanhovell/ANTLR-warnings-as-errors.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/8121a4b1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/8121a4b1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/8121a4b1

Branch: refs/heads/master
Commit: 8121a4b1cb4d7efa84a5e9e8e16d6656cdb79b85
Parents: b10af5e
Author: Herman van Hovell <hvanhovell@questtec.nl>
Authored: Thu Feb 11 18:23:44 2016 -0800
Committer: Reynold Xin <rxin@databricks.com>
Committed: Thu Feb 11 18:23:44 2016 -0800

----------------------------------------------------------------------
 project/SparkBuild.scala | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/8121a4b1/project/SparkBuild.scala
----------------------------------------------------------------------
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 550b5ba..6eba58c 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -433,9 +433,12 @@ object Catalyst {
       }
 
       // Generate the parser.
-      antlr.process
-      if (antlr.getNumErrors > 0) {
-        log.error("ANTLR: Caught %d build errors.".format(antlr.getNumErrors))
+      antlr.process()
+      val errorState = org.antlr.tool.ErrorManager.getErrorState
+      if (errorState.errors > 0) {
+        sys.error("ANTLR: Caught %d build errors.".format(errorState.errors))
+      } else if (errorState.warnings > 0) {
+        sys.error("ANTLR: Caught %d build warnings.".format(errorState.warnings))
       }
 
       // Return all generated java files.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message