You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Mark Womack <mw...@apache.org> on 2005/08/18 08:31:40 UTC

1.2.12 Experimental Build

I got a chance to play with the 1.2 build tonight.  Here is what I did:

1) Isolated the build jdk from the Ant runtime jdk.

Basically, I added the following attributes to all of the javac tasks:

           fork="yes"
           includeAntRuntime="no"
           includeJavaRuntime="no"
           compiler="${compiler.version}"
           executable="${compiler.executable}"

I did not set the bootclasspath as it did not seem to be required.

I defined the following new properties to be used in the attributes:

compiler.version=javac1.1
compiler.executable=../../../java/jdk1.2.2/bin/javac

I also changed the javac target and source attributes to be "1.1".  The 
source attribute was set to "1.3".

Also, setting includeAntRuntime to "no" further isolated the build-time 
classpath from anything coming from Ant that could "taint" it.  Which led to 
item #2...

2) Explicitly include the xml-apis.jar in the compile.classpath.

I defined a new property:

xml-apis.jar=../../../code-opensource/apache-xml/xerces-2_6_2/xml-apis.jar

and added it to the compile.classpath:

    <pathelement location="${xml-apis.jar}"/>

3) Added a new jar that has the jndi related classes.

Because I was now compiling with jdk 1.2, the jndi related classes were not 
available (?).  So, I added a new property to include the j2ee.jar, and 
grabbed the 1.2 j2ee download:

j2ee.jar=../../../java/j2sdkee1.2.1/lib/j2ee.jar

and added it to the compile.classpath:

    <pathelement location="${j2ee.jar}"/>

4) After all of that, I found a problem with the jmxCheck target.  The class 
"com.sun.jdmk.comm.HtmlAdaptorServer" was not in my jmx.jar, but in my 
jmx-extra.jar.  The check that is there would never have worked on my 
machine, as far as I can tell.  I need to go back and see if the log4j jmx 
related classes are there.  Maybe the class ended up being found in the Ant 
or JDK runtime previously.  But I modified the check to include the 
jmx-extra.jar in the classpath when it checks for availabily:

            <available classname="com.sun.jdmk.comm.HtmlAdaptorServer">
                <classpath>
                 <pathelement location="${jmx.jar}"/>
                 <pathelement location="${jmx-extra.jar}"/>
                </classpath>
            </available>

Why we are checking for that specific implementation class, I don't know, 
but going with it for now.

5) I had to change mModel and mSvrSock member variables in 
o.a.l.chainsaw.LoggingReceiver.java to non-final.  With the 1.2.2 javac 
there were errors around them never being set in an initializer or 
constructor.  I tried creating a private empty constructor to fix it (as the 
one declared constructor does set them), but it still complained.

So, with all of that, EVERYTHING COMPILES AS BEFORE.  I built a new 
experimental version and put it at:

http://people.apache.org/~mwomack/experimental/logging-log4j-1.2.12rcTEST.jdk1.2.zip

I have not had a chance to run the unit tests against this jar.  If someone 
can get a chance before me, great.  Otherwise I will pick it up again 
tomorrow evening.

None of these changes in and of themselves are that big.  In fact, I think 
the better isolation gives us much more control over what is compiled 
against.

I have not checked in the changes yet since I want to make sure they 
actually have a positive effect.  If so, I can further experiment with using 
the JDK 1.3 compiler.  I started looking at using the 1.1 compiler, but it 
starts to throw even more issues.  It might not be worth that effort if the 
jdk 1.2 compiler generates compatible, non-warning throwing jars.

-Mark



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


Re: 1.2.12 Experimental Build

Posted by Curt Arnold <ca...@apache.org>.
On Aug 19, 2005, at 6:34 AM, Endre Stølsvik wrote:
> Have you tested by using the normal javac (thus 1.5), but with
> bootclasspath set (and -obviously- target=1.1|2)? I find this  
> better, as
> one may assume that later javac's will make more efficient code than
> earlier (using the bytecode better, that is. Optimizing it.).

