You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2013/07/23 21:30:49 UTC

[jira] [Updated] (LUCENE-4335) Builds should regenerate all generated sources

     [ https://issues.apache.org/jira/browse/LUCENE-4335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-4335:
---------------------------------------

    Attachment: LUCENE-4335.patch

First cut at top-level "ant regenerate"...

Something is still wrong w/ my ant changes because a top-level "ant
regenerate" hits this:

{code}
BUILD FAILED
/l/trunk/lucene/build.xml:614: The following error occurred while executing this line:
/l/trunk/lucene/common-build.xml:1902: The following error occurred while executing this line:
/l/trunk/lucene/analysis/build.xml:139: The following error occurred while executing this line:
/l/trunk/lucene/analysis/build.xml:38: The following error occurred while executing this line:
Target "regenerate" does not exist in the project "analyzers-morfologik". 
{code}

But some of the generators make "harmless" mods to the sources,
e.g. JavaCC does this:

{code}
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java	(revision 1506176)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java	(working copy)
@@ -112,4 +112,4 @@
   void Done();
 
 }
-/* JavaCC - OriginalChecksum=c95f1720d9b38046dc5d294b741c44cb (do not edit this line) */
+/* JavaCC - OriginalChecksum=53b2ec7502d50e2290e86187a6c01270 (do not edit this line) */
{code}

JFlex does this:

{code}
Index: lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java
===================================================================
--- lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java	(revision 1506176)
+++ lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.java	(working copy)
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.5.0-SNAPSHOT on 9/19/12 6:23 PM */
+/* The following code was generated by JFlex 1.5.0-SNAPSHOT on 7/23/13 3:22 PM */
@@ -33,8 +33,8 @@
 /**
  * This class is a scanner generated by 
  * <a href="http://www.jflex.de/">JFlex</a> 1.5.0-SNAPSHOT
- * on 9/19/12 6:23 PM from the specification file
- * <tt>C:/svn/lucene/dev/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.jflex</tt>
+ * on 7/23/13 3:22 PM from the specification file
+ * <tt>/l/trunk/lucene/analysis/common/src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.jflex</tt>
  */
 class ClassicTokenizerImpl implements StandardTokenizerInterface {
{code}

I was able to remove some timestamps from our own gen tools in
analysis/icu/src/tools (thanks Rob for the pointers!)...

Also, there seem to be some real cases where the generated code was
changed but not the generator, e.g. packed ints sources show real
diffs (and won't compile after regeneration... I haven't dug into this
yet), and JFlex seemed to lose some @Overrides...

                
> Builds should regenerate all generated sources
> ----------------------------------------------
>
>                 Key: LUCENE-4335
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4335
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>         Attachments: LUCENE-4335.patch, LUCENE-4335.patch
>
>
> We have more and more sources that are generated programmatically (query parsers, fuzzy levN tables from Moman, packed ints specialized decoders, etc.), and it's dangerous because developers may directly edit the generated sources and forget to edit the meta-source.  It's happened to me several times ... most recently just after landing the BlockPostingsFormat branch.
> I think we should re-gen all of these in our builds and fail the build if this creates a difference.  I know some generators (eg JavaCC) embed timestamps and so always create mods ... we can leave them out of this for starters (or maybe post-process the sources to remove the timestamps) ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org