Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-22 Thread Alan Bateman

On 21/03/2013 22:12, Brad Wetmore wrote:

:

The codereview is here:

http://cr.openjdk.java.net/~wetmore/8009517/webrev.00/

I plan to push through the deploy gate, as they have an integration 
next week.  Thomas Ng will do the push for us.


Any objections, please speak now.
No objection here but just to mention that since you need to set 
NEWBUILD=false then it might not be too much extra to also set 
JAVAC_WARNINGS_FATAL=false.


In any case, I think it would be desirable if there was a retirement 
date set for the old build so that the remaining users (I assume very 
few at this point) have something to aim for.


-Alan.


Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-19 Thread Chris Hegarty

Brad,

I do not build using the old build anymore. This is clearly a blocker 
for your work. If you want to suppress the warnings for 
overrides/deprecation, then please push the change ( your patch ). We 
can revisit this in the future, when it is necessary.


-Chris.

On 03/19/2013 01:29 AM, Brad Wetmore wrote:

Sorry for the delay in response, I've been pulled in yet another
direction, and this has come back up in priority.

On 3/9/2013 12:11 AM, Chris Hegarty wrote:

I agree about warning creeping problems.  This is a temporary solution,
we should soon be fixing the underlying hashcode/equals
problems...but...


Your temporary solution, -overrides, is just that. It will enable the
old build to complete today, but it could fail at any point in the
future, as the code changes.


Correct.  As it stands today, a recent change now requires *BOTH*
overrides/deprecation in order to get a complete MASTER build using the
old build system.

[brwetmor@flicker-vm1] 222 hg diff common/shared/Defs-java.gmk
diff --git a/make/common/shared/Defs-java.gmk
b/make/common/shared/Defs-java.gmk
--- a/make/common/shared/Defs-java.gmk
+++ b/make/common/shared/Defs-java.gmk
@@ -127,7 +127,7 @@
  endif

  # TODO: Workaround for CR 7063027. Remove -path eventually.
-JAVAC_LINT_OPTIONS += -Xlint:-path
+JAVAC_LINT_OPTIONS += -Xlint:-path,-overrides,-deprecation

  JAVACFLAGS += $(JAVAC_LINT_OPTIONS)