Unfortunately, the later JDK javac's will produce (likely legal) code  
that will confuse the JIT's of the earlier JVM's.  The whole essence  
of the rework is that we were thinking that we were producing code  
that would run on JDK 1.2 but would produce warnings.  Ant suffered  
from the same issue and was observed to misbehave.


>
> The source flag - isn't that for being "source compatible"? So that  
> "enum"
> will be allowed if you specify source="1.3"? Probably good to set  
> it to
> 1.2|1 when doing the official build, but one should also always  
> testbuild
> with the latest javac, so that one doesn't have source that doesn't  
> build
> on 1.5 and later (e.g. the "enum" keyword that so many earlier sources
> used as variable name for Enumerations).

In the current CVS HEAD, it is parameterized, so that you can specify  
-Djavac.source=1.5 -Djavac.target=1.2+.  I did a check and I was able  
to compile and run the unit tests building with javac.source=1.5 and  
javac.target=1.5.  There are some additional warnings where null is  
passed in for Class[] in reflection methods and JDK 1.5 warns that it  
is ambiguous whether the intent is an array or a 1 entry vararg  
list.  An explicit cast could eliminate the message, but it seemed to  
do no damage.

> |
> | For example, anyone who had used "ant -Dbuild.compiler=gcj" to  
> build log4j
> | using GCJ would now have his specification overridden.
>

To clarify, build.xml had responded to -Dbuild.compiler=XXX (either  
on the command line or in a properties file).  If no compiler  
attribute was specified on the javac task, the value of  
build.compiler property would be consulted in selecting a Java  
compiler.  The introduction of an compiler.version property and  
specification of the compiler property would result in the value of  
build.compiler never being consulted in determining the Java  
compiler.  It would have been better if I had said, "specification  
ignored" instead of "specification overridden".
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: 1.2.12 Experimental Build

Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Wed, 17 Aug 2005, Mark Womack wrote:

| I got a chance to play with the 1.2 build tonight.  Here is what I did:

Very good work!

| 
| 1) Isolated the build jdk from the Ant runtime jdk.
| 
| Basically, I added the following attributes to all of the javac tasks:
| 
|           fork="yes"
|           includeAntRuntime="no"

Good!

|           includeJavaRuntime="no"

Didn't quite realize this one - I -assume- it is default false?

|           compiler="${compiler.version}"
|           executable="${compiler.executable}"
| 
| I did not set the bootclasspath as it did not seem to be required.

Have you tested by using the normal javac (thus 1.5), but with 
bootclasspath set (and -obviously- target=1.1|2)? I find this better, as 
one may assume that later javac's will make more efficient code than 
earlier (using the bytecode better, that is. Optimizing it.).
  It -could- maybe be legal to distribute the rt1.2.jar of java 1.2, and 
thus get the source to build out of the box, but working properly on jre's 
of 1.2?

The source flag - isn't that for being "source compatible"? So that "enum" 
will be allowed if you specify source="1.3"? Probably good to set it to 
1.2|1 when doing the official build, but one should also always testbuild 
with the latest javac, so that one doesn't have source that doesn't build 
on 1.5 and later (e.g. the "enum" keyword that so many earlier sources 
used as variable name for Enumerations).

Endre.

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


RE: 1.2.12 Experimental Build

Posted by Yoav Shapira <yo...@MIT.EDU>.
Hola,
I'm flying to Israel this evening for vacation, and email access will be
sporadic.  I have one comment below:


>> > 3) Added a new jar that has the jndi related classes.
>> >
>> > Because I was now compiling with jdk 1.2, the jndi related classes
>> > were not available (?).  So, I added a new property to include the
>> > j2ee.jar, and grabbed the 1.2 j2ee download:
>> >
>> > j2ee.jar=../../../java/j2sdkee1.2.1/lib/j2ee.jar
>> >
>> > and added it to the compile.classpath:
>> >
>> >    <pathelement location="${j2ee.jar}"/>
>> >
>>
>> Yoav suggested: http://java.sun.com/products/jndi/downloads/
>> index.html, click on the
>> "Download JNDI 1.2.1" link when I encountered the issue.
>
> Probably a better alternative to the entire j2ee.jar.  I will grab it
> tonight.  I overlooked Yoav's email.  I was pretty focused on the build.xml
> last night.  :-)

