[ 
https://issues.apache.org/jira/browse/LUCENE-9411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153440#comment-17153440
 ] 

Uwe Schindler edited comment on LUCENE-9411 at 7/8/20, 9:43 AM:
----------------------------------------------------------------

Hi,

I was on vacation the last 2 weeks so I did not look into this. I have one 
problem with failing on errors, but that's easy to fix! The problem is: Newer 
java versions add new warning types to the code. As we say "work with Java 11" 
it's hard to prevent a failure on later Java versions and it's also hard to 
communicate with developers. I think you should be able to build Lucene/Solr 
also with a later java version and not fail fatally with later versions! 
Jenkins does not catch this at the moment because it still uses ANT.

So please, please only keep -Werror enabled if we explicitely say for which 
warnings. As we fixed it for Java 11, just make the {{-Xlint}} be an explicit 
list. I would just get the "enabled-by-default" -Xlint settings and list them 
explicitely. In short:

- remove {{-Xlint}}
- add {{-Xlint:+foobar}} for each warning type that's the default in Java 11.

This is what other projects (also using GCC with Werror) are doing.


was (Author: thetaphi):
Hi,

I was on vacation the last 2 weeks so I did not look into this. I have one 
problem with failing on errors, but that's easy to fix! The problem is: Newer 
java versions add new warning types to the code. As we say "work with Java 11" 
it's hard to prevent a failure on later Java versions and it's also hard to 
communicate with developers. I think you should be able to build Lucene/Solr 
also with a later java version and not fail fatally with later versions!

So please, please only keep -Werror enabled if we explicitely say for which 
warnings. As we fixed it for Java 11, just make the {{-Xlint}} be an explicit 
list. I would just get the "enabled-by-default" -Xlint settings and list them 
explicitely. In short:

- remove {{-Xlint}}
- add {{-Xlint:+foobar}} for each warning type that's the default in Java 11.

This is what other projects (also using GCC with Werror) are doing.

> Fail complation on warnings, 9x gradle-only
> -------------------------------------------
>
>                 Key: LUCENE-9411
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9411
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: general/build
>            Reporter: Erick Erickson
>            Assignee: Erick Erickson
>            Priority: Major
>              Labels: build
>             Fix For: master (9.0)
>
>         Attachments: LUCENE-9411.patch, LUCENE-9411.patch, LUCENE-9411.patch, 
> LUCENE-9411.patch, annotations-warnings.patch
>
>
> Moving this over here from SOLR-11973 since it's part of the build system and 
> affects Lucene as well as Solr. You might want to see the discussion there.
> We have a clean compile for both Solr and Lucene, no rawtypes, unchecked, 
> try, etc. warnings. There are some peculiar warnings (things like 
> SuppressFBWarnings, i.e. FindBugs) that I'm not sure about at all, but let's 
> assume those are not a problem. Now I'd like to start failing the compilation 
> if people write new code that generates warnings.
> From what I can tell, just adding the flag is easy in both the Gradle and Ant 
> builds. I still have to prove out that adding -Werrors does what I expect, 
> i.e. succeeds now and fails when I introduce warnings.
> But let's assume that works. Are there objections to this idea generally? I 
> hope to have some data by next Monday.
> FWIW, the Lucene code base had far fewer issues than Solr, but 
> common-build.xml is in Lucene.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to