For example, java.net is currently warning free, in the old it compiles
with fatal warnings enabled. Lets say, in a moment of madness, I add a
dependency from java.net.Socket to say java.awt.RenderingHints.Key ( or
any class that produces warnings when compiled. I run the new build, all
is fine. Push the changes. Now someone else sync's up, but need to build
using the old build. If the new dependent class is not already compiled
before java.net.Socket gets compiled, it will be compiled implicitly.
It's warnings will cause the compile to fail, and the old build will
fail. Or much simpler, anyone could write sloppy code with warnings, the
new build will suppress them, and they won't notice. Push this code, and
the old build will fail if is explicitly, or implicitly, compiles this
code with -Werror enabled.


Exactly.  Our formerly clean code now requires disabling of two Lint
options, but the new build is happy just to report the warning.  The old
build crashes on the warning.

Our options for the old build system are:

1.  disable the warning for overrides/deprecation, keep -Werror (my
preferred since these are minor warnings.)
2.  Somehow disable -Werror on these new directories that are now
failing.  (more work to figure out, but also acceptable)
3.  Fix the warnings.  (I don't have cycles to drive a rewrite of use of
deprecated code and/or add missing equals/hashcode that the recent javac
changes exposed.)


 We
spent a lot of time cleaning up many directories, seems a shame to start
allowing non-fatal warnings to come back into previously clean code
because people aren't taking the time to fix new warnings as they are
introduced.


I personally spent several weeks over the past number of years fixing
warnings and reviewing warning cleanup webrevs from others. I took much
pride in keeping certain areas warnings free.

It is with great regret that I propose to disable fatal warnings in the
old build, but I felt this the best/safest option. I heard much
annoyance and frustration from others about hitting seemingly random
errors with the old build recently. This is the only sure way to avoid
that.


The new builds will still warn, but the
old builds will still fail for all but these override problems.  Yes,
you lose the warnings in the old, but seems better than completely
shutting off erroring.


I'm ok with that, if others are. To clarify, I think you are suggesting
that we keep the old build as it, with -overrides,


and now ,-deprecation  :(


 and use it
periodically as a way of tracking new warnings being introduced into
areas that were warning free.


That would be a side-effect, as someone would occasionally need to
figure out what's changed.

The main issue we're hitting right now is that RE has to make several
source code changes in order to build JCE jar files without errors.  I
was able to change the individual LINT options globally and reduce it
down to one change, but that's still one change that RE has to make.  I
feel that RE should not be making any changes, but that ship has already
sailed and we're stuck with the results now.

  That is, if the old build fails because of

a fatal warning, so be it. File a bug and fix the source code. Then the
old build will work again. This means that at any point in time the old
build cannot be guaranteed to be buildable.

Everyone seems to agree, a solution needs to be found to allow us to
keep certain areas warning free. This issue is too important, and too
much time was spent, to allow it to regress to the state it was in a few
years ago.


It's already started.

Brad




Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-11 Thread Erik Joelsson
I have a suggestion for how to at least partly enable -Werror in the new 
build. The penalty is slightly longer compile time, but the difference 
should be negligible.


We split the big java compilation in jdk in two. The first pass with 
-Werror and all warnings turned on, the second without. We make a list 
of packages that are passing -Werror and use as include list for the 
first and exclude list for the second. As you make more packages warning 
free, we add them to the list.


This solution is not as fine grained as a per package configured set of 
warning flags, but it's much better than we have today.


/Erik

On 2013-03-08 16:56, Alan Bateman wrote:

On 08/03/2013 15:49, Mike Duigou wrote:
Looks fine to me. Do we have an issue open for restoring warnings to 
the new build?


Mike

I don't know if there is an issue for that yet but as the new build 
compiles thousands of classes in a single compilation unit then it 
means we will need to make significant inroads on the warnings before 
more can be enabled. The approach with the old build was by area and 
good progress had been made but with the new build, then it may have 
to be by warning type as all areas are compiled together.


-Alan.



Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-11 Thread Erik Joelsson
I tried implementing a PoC for this. Without sjavac, it works, except 
that the first pass must be run without -Werror and the second with. 
Since we use -implicit:none, this is fine.


With sjavac I had to let it compile the full set of classes first and 
then run a second time (into a different output directory) with just the 
warning free set of packages. The overhead on my machine was 5 seconds 
for the second pass. This solution also works without sjavac, but then 
the overhead is 37 seconds on my machine.


Now the question is, do we want to pursue this or not?

/Erik

On 2013-03-11 10:30, Erik Joelsson wrote:
I have a suggestion for how to at least partly enable -Werror in the 
new build. The penalty is slightly longer compile time, but the 
difference should be negligible.


We split the big java compilation in jdk in two. The first pass with 
-Werror and all warnings turned on, the second without. We make a list 
of packages that are passing -Werror and use as include list for the 
first and exclude list for the second. As you make more packages 
warning free, we add them to the list.


This solution is not as fine grained as a per package configured set 
of warning flags, but it's much better than we have today.


/Erik

On 2013-03-08 16:56, Alan Bateman wrote:

On 08/03/2013 15:49, Mike Duigou wrote:
Looks fine to me. Do we have an issue open for restoring warnings to 
the new build?


Mike

I don't know if there is an issue for that yet but as the new build 
compiles thousands of classes in a single compilation unit then it 
means we will need to make significant inroads on the warnings before 
more can be enabled. The approach with the old build was by area and 
good progress had been made but with the new build, then it may have 
to be by warning type as all areas are compiled together.


-Alan.



Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-11 Thread Chris Hegarty

Thank you for trying this Erik.

I did think of this workaround myself, but felt if might not be 
acceptable due to the performance penalty. But this information is great 
to have.


I wonder if we should try to get all alternatives/proposals on the 
table, then make a decision. I know of two other possibilities.


1) Leave things are they are, and use another tool to investigate
   warnings. From Jon.
2) Explore supporting Package level SuppressWarnings. Then apply
   to the relevant packages, and enable -Werror in the build.

Others?

-Chris.

On 11/03/2013 14:20, Erik Joelsson wrote:

I tried implementing a PoC for this. Without sjavac, it works, except
that the first pass must be run without -Werror and the second with.
Since we use -implicit:none, this is fine.

With sjavac I had to let it compile the full set of classes first and
then run a second time (into a different output directory) with just the
warning free set of packages. The overhead on my machine was 5 seconds
for the second pass. This solution also works without sjavac, but then
the overhead is 37 seconds on my machine.