Yes, a far better alternative in my experience.  You don't want the whole J2EE
jar in there, as that leads to a whole big can of worms.

Have a pleasant couple of weeks everyone,
Yoav

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


Open issues in 1.2.12 (was Re: 1.2.12 Experimental Build)

Posted by Curt Arnold <ca...@apache.org>.
On Aug 18, 2005, at 1:31 PM, Curt Arnold wrote:
> 1. o.a.l.chainsaw.LoggingReceiver.java does not compile with javac  
> from JDK 1.1 and 1.2.

Logged as bug 36262

> 2. log4j does not compile with jikes due to the @deprecated on  
> org.apache.log4j.spi.LoggerRepository.

Slippery.  I don't think I imagined it, but when I add the  
@deprecated back it still compiles.  Also found a gcj compile bug  
issue in Chainsaw logged as 36263.

> 3. Unit tests fail quickly on JDK 1.1 and 1.2.


> 4. Missing docs bug 36213:  http://issues.apache.org/bugzilla/ 
> show_bug.cgi?id=36213
>

> 5. Stack trace dependent tests fail on JDK 1.1 and JDK 1.2

Continuation of 35519 which addressed the same issue but due to JDK,  
reopened.


> 6. Serialization comparison tests fail on JDK 1.1 and 1.2.

Continuation of bug 26433.

> 7. Possibly other more serious tests fail on JDK 1.1 and JDK 1.2  
> but aren't noticed due to 5 and 6.
>


> 8. jmxCheck needs to be tweaked for JDK 1.1 and JDK 1.2.

Continuation of bug 35831.

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


Re: 1.2.12 Experimental Build

Posted by Endre Stølsvik <En...@Stolsvik.com>.
On Thu, 18 Aug 2005, Curt Arnold wrote:

|
| For example, anyone who had used "ant -Dbuild.compiler=gcj" to build log4j
| using GCJ would now have his specification overridden.

You do know that earlier set variables won't be overridden when (tried) 
set again, right? This means that having some include-files at the top is 
cool: (Cut from my standard build.xml file)



  <!-- Note: Properties defined early won't be overridden by later
             settings of the same value, thus the properties in these
             files are "master", and overrides everything. -->

  <property file="build.properties" />
  <property file="build.properties.DEFAULT" />


(build.properties are obviously in .cvsignore, while the .DEFAULT file 
isn't (it is checked in cvs).)


Regards,
Endre

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


Re: 1.2.12 Experimental Build

Posted by Curt Arnold <ca...@apache.org>.
On Aug 18, 2005, at 11:55 AM, Mark Womack wrote:
> includeAntRuntime was explicitly set to "no" because I DO NOT WANT to
> include it anymore.  I want to explicitly isolate our compilation  
> classpath
> from whatever might be in your/mine Ant environment.  We have  
> defined the
> exact set of jars (at least the types if not the exact jars) we are
> expecting to compile with (compiler.classpath), no more, no less.   
> I don't
> want anything else to interfere or be the cause of strange, build  
> related
> stuff.  Especially since we are targeting an earlier compiler.
>

However any breaking change to build.xml could disrupt users who have  
depended on the existing behavior.    For the casual user who is just  
building log4j.jar for their own use or embedded in some larger build  
process, we should keep the default behavior of build.xml as close as  
possible to the previous behavior.  However, we could add additional  
checks in "dist" (or maybe a new "release" target) to check for  
expected distribution settings.

For example, anyone who had used "ant -Dbuild.compiler=gcj" to build  
log4j using GCJ would now have his specification overridden.



>
>> Adding the pathelement is okay. If xml-apis.jar doesn't exist, then
>> it will fall back on the previous behavior.
>>
>
> It is required if we do not include the ant runtime, which we are not.
>

and not running on JDK 1.4 or 1.5.

>>
>> Yoav suggested: http://java.sun.com/products/jndi/downloads/
>> index.html, click on the
>> "Download JNDI 1.2.1" link when I encountered the issue.
>>
>
> Probably a better alternative to the entire j2ee.jar.  I will grab it
> tonight.  I overlooked Yoav's email.  I was pretty focused on the  
> build.xml
> last night.  :-)
>>
>>
>>> None of these changes in and of themselves are that big.  In fact,
>>> I think the better isolation gives us much more control over what
>>> is compiled against.
>>>
>>> I have not checked in the changes yet since I want to make sure
>>> they actually have a positive effect.  If so, I can further
>>> experiment with using the JDK 1.3 compiler.  I started looking at
>>> using the 1.1 compiler, but it starts to throw even more issues.
>>> It might not be worth that effort if the jdk 1.2 compiler generates
>>> compatible, non-warning throwing jars.
>>>
>>
>>
>> The changes that you had suggested would have changed the behavior
>> for end-users who are trying to build log4j.  We should keep that
>> experience unchanged while providing the control needed to produce a
>> clean production build.
>>
>
> I don't agree.  The goal is to create a release jar that is  
> compatible with
> jdk 1.1.  That is the contract we sold for log4j 1.2.  I thought we  
> had it
> for 1.2.11, but apparently not as well as I thought.  If the build
> process/settings have to change, then so be it.  We should document  
> what has
> changed, what needs to be done to successfully build, and move  
> forward.

