You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by Steve Loughran <st...@apache.org> on 2006/03/23 12:05:36 UTC

on java1.5


Now that Gump has switched to java1.5, its showing up some problems in 
javac.

Specifically, it appears to be defaulting to source=1.5

This breaks junit addons

http://vmgump.apache.org/gump/public/junit-addons/junit-addons/gump_work/build_junit-addons_junit-addons.html

I checked out the source in CVS; they are not saying source="1.5"; they 
are not saying anything about the source version. Yet javac has switched 
to java1.5. This is breaking backwards compatibility for builds.



Also, <javac> shouldnt warn people about source=1.2 on every compile:

http://vmgump.apache.org/gump/public/emma/emma/gump_work/build_emma_emma.html


  Once per build should suffice. Maybe we could set an internal property 
_internal.warned.user.about.target that only triggers a warn when it 
aint set.



---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: on java1.5

Posted by Steve Loughran <st...@apache.org>.
Steve Loughran wrote:
> 
> 
> Now that Gump has switched to java1.5, its showing up some problems in 
> javac.
> 
> Specifically, it appears to be defaulting to source=1.5
> 
> This breaks junit addons
> 
> http://vmgump.apache.org/gump/public/junit-addons/junit-addons/gump_work/build_junit-addons_junit-addons.html 
> 
> 
> I checked out the source in CVS; they are not saying source="1.5"; they 
> are not saying anything about the source version. Yet javac has switched 
> to java1.5. This is breaking backwards compatibility for builds.
> 
> 

as of last night, Stefan fixed this

+
+* <javac>'s source and target attributes as well as <javadoc>'s source
+  attribute will read default values from the properties
+  ant.build.javac.source and ant.build.javac.target.

Set those properties in the <ant> element of a project and you can force 
a build using an older version of the language...

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Re: on java1.5

Posted by Dominique Devienne <dd...@gmail.com>.
> Now, when <rmic>'s dependency logic broke moving up to 1.5, I fixed it
> by forcing the proxy generation to be downwards compatible, so
> everything behaved as on a 1.3 or 1.4 box.

True, and was probably the right choice. But there are fewer <rmic>
users than <javac> users, so impacts less people.

> Here are some options
> (1) tweak javac to build at 1.4 or below unless stated.

I think this would be "surprising", since <javac> would behave
differently than javac the command line app.

> (2) provide a back door switch to let gump control the jvm version. that
> way old code can be built under a new compiler.
>
> #2 has appeal.

Just like you, I'd rather avoid a magic property for gump, but I don't
see another solution, since I'm not fond of #1. I won't -1 #1 yet, but
I don't like it. --DD

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


Re: on java1.5

Posted by Peter Reilly <pe...@gmail.com>.
Perhaps this could be in the gump definition of a project?

Peter


On 3/23/06, Steve Loughran <st...@apache.org> wrote:
>
> Peter Reilly wrote:
> > #1 would not be backwardly compatible !
> >
> > I am not too sure about #2. In the ant build
> > file we had to deal with this issue for a while,
> > it may be as well to get other project 1.5 aware.
> > Also new projects would have to set things so
> > that 1.5 (and higher) would work.
> >
>
> Telling people to say "you must declare a java version" is no big deal;
> its easily done. But there are a lot of projects out there that built
> happily, and which now dont because gump upgraded.
>
> Furthermore, what if we can't upgrade them all? There are old projects
> out there that havent had a change for 12+ months, but which still work.
> Its only that they dont compile on java1.5.
>
> if we the properties ant._internal._javac.source and
> ant._internal._javac.target that set the defaults for javac, then you
> can also use them on the command line to build anything 'legacy',
> without touching the build file.
>
>
> -steve
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: on java1.5

Posted by Dominique Devienne <dd...@gmail.com>.
> if we the properties ant._internal._javac.source and
> ant._internal._javac.target that set the defaults for javac, then you
> can also use them on the command line to build anything 'legacy',
> without touching the build file.

Even though someone could abuse these "Magic" properties for other
purposes, I'd prefer something like ant.gump.javac.{source|target} or
something dramatic like ant.override-attributes.javac.{source|target}.
--DD

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


Re: on java1.5

Posted by Steve Loughran <st...@apache.org>.
Peter Reilly wrote:
> #1 would not be backwardly compatible !
> 
> I am not too sure about #2. In the ant build
> file we had to deal with this issue for a while,
> it may be as well to get other project 1.5 aware.
> Also new projects would have to set things so
> that 1.5 (and higher) would work.
> 

Telling people to say "you must declare a java version" is no big deal; 
its easily done. But there are a lot of projects out there that built 
happily, and which now dont because gump upgraded.

Furthermore, what if we can't upgrade them all? There are old projects 
out there that havent had a change for 12+ months, but which still work. 
Its only that they dont compile on java1.5.

if we the properties ant._internal._javac.source and 
ant._internal._javac.target that set the defaults for javac, then you 
can also use them on the command line to build anything 'legacy', 
without touching the build file.


-steve




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


Re: on java1.5

Posted by Peter Reilly <pe...@gmail.com>.
#1 would not be backwardly compatible !