Now the question is, do we want to pursue this or not?

/Erik

On 2013-03-11 10:30, Erik Joelsson wrote:

I have a suggestion for how to at least partly enable -Werror in the
new build. The penalty is slightly longer compile time, but the
difference should be negligible.

We split the big java compilation in jdk in two. The first pass with
-Werror and all warnings turned on, the second without. We make a list
of packages that are passing -Werror and use as include list for the
first and exclude list for the second. As you make more packages
warning free, we add them to the list.

This solution is not as fine grained as a per package configured set
of warning flags, but it's much better than we have today.

/Erik

On 2013-03-08 16:56, Alan Bateman wrote:

On 08/03/2013 15:49, Mike Duigou wrote:

Looks fine to me. Do we have an issue open for restoring warnings to
the new build?

Mike


I don't know if there is an issue for that yet but as the new build
compiles thousands of classes in a single compilation unit then it
means we will need to make significant inroads on the warnings before
more can be enabled. The approach with the old build was by area and
good progress had been made but with the new build, then it may have
to be by warning type as all areas are compiled together.

-Alan.



Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-09 Thread Chris Hegarty

I agree about warning creeping problems.  This is a temporary solution,
we should soon be fixing the underlying hashcode/equals problems...but...


Your temporary solution, -overrides, is just that. It will enable the 
old build to complete today, but it could fail at any point in the 
future, as the code changes.


For example, java.net is currently warning free, in the old it compiles 
with fatal warnings enabled. Lets say, in a moment of madness, I add a 
dependency from java.net.Socket to say java.awt.RenderingHints.Key ( or 
any class that produces warnings when compiled. I run the new build, all 
is fine. Push the changes. Now someone else sync's up, but need to build 
using the old build. If the new dependent class is not already compiled 
before java.net.Socket gets compiled, it will be compiled implicitly. 
It's warnings will cause the compile to fail, and the old build will 
fail. Or much simpler, anyone could write sloppy code with warnings, the 
new build will suppress them, and they won't notice. Push this code, and 
the old build will fail if is explicitly, or implicitly, compiles this 
code with -Werror enabled.



 We
spent a lot of time cleaning up many directories, seems a shame to start
allowing non-fatal warnings to come back into previously clean code
because people aren't taking the time to fix new warnings as they are
introduced.


I personally spent several weeks over the past number of years fixing 
warnings and reviewing warning cleanup webrevs from others. I took much 
pride in keeping certain areas warnings free.


It is with great regret that I propose to disable fatal warnings in the 
old build, but I felt this the best/safest option. I heard much 
annoyance and frustration from others about hitting seemingly random 
errors with the old build recently. This is the only sure way to avoid that.



The new builds will still warn, but the
old builds will still fail for all but these override problems.  Yes,
you lose the warnings in the old, but seems better than completely
shutting off erroring.


I'm ok with that, if others are. To clarify, I think you are suggesting 
that we keep the old build as it, with -overrides, and use it 
periodically as a way of tracking new warnings being introduced into 
areas that were warning free. That is, if the old build fails because of 
a fatal warning, so be it. File a bug and fix the source code. Then the 
old build will work again. This means that at any point in time the old 
build cannot be guaranteed to be buildable.


Everyone seems to agree, a solution needs to be found to allow us to 
keep certain areas warning free. This issue is too important, and too 
much time was spent, to allow it to regress to the state it was in a few 
years ago.


-Chris.



(Ideally it would be nice to warn but not fail on just this one lint
option, but don't see how that's possible.)

Brad






-Chris.



Mike

On Mar 8 2013, at 05:24 , Chris Hegarty wrote:


Since the new build does not enable -Werror when compiling any java
code, and disables quite a few lint options, new changes my
inadvertently introduce warnings without even realizing. This can
cause problems when building with the old build as many areas do
compile with -Werror set. Since the old build is on life support,
probably best to just completely disable -Werror, so anyone still
needing to use it can.

diff -r 48b7295f02f8 make/common/shared/Defs-java.gmk
--- a/make/common/shared/Defs-java.gmk  Thu Mar 07 10:07:13 2013 +
+++ b/make/common/shared/Defs-java.gmk  Thu Mar 07 11:10:37 2013 +
@@ -122,9 +122,10 @@ ifeq ($(JAVAC_MAX_WARNINGS), true)
ifeq ($(JAVAC_MAX_WARNINGS), true)
   JAVAC_LINT_OPTIONS += -Xlint:all
endif
-ifeq ($(JAVAC_WARNINGS_FATAL), true)
-  JAVACFLAGS  += -Werror
-endif
+# Disable fatal warnings, 8009517
+#ifeq ($(JAVAC_WARNINGS_FATAL), true)
+#  JAVACFLAGS  += -Werror
+#endif

# TODO: Workaround for CR 7063027. Remove -path eventually.
JAVAC_LINT_OPTIONS += -Xlint:-path

-Chris.




Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-09 Thread Jonathan Gibbons

On 03/09/2013 12:11 AM, Chris Hegarty wrote:


Everyone seems to agree, a solution needs to be found to allow us to 
keep certain areas warning free. This issue is too important, and too 
much time was spent, to allow it to regress to the state it was in a 
few years ago.


It is true that selective use of -Werror does not play well with the new 
build and the desire to compile as much as possible at any time, 
possibly using sjavac.


I have previously reported on a utility I've written in the past to 
analyze java code and report on the different types of warnings found in 
different packages.  I'm sure we could take something like that utility 
and improve it to the point where it can give errors when entries in the 
matrix which should be empty are not.


This utility could be run as a test meaning it needn't break the build 
but the info is available for those that want to run it.


-- Jon


Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-09 Thread Chris Hegarty

On 9 Mar 2013, at 19:01, Jonathan Gibbons jonathan.gibb...@oracle.com wrote:

 On 03/09/2013 12:11 AM, Chris Hegarty wrote:
 
 Everyone seems to agree, a solution needs to be found to allow us to keep 
 certain areas warning free. This issue is too important, and too much time 
 was spent, to allow it to regress to the state it was in a few years ago.
 
 It is true that selective use of -Werror does not play well with the new 
 build and the desire to compile as much as possible at any time, possibly 
 using sjavac.
 
 I have previously reported on a utility I've written in the past to analyze 
 java code and report on the different types of warnings found in different 
 packages.  I'm sure we could take something like that utility and improve it 
 to the point where it can give errors when entries in the matrix which should 
 be empty are not.
 
 This utility could be run as a test meaning it needn't break the build but 
 the info is available for those that want to run it.

Sounds interesting Jon, and certainly worth exploring.

Another idea, is to enable all lint options and -Werror ;-) If the 
SuppressWarnings annotation was allowable on the PACKAGE Target :-^ It may be 
reasonable to add to the packages where applicable.

