You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Nathan Beyer <nb...@kc.rr.com> on 2006/09/10 22:17:02 UTC

[build] Compiler parameterization and using ECJ

I've done some tweaking to the build scripts around compiler usage and
wanted to run it by the list for comments, etc.

 

*	I've removed the "-showversion" JVM argument from the module build
scripts that were using it when executing the tests. The launcher behavior
changed a bit here, so this isn't working with the IBM VME yet. This can be
added back later. Note: this wasn't consistently being used in all scripts
prior to this change.

 

*	Following the lead of other 'javac' properties configured in the
/make/properties.xml file, I've added a 'hy.javac.compiler' property that is
used by the scripts to set the 'compiler' property on 'javac' tasks.
Currently, this is just set to 'modern' to maintain the previous behavior.

 

*	I've updated all of the build scripts that were calling 'javac' to
consistently use all of the 'hy.javac.*' properties, including the compiler
property. Additionally, I've removed all script elements that were setting
the 'build.compiler' property.

 

The rationale behind all of the compiler tweaks was to centralize and
standardize the compiler setting a bit more. The custom property can always
be dumped and we can just use the standard Ant 'build.compiler', but this
time use it in the 'properties.xml' file, so it's centralized still.

 

The other big reason to do this is to attempt to use the Eclipse (ECJ)
compiler for the build. I've tested using the ECJ by setting the new
property and the build and tests work as normal, but I haven't found a way
to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
folder. As such, I've left the compiler property at 'modern' for now.

 

I'd like to permanently set the compiler property to use the ECJ v3.2, but
this will seemingly "break the build" if Ant isn't setup properly. Does
anyone have any objections to using ECJ as the standard compiler? Since
Harmony will use this as it's 'javac', I believe it would be proper for
Harmony to be built with the same compiler.

 

Does anyone know of any means of "dynamically" setting up Ant with ECJ? One
thought I had was an extension to 'fetch-depends' that copies ECJ to
ANT_HOME\lib for builders. I'm not sure if that would be considered
desirable behavior.

 

-Nathan


Re: [build] Compiler parameterization and using ECJ

Posted by Alexei Zakharov <al...@gmail.com>.
> Yeah, that's why I'm hoping someone who's more an Ant expert has a way of
> changing the environment to dynamically add the ECJ JAR. We

I don't pretend to be an ant guru but I think the following solution
should work:

<!-- set up ecj -->
<property name="ecj.jar"
          value="C:\<valid path to ecj>\ecj_3.2.jar"/>
<property name="ecj.batch.class"
          value="org.eclipse.jdt.internal.compiler.batch.Main"/>
<tempfile property="javac.batch" suffix=".bat" destdir="build"/>

<condition property="javac.script.content"
           value="%JAVA_HOME%\bin\java -cp ${ecj.jar} ${ecj.batch.class} %*">
    <os family="Windows"/>
</condition>
<condition property="javac.script.content"
           value="-- unix stuff goes here --">
    <os family="unix"/>
</condition>


<!-- Compile! -->
<echo message="${javac.script.content}" file="${javac.batch}"/>
<javac destdir="${build.output}"
       ... [blah blah blah] ...
       fork="yes"
       executable="${javac.batch}"			
       includeAntRuntime="no">


Let's call it "temporary batch file solution".

Regards,