build.xml has two serve two audiences, those wish to build log4j for  
themselves for whatever reason (like using GCJ) and the much smaller  
audience of those who are trying to produce a forrmal distribution.   
Since the release manager population is hardly ever more than one,  
the default behavior should be geared toward the bigger audience.


>
>
>>
>> I'll make a pass today on JDK 1.2 (and JDK 1.3, JDK 1.4, JDK 1.5).
>> To get things proceeding since we seem to be going down this path,
>> I'll log a bug and attach a patch if I have something that I'm happy
>> with, but I will expect to commit the changes within a very short
>> window (maybe an hour) after submitting the bug.
>>
>
> I'm glad someone else is looking at this too.  But what is the rush  
> here?
> Are you talking about the main branch or the 1.2 branch?


I would be talking about the v1_2-branch.

I had not committed the changes to LoggingReceiver.java but only  
described the issue and submitted the patch to the list, since it  
wasn't clear that there was a strong desire to follow through on the  
issue.  At this point, it seems the consensus is that we intend to  
address the issue and we work most effectively and are open to the  
most effective review when we iterate on the CVS.

At this point, I think we have the following issues out:

1. o.a.l.chainsaw.LoggingReceiver.java does not compile with javac  
from JDK 1.1 and 1.2.
2. log4j does not compile with jikes due to the @deprecated on  
org.apache.log4j.spi.LoggerRepository.
3. Unit tests fail quickly on JDK 1.1 and 1.2.
4. Missing docs bug 36213:  http://issues.apache.org/bugzilla/ 
show_bug.cgi?id=36213
5. Stack trace dependent tests fail on JDK 1.1 and JDK 1.2
6. Serialization comparison tests fail on JDK 1.1 and 1.2.
7. Possibly other more serious tests fail on JDK 1.1 and JDK 1.2 but  
aren't noticed due to 5 and 6.
8. jmxCheck needs to be tweaked for JDK 1.1 and JDK 1.2.


The first three were addressed by my proposal in http:// 
marc.theaimsgroup.com/?l=log4j-dev&m=112416890503418&w=2 and the  
first independently by Mark.  It isn't absolutely essential to  
address the second issue for the distribution since we are apparently  
not using jikes for the release, but still the change is only a  
javadoc and compiling under jikes is a good thing.  The third item at  
least allows us to scope the types of test failures under JDK 1.1 and  
1.2 by allowing  the default halt-on-failure behavior to be overridden.

I haven't had a chance to investigate 4 and the removal of the LF5  
help may have been intentional, but the wrong-case names in links  
should be addressed.

The unit tests aren't part of the distribution, so if there is an  
easy way to fix 5 or 6, I think they should go in so we can see if  
there is anything in 7.





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


RE: 1.2.12 Experimental Build

Posted by Mark Womack <wo...@adobe.com>.
Comments below.