-Chris.


 
 -- Jon


Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-08 Thread Mike Duigou
Looks fine to me. Do we have an issue open for restoring warnings to the new 
build?

Mike

On Mar 8 2013, at 05:24 , Chris Hegarty wrote:

 Since the new build does not enable -Werror when compiling any java code, and 
 disables quite a few lint options, new changes my inadvertently introduce 
 warnings without even realizing. This can cause problems when building with 
 the old build as many areas do compile with -Werror set. Since the old build 
 is on life support, probably best to just completely disable -Werror, so 
 anyone still needing to use it can.
 
 diff -r 48b7295f02f8 make/common/shared/Defs-java.gmk
 --- a/make/common/shared/Defs-java.gmk  Thu Mar 07 10:07:13 2013 +
 +++ b/make/common/shared/Defs-java.gmk  Thu Mar 07 11:10:37 2013 +
 @@ -122,9 +122,10 @@ ifeq ($(JAVAC_MAX_WARNINGS), true)
 ifeq ($(JAVAC_MAX_WARNINGS), true)
   JAVAC_LINT_OPTIONS += -Xlint:all
 endif
 -ifeq ($(JAVAC_WARNINGS_FATAL), true)
 -  JAVACFLAGS  += -Werror
 -endif
 +# Disable fatal warnings, 8009517
 +#ifeq ($(JAVAC_WARNINGS_FATAL), true)
 +#  JAVACFLAGS  += -Werror
 +#endif
 
 # TODO: Workaround for CR 7063027. Remove -path eventually.
 JAVAC_LINT_OPTIONS += -Xlint:-path
 
 -Chris.



Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-08 Thread Dan Xu


On 03/08/2013 08:40 AM, Jonathan Gibbons wrote:

On 03/08/2013 08:09 AM, Mike Duigou wrote:

On Mar 8 2013, at 07:56 , Alan Bateman wrote:


On 08/03/2013 15:49, Mike Duigou wrote:
Looks fine to me. Do we have an issue open for restoring warnings 
to the new build?


Mike

I don't know if there is an issue for that yet but as the new build 
compiles thousands of classes in a single compilation unit then it 
means we will need to make significant inroads on the warnings 
before more can be enabled. The approach with the old build was by 
area and good progress had been made but with the new build, then it 
may have to be by warning type as all areas are compiled together.
Understood. Perhaps we can at least use JDK_FILTER incrementally. Do 
we have a way to override the warnings used by the makefile?


Any thoughts towards perhaps disabling -Werror but enabling all of 
the warnings?


Mike



A different and maybe more effective way of tracking this (for now) 
would be to generate a separate report on a regular basis that details 
the number of different types of warnings in each package. The 
technology to do that is easy; the hard part is getting people to 
monitor the results and fixup the issues.


That being said, it should be relatively uncontroversial to totally 
eliminate some types of warnings, like cast warnings, and enable those 
warnings in the build with -Werror.


-- Jon
Kurchi and I are working on this as our side project. We have modified 
your java program to analyse the build logs generated by the new build. 
I am thinking to generate some trend reports after running the build 
regularly and collecting some log data.


-Dan


Re: RFR 8009517: Disable fatal compiler warning in the old build

2013-03-08 Thread Brad Wetmore


I responded in another thread (wasn't aware of this one, sorry), there 
is an alternate to completely disabling -Werror.


On 3/8/2013 7:58 AM, Chris Hegarty wrote:

On 08/03/2013 15:49, Mike Duigou wrote:

Looks fine to me.


Thanks Mike.

  Do we have an issue open for restoring warnings to the new build?

Not yet, that I am aware of. We really need the ability to set lint
options per package/subpackage.


That would be nice.

I agree about warning creeping problems.  This is a temporary solution, 
we should soon be fixing the underlying hashcode/equals problems...but...


1.  javac tightened hashcode/equals checks

2.  new:  -Werror is off in the new builds.
(i.e. not failing on any lint warnings)

3.  old:  -Werror is on for the old builds
(i.e. is failing for any lint warnings)

The proposal is to turn off all errors in the old builds (remove 
-Werror), essentially making 3 like the 2.  Warn but not fatal.  We 
spent a lot of time cleaning up many directories, seems a shame to start 
allowing non-fatal warnings to come back into previously clean code 
because people aren't taking the time to fix new warnings as they are 
introduced.


My suggestion was to turn off just the one warning type in 3 *in the old 
code only* so we can at least continue to build the old without 
completely disabling -Werror.  The new builds will still warn, but the 
old builds will still fail for all but these override problems.  Yes, 
you lose the warnings in the old, but seems better than completely 
shutting off erroring.


(Ideally it would be nice to warn but not fail on just this one lint 
option, but don't see how that's possible.)


Brad






-Chris.



Mike

On Mar 8 2013, at 05:24 , Chris Hegarty wrote:


Since the new build does not enable -Werror when compiling any java
code, and disables quite a few lint options, new changes my
inadvertently introduce warnings without even realizing. This can
cause problems when building with the old build as many areas do
compile with -Werror set. Since the old build is on life support,
probably best to just completely disable -Werror, so anyone still
needing to use it can.

diff -r 48b7295f02f8 make/common/shared/Defs-java.gmk
--- a/make/common/shared/Defs-java.gmk  Thu Mar 07 10:07:13 2013 +
+++ b/make/common/shared/Defs-java.gmk  Thu Mar 07 11:10:37 2013 +
@@ -122,9 +122,10 @@ ifeq ($(JAVAC_MAX_WARNINGS), true)
ifeq ($(JAVAC_MAX_WARNINGS), true)
   JAVAC_LINT_OPTIONS += -Xlint:all
endif
-ifeq ($(JAVAC_WARNINGS_FATAL), true)
-  JAVACFLAGS  += -Werror
-endif
+# Disable fatal warnings, 8009517
+#ifeq ($(JAVAC_WARNINGS_FATAL), true)
+#  JAVACFLAGS  += -Werror
+#endif

# TODO: Workaround for CR 7063027. Remove -path eventually.
JAVAC_LINT_OPTIONS += -Xlint:-path

-Chris.