2006/9/11, Nathan Beyer <nb...@kc.rr.com>:
>
>
> > -----Original Message-----
> > From: Geir Magnusson Jr. [mailto:geir@pobox.com]
> >
> > Nathan Beyer wrote:
> > > I've done some tweaking to the build scripts around compiler usage and
> > > wanted to run it by the list for comments, etc.
> > >
> > >
> > >
> > > *   I've removed the "-showversion" JVM argument from the module build
> > > scripts that were using it when executing the tests. The launcher
> > behavior
> > > changed a bit here, so this isn't working with the IBM VME yet. This can
> > be
> > > added back later. Note: this wasn't consistently being used in all
> > scripts
> > > prior to this change.
> > >
> >
> > right - I don't think it's much of a loss to not have it, but we'll put
> > it back as soon as we can.
> > >
> > >
> > > *   Following the lead of other 'javac' properties configured in the
> > > /make/properties.xml file, I've added a 'hy.javac.compiler' property
> > that is
> > > used by the scripts to set the 'compiler' property on 'javac' tasks.
> > > Currently, this is just set to 'modern' to maintain the previous
> > behavior.
> >
> > Why didn't you make it "hy.jc.cr"?  Seriously.  Would it have killed you
> > to put in the "armon"?
>
> Personally, I would prefer that, but in this case I was just trying to be
> consistent. All of the other javac properties are prefixed with
> "hy.javac.XXX".
>
> >
> >
> > [SNIP]
> > >
> > > The other big reason to do this is to attempt to use the Eclipse (ECJ)
> > > compiler for the build. I've tested using the ECJ by setting the new
> > > property and the build and tests work as normal, but I haven't found a
> > way
> > > to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
> > > folder. As such, I've left the compiler property at 'modern' for now.
> >
> > Ugh.  I thought it was working before w/o having to put it in ant/lib,
> > although i don't remember the reason why we took it away.
>
> I don't think it was ever working with the Eclipse compiler before, was it?
>
> > >
> > >
> > >
> > > I'd like to permanently set the compiler property to use the ECJ v3.2,
> > but
> > > this will seemingly "break the build" if Ant isn't setup properly. Does
> > > anyone have any objections to using ECJ as the standard compiler? Since
> > > Harmony will use this as it's 'javac', I believe it would be proper for
> > > Harmony to be built with the same compiler.
> >
> > That's fine, but I think we should solve the problem of where ECJ should
> > be.  Having to dork w/ ant itself seems wrong.
>
> Yeah, that's why I'm hoping someone who's more an Ant expert has a way of
> changing the environment to dynamically add the ECJ JAR. We use 'ant' tasks
> from the top build script to call the dependant scripts, but I haven't found
> any documentation or examples that change Ant's classpath this way.
>
> >
> > >
> > >
> > >
> > > Does anyone know of any means of "dynamically" setting up Ant with ECJ?
> > One
> > > thought I had was an extension to 'fetch-depends' that copies ECJ to
> > > ANT_HOME\lib for builders. I'm not sure if that would be considered
> > > desirable behavior.
> >
> > No - I don't think we should alter peoples working environments like that.
> >
> > Can we make it automatic for now?  if it detects ECJ it uses it,
> > otherwise uses Sun?  (But then we still have the problem with the latest
> > Sun compiler, don't we...)
> >
> > geir
> >
> > >
> > >
> > >
> > > -Nathan

-- 
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [build] Compiler parameterization and using ECJ

Posted by Mark Hindess <ma...@googlemail.com>.
On 10 September 2006 at 18:25, "Geir Magnusson Jr." <ge...@pobox.com> wrote:
> 
> Nathan Beyer wrote:
> > 
> >> -----Original Message-----
> >> From: Geir Magnusson Jr. [mailto:geir@pobox.com]
> >>
> >> Nathan Beyer wrote:
> >>> I've done some tweaking to the build scripts around compiler usage
> >>> and wanted to run it by the list for comments, etc.

Thanks Nathan.

> >> [SNIP]
> >>
> >>> The other big reason to do this is to attempt to use the Eclipse
> >>> (ECJ) compiler for the build. I've tested using the ECJ by setting
> >>> the new property and the build and tests work as normal, but
> >>> I haven't found a way to use the ECJ without manually placing
> >>> the ECJ JAR in the ANT_HOME\lib folder. As such, I've left the
> >>> compiler property at 'modern' for now.
> >>
> >> Ugh.  I thought it was working before w/o having to put it in
> >> ant/lib, although i don't remember the reason why we took it away.
> >
> > I don't think it was ever working with the Eclipse compiler before,
> > was it?
> 
> I think so.  I think that Mark undid it.

Yes.  I undid it when we were using the jsr14 hack which didn't work on
with ecj - at the time I think it might now.

I think we should move forward to use the ecj since it has a cleaner
classpath when doing compiles which helps us spot bugs earlier.  I'll
take a look at making sure the linux build machine is able to build with
ecj today.  (The windows build machine is broken - I need to move stuff
around since it is falling over the windows path length issues.)

Regards,
 Mark.



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [build] Compiler parameterization and using ECJ

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Nathan Beyer wrote:
> 
>> -----Original Message-----
>> From: Geir Magnusson Jr. [mailto:geir@pobox.com]
>>
>> Nathan Beyer wrote:
>>> I've done some tweaking to the build scripts around compiler usage and
>>> wanted to run it by the list for comments, etc.
>>>
>>>
>>>
>>> *	I've removed the "-showversion" JVM argument from the module build
>>> scripts that were using it when executing the tests. The launcher
>> behavior
>>> changed a bit here, so this isn't working with the IBM VME yet. This can
>> be
>>> added back later. Note: this wasn't consistently being used in all
>> scripts
>>> prior to this change.
>>>
>> right - I don't think it's much of a loss to not have it, but we'll put
>> it back as soon as we can.
>>>
>>> *	Following the lead of other 'javac' properties configured in the
>>> /make/properties.xml file, I've added a 'hy.javac.compiler' property
>> that is
>>> used by the scripts to set the 'compiler' property on 'javac' tasks.
>>> Currently, this is just set to 'modern' to maintain the previous
>> behavior.
>>
>> Why didn't you make it "hy.jc.cr"?  Seriously.  Would it have killed you
>> to put in the "armon"?
> 
> Personally, I would prefer that, but in this case I was just trying to be
> consistent. All of the other javac properties are prefixed with
> "hy.javac.XXX".

Be bold!  Lead those that are aesthetically challenged!

> 
>>
>> [SNIP]
>>> The other big reason to do this is to attempt to use the Eclipse (ECJ)
>>> compiler for the build. I've tested using the ECJ by setting the new
>>> property and the build and tests work as normal, but I haven't found a
>> way
>>> to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
>>> folder. As such, I've left the compiler property at 'modern' for now.
>> Ugh.  I thought it was working before w/o having to put it in ant/lib,
>> although i don't remember the reason why we took it away.
> 
> I don't think it was ever working with the Eclipse compiler before, was it?

I think so.  I think that Mark undid it.

geir

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


RE: [build] Compiler parameterization and using ECJ

Posted by Nathan Beyer <nb...@kc.rr.com>.

> -----Original Message-----
> From: Geir Magnusson Jr. [mailto:geir@pobox.com]
> 
> Nathan Beyer wrote:
> > I've done some tweaking to the build scripts around compiler usage and
> > wanted to run it by the list for comments, etc.
> >
> >
> >
> > *	I've removed the "-showversion" JVM argument from the module build
> > scripts that were using it when executing the tests. The launcher
> behavior
> > changed a bit here, so this isn't working with the IBM VME yet. This can
> be
> > added back later. Note: this wasn't consistently being used in all
> scripts
> > prior to this change.
> >
> 
> right - I don't think it's much of a loss to not have it, but we'll put
> it back as soon as we can.
> >
> >
> > *	Following the lead of other 'javac' properties configured in the
> > /make/properties.xml file, I've added a 'hy.javac.compiler' property
> that is
> > used by the scripts to set the 'compiler' property on 'javac' tasks.
> > Currently, this is just set to 'modern' to maintain the previous
> behavior.
> 
> Why didn't you make it "hy.jc.cr"?  Seriously.  Would it have killed you
> to put in the "armon"?

Personally, I would prefer that, but in this case I was just trying to be
consistent. All of the other javac properties are prefixed with
"hy.javac.XXX".

> 
> 
> [SNIP]
> >
> > The other big reason to do this is to attempt to use the Eclipse (ECJ)
> > compiler for the build. I've tested using the ECJ by setting the new
> > property and the build and tests work as normal, but I haven't found a
> way
> > to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
> > folder. As such, I've left the compiler property at 'modern' for now.
> 
> Ugh.  I thought it was working before w/o having to put it in ant/lib,
> although i don't remember the reason why we took it away.

I don't think it was ever working with the Eclipse compiler before, was it?

> >
> >
> >
> > I'd like to permanently set the compiler property to use the ECJ v3.2,
> but
> > this will seemingly "break the build" if Ant isn't setup properly. Does
> > anyone have any objections to using ECJ as the standard compiler? Since
> > Harmony will use this as it's 'javac', I believe it would be proper for
> > Harmony to be built with the same compiler.
> 
> That's fine, but I think we should solve the problem of where ECJ should
> be.  Having to dork w/ ant itself seems wrong.

Yeah, that's why I'm hoping someone who's more an Ant expert has a way of
changing the environment to dynamically add the ECJ JAR. We use 'ant' tasks
from the top build script to call the dependant scripts, but I haven't found
any documentation or examples that change Ant's classpath this way.

> 
> >
> >
> >
> > Does anyone know of any means of "dynamically" setting up Ant with ECJ?
> One
> > thought I had was an extension to 'fetch-depends' that copies ECJ to
> > ANT_HOME\lib for builders. I'm not sure if that would be considered
> > desirable behavior.
> 
> No - I don't think we should alter peoples working environments like that.
> 
> Can we make it automatic for now?  if it detects ECJ it uses it,
> otherwise uses Sun?  (But then we still have the problem with the latest
> Sun compiler, don't we...)
> 
> geir
> 
> >
> >
> >
> > -Nathan
> >
> >
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [build] Compiler parameterization and using ECJ

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Nathan Beyer wrote:
> I've done some tweaking to the build scripts around compiler usage and
> wanted to run it by the list for comments, etc.
> 
>  
> 
> *	I've removed the "-showversion" JVM argument from the module build
> scripts that were using it when executing the tests. The launcher behavior
> changed a bit here, so this isn't working with the IBM VME yet. This can be
> added back later. Note: this wasn't consistently being used in all scripts
> prior to this change.
> 

right - I don't think it's much of a loss to not have it, but we'll put 
it back as soon as we can.
>  
> 
> *	Following the lead of other 'javac' properties configured in the
> /make/properties.xml file, I've added a 'hy.javac.compiler' property that is
> used by the scripts to set the 'compiler' property on 'javac' tasks.
> Currently, this is just set to 'modern' to maintain the previous behavior.

Why didn't you make it "hy.jc.cr"?  Seriously.  Would it have killed you 
to put in the "armon"?


[SNIP]
> 
> The other big reason to do this is to attempt to use the Eclipse (ECJ)
> compiler for the build. I've tested using the ECJ by setting the new
> property and the build and tests work as normal, but I haven't found a way
> to use the ECJ without manually placing the ECJ JAR in the ANT_HOME\lib
> folder. As such, I've left the compiler property at 'modern' for now.

Ugh.  I thought it was working before w/o having to put it in ant/lib, 
although i don't remember the reason why we took it away.
> 
>  
> 
> I'd like to permanently set the compiler property to use the ECJ v3.2, but
> this will seemingly "break the build" if Ant isn't setup properly. Does
> anyone have any objections to using ECJ as the standard compiler? Since
> Harmony will use this as it's 'javac', I believe it would be proper for
> Harmony to be built with the same compiler.

That's fine, but I think we should solve the problem of where ECJ should 
be.  Having to dork w/ ant itself seems wrong.

> 
>  
> 
> Does anyone know of any means of "dynamically" setting up Ant with ECJ? One
> thought I had was an extension to 'fetch-depends' that copies ECJ to
> ANT_HOME\lib for builders. I'm not sure if that would be considered
> desirable behavior.

No - I don't think we should alter peoples working environments like that.

Can we make it automatic for now?  if it detects ECJ it uses it, 
otherwise uses Sun?  (But then we still have the problem with the latest 
Sun compiler, don't we...)

geir

> 
>  
> 
> -Nathan
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org