You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by mp...@ThoughtWorks.com on 2000/08/07 04:59:17 UTC

do we still need JikesOutputParser?

I recently started getting this error when using jikes 1.12:

Assertion failed: false && "Cannot compute system time stamp\n", file
../../../jikes-1.12/src/lookup.cpp, line 284

I have no idea what it means, but it always gets written to stderr, not
stdout, even if the -Xstdout flag is set. The JikesOutputParser class only
reads from stdout, however, so the jikes process never finishes, and ant
hangs as a result. Even worse, if I kill the jikes process, the
JikesOutputParser thinks everything is ok, since no errors were printed,
and ant continues building.

I guess my question is, why are we trying to parse the output stream from
jikes to determine if there were errors, instead of simply checking the
exit code from the jikes process? The patch below  uses the default
StreamHandler and checks the jikes exit code, and doesn't use
JikesOutputParser at all. It seems to work ok...

Matt Foemmel
ThoughtWorks, Inc.

Index: Jikes.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jikes.java,v
retrieving revision 1.5
diff -u -r1.5 Jikes.java
--- Jikes.java 2000/08/04 14:58:42 1.5
+++ Jikes.java 2000/08/06 23:49:46
@@ -67,17 +67,20 @@
                 commandArray[0] = command;
                 System.arraycopy(args,0,commandArray,1,args.length);
             }
-
+
             // We assume, that everything jikes writes goes to
             // standard output, not to standard error. The option
             // -Xstdout that is given to Jikes in Javac.doJikesCompile()
             // should guarantee this. At least I hope so. :)
             try {
-                Execute exe = new Execute(jop);
+                Execute exe = new Execute();
                 exe.setAntRun(project);
                 exe.setWorkingDirectory(project.getBaseDir());
                 exe.setCommandline(commandArray);
                 exe.execute();
+                if (exe.getExitValue() != 0) {
+                    throw new BuildException("Compile failed");
+                }
             } catch (IOException e) {
                 throw new BuildException("Error running Jikes compiler",
e);
             }


Re: do we still need JikesOutputParser?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "mf" == mpfoemme  <mp...@ThoughtWorks.com> writes:

 mf> I guess my question is, why are we trying to parse the output
 mf> stream from jikes to determine if there were errors, instead of
 mf> simply checking the exit code from the jikes process? 

I've just modified Jikes to use the Execute class last Friday, I
didn't have the time to go all the way converting it (and Javac) to
use some of the newer stuff then, this should happen today (and I'm
going to use something along the lines of your patch within).

Stefan