> -----Original Message-----
> From: Curt Arnold [mailto:carnold@apache.org]
> Sent: Thursday, August 18, 2005 9:09 AM
> To: Log4J Developers List
> Subject: Re: 1.2.12 Experimental Build
> 
> 
> On Aug 18, 2005, at 1:31 AM, Mark Womack wrote:
> 
> > I got a chance to play with the 1.2 build tonight.  Here is what I
> > did:
> >
> > 1) Isolated the build jdk from the Ant runtime jdk.
> >
> > Basically, I added the following attributes to all of the javac tasks:
> >
> >           fork="yes"
> >           includeAntRuntime="no"
> >           includeJavaRuntime="no"
> >           compiler="${compiler.version}"
> >           executable="${compiler.executable}"
> >
> > I did not set the bootclasspath as it did not seem to be required.
> >
> > I defined the following new properties to be used in the attributes:
> >
> > compiler.version=javac1.1
> > compiler.executable=../../../java/jdk1.2.2/bin/javac
> 
> "compiler.version" does the same thing as the built-in and documented
> "build.compiler" property in Ant.  Plus, the name is a little
> mismatched since it generally selects a compiler family (classic,
> modern, jikes, gcj) and not a particular version.  javac1.1 is, I
> believe, only there for compatibility with earlier Ant and is an
> synonym for classic.
> 
> There isn't an equivalent build-in property for the executable.  If
> it is not specified, then Ant attempts to locate the appropriate
> compiler.  By explicitly setting the executable attribute, you are
> defeating Ant's default behavior which may cause end users to have to
> figure out where there javac, jikes, etc is loaded and explicitly
> specify it.
> 
> includeJavaRuntime's default value is false.  I'd suggest
> establishing the existing default values:
> 
>             <!--  default values, to override specify on command line
> or in build.properties   -->
>              <property name="build.compiler.fork" value="false"/>
>              <property name="build.compiler.includeAntRuntime"
> value="true"/>
> 
> and on the javac using:
> 
> >           fork="${build.compiler.fork}"
> >           includeAntRuntime="${build.compiler.includeAntRuntime}"
> 
> 
> You will have to use the path to ensure that the proper "javac" is
> used, otherwise you make things more complicated for end-users to
> build log4j on their system.  With this mod, unless you explicitly
> change one of the properties, the build behavior is equivalent to the
> previous behavior.

I shied away from using/setting the Ant properties and defaults on purpose.
If someone picks up the source and wants to build it themselves in some
semblance of the "official" method, then I don't want them to need to be
aware of what the defaults are where and when.  We have explicitly set what
we want the values to be.  I'm open to doing it a different way, but I want
it very well documented and the defaults we want require no modification of
build files or properties.

As far as executable, yes, the determined user is going to need to know
where their 1.2 javac is located.  I don't know/see how Ant is going to
figure that out for them and they should not be required to run Ant under
jdk 1.2 just to compile log4j.  We could create a task to define that
property (based on JAVA_HOME) if it is not defined.

includeAntRuntime was explicitly set to "no" because I DO NOT WANT to
include it anymore.  I want to explicitly isolate our compilation classpath
from whatever might be in your/mine Ant environment.  We have defined the
exact set of jars (at least the types if not the exact jars) we are
expecting to compile with (compiler.classpath), no more, no less.  I don't
want anything else to interfere or be the cause of strange, build related
stuff.  Especially since we are targeting an earlier compiler.

> Adding the pathelement is okay. If xml-apis.jar doesn't exist, then
> it will fall back on the previous behavior.

It is required if we do not include the ant runtime, which we are not.

> > 3) Added a new jar that has the jndi related classes.
> >
> > Because I was now compiling with jdk 1.2, the jndi related classes
> > were not available (?).  So, I added a new property to include the
> > j2ee.jar, and grabbed the 1.2 j2ee download:
> >
> > j2ee.jar=../../../java/j2sdkee1.2.1/lib/j2ee.jar
> >
> > and added it to the compile.classpath:
> >
> >    <pathelement location="${j2ee.jar}"/>
> >
> 
> Yoav suggested: http://java.sun.com/products/jndi/downloads/
> index.html, click on the
> "Download JNDI 1.2.1" link when I encountered the issue.