I am not too sure about #2. In the ant build
file we had to deal with this issue for a while,
it may be as well to get other project 1.5 aware.
Also new projects would have to set things so
that 1.5 (and higher) would work.

Peter


On 3/23/06, Steve Loughran <st...@apache.org> wrote:
>
> Dominique Devienne wrote:
> >> Specifically, it appears to be defaulting to source=1.5
> >> [...]
> >> I checked out the source in CVS; they are not saying source="1.5"; they
> >> are not saying anything about the source version. Yet javac has
> switched
> >> to java1.5. This is breaking backwards compatibility for builds.
> >
> > It was always my understanding that <javac>, just like SUN's compiler,
> > always defaults to the current Java source level for the JDK.
> >
> > Wrong assumption? The fact that the Java language evolves, making
> > older sources incompatible with it, is not really pointing to a BC
> > issue for <javac> IMHO.
> >
> > Gump moving to 1.5 has got to have consequences, it can't be
> > transparent, when new keywords and classes are added to the platform
> > (even new classes can break the source, when it's using import foo.*).
> > --DD
>
> Gump didnt want to move to java1.5; junit forced their hand. Now old
> code, code that built and worked happily, has broken. The usual cause is
> that enum is now reserved.
>
> Now, when <rmic>'s dependency logic broke moving up to 1.5, I fixed it
> by forcing the proxy generation to be downwards compatible, so
> everything behaved as on a 1.3 or 1.4 box.
>
> Here are some options
> (1) tweak javac to build at 1.4 or below unless stated.
>
> (2) provide a back door switch to let gump control the jvm version. that
> way old code can be built under a new compiler.
>
> #2 has appeal.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Re: on java1.5

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 23 Mar 2006, Steve Loughran <st...@apache.org> wrote:

> Gump didnt want to move to java1.5;

Well, Gump being what it is should be running Mustang beta by now.
Not running 1.5 was mainly influenced by not havong one installed on
vmgump and people not having time to install it.

> junit forced their hand.

It finally pushed me to start a one hour upload of the Linux JDK
instead of playing with my kids on a weekend ;-)

> Here are some options
> (1) tweak javac to build at 1.4 or below unless stated.

-1, too late.

> (2) provide a back door switch to let gump control the jvm
> version. that way old code can be built under a new compiler.

+0

Stefan

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


Re: on java1.5

Posted by Steve Loughran <st...@apache.org>.
Dominique Devienne wrote:
>> Specifically, it appears to be defaulting to source=1.5
>> [...]
>> I checked out the source in CVS; they are not saying source="1.5"; they
>> are not saying anything about the source version. Yet javac has switched
>> to java1.5. This is breaking backwards compatibility for builds.
> 
> It was always my understanding that <javac>, just like SUN's compiler,
> always defaults to the current Java source level for the JDK.
> 
> Wrong assumption? The fact that the Java language evolves, making
> older sources incompatible with it, is not really pointing to a BC
> issue for <javac> IMHO.
> 
> Gump moving to 1.5 has got to have consequences, it can't be
> transparent, when new keywords and classes are added to the platform
> (even new classes can break the source, when it's using import foo.*).
> --DD

Gump didnt want to move to java1.5; junit forced their hand. Now old 
code, code that built and worked happily, has broken. The usual cause is 
that enum is now reserved.

Now, when <rmic>'s dependency logic broke moving up to 1.5, I fixed it 
by forcing the proxy generation to be downwards compatible, so 
everything behaved as on a 1.3 or 1.4 box.

Here are some options
(1) tweak javac to build at 1.4 or below unless stated.

(2) provide a back door switch to let gump control the jvm version. that 
way old code can be built under a new compiler.

#2 has appeal.



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


Re: on java1.5

Posted by Dominique Devienne <dd...@gmail.com>.
> Specifically, it appears to be defaulting to source=1.5
> [...]
> I checked out the source in CVS; they are not saying source="1.5"; they
> are not saying anything about the source version. Yet javac has switched
> to java1.5. This is breaking backwards compatibility for builds.

It was always my understanding that <javac>, just like SUN's compiler,
always defaults to the current Java source level for the JDK.

Wrong assumption? The fact that the Java language evolves, making
older sources incompatible with it, is not really pointing to a BC
issue for <javac> IMHO.

Gump moving to 1.5 has got to have consequences, it can't be
transparent, when new keywords and classes are added to the platform
(even new classes can break the source, when it's using import foo.*).
--DD

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


Re: on java1.5

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 23 Mar 2006, Steve Loughran <st...@apache.org> wrote:
> Now that Gump has switched to java1.5, its showing up some problems
> in javac.
> 
> Specifically, it appears to be defaulting to source=1.5

Please take the time and look into the manual page of the task, in
particular the bold-face notes on the target and source attributes ;-)

> This is breaking backwards compatibility for builds.

Quite the opposite.  Changing javac's behaviour to default to 1.3 or
something would have broken working builds on Java 1.5 when we started
to work on 1.5 support for 1.6(.2 or something).

> Also, <javac> shouldnt warn people about source=1.2 on every
> compile:
> 
>   Once per build should suffice.

+1

Stefan

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