Probably a better alternative to the entire j2ee.jar.  I will grab it
tonight.  I overlooked Yoav's email.  I was pretty focused on the build.xml
last night.  :-)

> 
> > 4) After all of that, I found a problem with the jmxCheck target.
> > The class "com.sun.jdmk.comm.HtmlAdaptorServer" was not in my
> > jmx.jar, but in my jmx-extra.jar.  The check that is there would
> > never have worked on my machine, as far as I can tell.  I need to
> > go back and see if the log4j jmx related classes are there.  Maybe
> > the class ended up being found in the Ant or JDK runtime
> > previously.  But I modified the check to include the jmx-extra.jar
> > in the classpath when it checks for availabily:
> >
> >            <available classname="com.sun.jdmk.comm.HtmlAdaptorServer">
> >                <classpath>
> >                 <pathelement location="${jmx.jar}"/>
> >                 <pathelement location="${jmx-extra.jar}"/>
> >                </classpath>
> >            </available>
> >
> > Why we are checking for that specific implementation class, I don't
> > know, but going with it for now.
> >
> 
> I added that check in http://issues.apache.org/bugzilla/show_bug.cgi?
> id=35831.  That particular class is used in log4j, but isn't in the
> JMX built into JDK 1.5.  On JDK 1.5 without the HTMLAdaptorServer
> check, it would sail past the check since all the other classes are
> present and fail to compile org.apache.log4j.jmx.Agent.java.  I'll
> see if I can tweak this so it works for both JDK 1.2 and JDK 1.5.

Yeah, there should be some other way to do this.  I'm not too worried about
it right now, but we should look at it closer in v1.3.

> 
> > 5) I had to change mModel and mSvrSock member variables in
> > o.a.l.chainsaw.LoggingReceiver.java to non-final.  With the 1.2.2
> > javac there were errors around them never being set in an
> > initializer or constructor.  I tried creating a private empty
> > constructor to fix it (as the one declared constructor does set
> > them), but it still complained.
> >
> 
> I had identified the issue and submitted a patch for consideration to
> the list in http://marc.theaimsgroup.com/?l=log4j-
> dev&m=112416890503418&w=2.  It is a well known bug in the JDK 1.1 and
> JDK 1.2 javac compilers.

I figured.  I had run into it before.  I'll look at your patch tonight.

> 
> 
> > So, with all of that, EVERYTHING COMPILES AS BEFORE.  I built a new
> > experimental version and put it at:
> >
> > http://people.apache.org/~mwomack/experimental/logging-
> > log4j-1.2.12rcTEST.jdk1.2.zip
> >
> > I have not had a chance to run the unit tests against this jar.  If
> > someone can get a chance before me, great.  Otherwise I will pick
> > it up again tomorrow evening.
> >
> 
> Quite a few will fail against earlier JVM's which was the reason that
> I also patched tests/build.xml so that you could optionally continue
> after the first error.  The tests that failed due to the changes in
> the stack traces in JDK 1.5 also fail with the stack traces in JDK
> 1.1 and 1.2.  Some serialization tests that checked a serialization
> against a witness file also failed.  I believe this occurs in tests
> that contain an exception and the exception serialization has been
> extended in an upward compatible manner.  This would suggest that you
> would not be able to have a Chainsaw running on JDK 1.2 handle
> messages with exceptions from an app running a later JVM.

Did you get a chance to test the jar I created?  Does it get the non-fatal
JIT error?  That is the one I care about at the moment.
 
> 
> > None of these changes in and of themselves are that big.  In fact,
> > I think the better isolation gives us much more control over what
> > is compiled against.
> >
> > I have not checked in the changes yet since I want to make sure
> > they actually have a positive effect.  If so, I can further
> > experiment with using the JDK 1.3 compiler.  I started looking at
> > using the 1.1 compiler, but it starts to throw even more issues.
> > It might not be worth that effort if the jdk 1.2 compiler generates
> > compatible, non-warning throwing jars.
> 
> 
> The changes that you had suggested would have changed the behavior
> for end-users who are trying to build log4j.  We should keep that
> experience unchanged while providing the control needed to produce a
> clean production build.

I don't agree.  The goal is to create a release jar that is compatible with
jdk 1.1.  That is the contract we sold for log4j 1.2.  I thought we had it
for 1.2.11, but apparently not as well as I thought.  If the build
process/settings have to change, then so be it.  We should document what has
changed, what needs to be done to successfully build, and move forward.

> 
> I'll make a pass today on JDK 1.2 (and JDK 1.3, JDK 1.4, JDK 1.5).
> To get things proceeding since we seem to be going down this path,
> I'll log a bug and attach a patch if I have something that I'm happy
> with, but I will expect to commit the changes within a very short
> window (maybe an hour) after submitting the bug.

I'm glad someone else is looking at this too.  But what is the rush here?
Are you talking about the main branch or the 1.2 branch?

Thanks,
-Mark


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


Re: 1.2.12 Experimental Build

Posted by Curt Arnold <ca...@apache.org>.
On Aug 18, 2005, at 1:31 AM, Mark Womack wrote:

> I got a chance to play with the 1.2 build tonight.  Here is what I  
> did:
>
> 1) Isolated the build jdk from the Ant runtime jdk.
>
> Basically, I added the following attributes to all of the javac tasks:
>
>           fork="yes"
>           includeAntRuntime="no"
>           includeJavaRuntime="no"
>           compiler="${compiler.version}"
>           executable="${compiler.executable}"
>
> I did not set the bootclasspath as it did not seem to be required.
>
> I defined the following new properties to be used in the attributes:
>
> compiler.version=javac1.1
> compiler.executable=../../../java/jdk1.2.2/bin/javac

"compiler.version" does the same thing as the built-in and documented  
"build.compiler" property in Ant.  Plus, the name is a little  
mismatched since it generally selects a compiler family (classic,  
modern, jikes, gcj) and not a particular version.  javac1.1 is, I  
believe, only there for compatibility with earlier Ant and is an  
synonym for classic.

There isn't an equivalent build-in property for the executable.  If  
it is not specified, then Ant attempts to locate the appropriate  
compiler.  By explicitly setting the executable attribute, you are  
defeating Ant's default behavior which may cause end users to have to  
figure out where there javac, jikes, etc is loaded and explicitly  
specify it.

includeJavaRuntime's default value is false.  I'd suggest  
establishing the existing default values:

            <!--  default values, to override specify on command line  
or in build.properties   -->
             <property name="build.compiler.fork" value="false"/>
             <property name="build.compiler.includeAntRuntime"  
value="true"/>

and on the javac using:

>           fork="${build.compiler.fork}"
>           includeAntRuntime="${build.compiler.includeAntRuntime}"


You will have to use the path to ensure that the proper "javac" is  
used, otherwise you make things more complicated for end-users to  
build log4j on their system.  With this mod, unless you explicitly  
change one of the properties, the build behavior is equivalent to the  
previous behavior.

> I also changed the javac target and source attributes to be "1.1".   
> The source attribute was set to "1.3".

Yep, the 1.3 was sloppy.

>
> Also, setting includeAntRuntime to "no" further isolated the build- 
> time classpath from anything coming from Ant that could "taint"  
> it.  Which led to item #2...
>
> 2) Explicitly include the xml-apis.jar in the compile.classpath.
>
> I defined a new property:
>
> xml-apis.jar=../../../code-opensource/apache-xml/xerces-2_6_2/xml- 
> apis.jar
>
> and added it to the compile.classpath:
>
>    <pathelement location="${xml-apis.jar}"/>

Adding the pathelement is okay. If xml-apis.jar doesn't exist, then  
it will fall back on the previous behavior.



>
> 3) Added a new jar that has the jndi related classes.
>
> Because I was now compiling with jdk 1.2, the jndi related classes  
> were not available (?).  So, I added a new property to include the  
> j2ee.jar, and grabbed the 1.2 j2ee download:
>
> j2ee.jar=../../../java/j2sdkee1.2.1/lib/j2ee.jar
>
> and added it to the compile.classpath:
>
>    <pathelement location="${j2ee.jar}"/>
>

Yoav suggested: http://java.sun.com/products/jndi/downloads/ 
index.html, click on the
"Download JNDI 1.2.1" link when I encountered the issue.


> 4) After all of that, I found a problem with the jmxCheck target.   
> The class "com.sun.jdmk.comm.HtmlAdaptorServer" was not in my  
> jmx.jar, but in my jmx-extra.jar.  The check that is there would  
> never have worked on my machine, as far as I can tell.  I need to  
> go back and see if the log4j jmx related classes are there.  Maybe  
> the class ended up being found in the Ant or JDK runtime  
> previously.  But I modified the check to include the jmx-extra.jar  
> in the classpath when it checks for availabily:
>
>            <available classname="com.sun.jdmk.comm.HtmlAdaptorServer">
>                <classpath>
>                 <pathelement location="${jmx.jar}"/>
>                 <pathelement location="${jmx-extra.jar}"/>
>                </classpath>
>            </available>
>
> Why we are checking for that specific implementation class, I don't  
> know, but going with it for now.
>

I added that check in http://issues.apache.org/bugzilla/show_bug.cgi? 
id=35831.  That particular class is used in log4j, but isn't in the  
JMX built into JDK 1.5.  On JDK 1.5 without the HTMLAdaptorServer  
check, it would sail past the check since all the other classes are  
present and fail to compile org.apache.log4j.jmx.Agent.java.  I'll  
see if I can tweak this so it works for both JDK 1.2 and JDK 1.5.


> 5) I had to change mModel and mSvrSock member variables in  
> o.a.l.chainsaw.LoggingReceiver.java to non-final.  With the 1.2.2  
> javac there were errors around them never being set in an  
> initializer or constructor.  I tried creating a private empty  
> constructor to fix it (as the one declared constructor does set  
> them), but it still complained.
>

I had identified the issue and submitted a patch for consideration to  
the list in http://marc.theaimsgroup.com/?l=log4j- 
dev&m=112416890503418&w=2.  It is a well known bug in the JDK 1.1 and  
JDK 1.2 javac compilers.



> So, with all of that, EVERYTHING COMPILES AS BEFORE.  I built a new  
> experimental version and put it at:
>
> http://people.apache.org/~mwomack/experimental/logging- 
> log4j-1.2.12rcTEST.jdk1.2.zip
>
> I have not had a chance to run the unit tests against this jar.  If  
> someone can get a chance before me, great.  Otherwise I will pick  
> it up again tomorrow evening.
>

Quite a few will fail against earlier JVM's which was the reason that  
I also patched tests/build.xml so that you could optionally continue  
after the first error.  The tests that failed due to the changes in  
the stack traces in JDK 1.5 also fail with the stack traces in JDK  
1.1 and 1.2.  Some serialization tests that checked a serialization  
against a witness file also failed.  I believe this occurs in tests  
that contain an exception and the exception serialization has been  
extended in an upward compatible manner.  This would suggest that you  
would not be able to have a Chainsaw running on JDK 1.2 handle  
messages with exceptions from an app running a later JVM.



> None of these changes in and of themselves are that big.  In fact,  
> I think the better isolation gives us much more control over what  
> is compiled against.
>
> I have not checked in the changes yet since I want to make sure  
> they actually have a positive effect.  If so, I can further  
> experiment with using the JDK 1.3 compiler.  I started looking at  
> using the 1.1 compiler, but it starts to throw even more issues.   
> It might not be worth that effort if the jdk 1.2 compiler generates  
> compatible, non-warning throwing jars.


The changes that you had suggested would have changed the behavior  
for end-users who are trying to build log4j.  We should keep that  
experience unchanged while providing the control needed to produce a  
clean production build.

I'll make a pass today on JDK 1.2 (and JDK 1.3, JDK 1.4, JDK 1.5).   
To get things proceeding since we seem to be going down this path,  
I'll log a bug and attach a patch if I have something that I'm happy  
with, but I will expect to commit the changes within a very short  
window (maybe an hour) after submitting the bug.

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