Erroneous compilation failure

Hi,

I'm getting erroneous compilation failure messages from teamcity for an ant build that completes successfully.  The problem started when I added a javac annotation process to my ant build script, the javac2 call looks like this:

<javac2 destdir="${preweave}"
                debug="on"
                encoding="utf-8"
                source="1.6"
                target="1.6"
                bootclasspathref="javac2.classpath">
            <classpath>
                <fileset dir="${ivy.jar.build}" includes="*.jar"/>
                <fileset dir="${ivy.jar.provided}" includes="*.jar"/>
            </classpath>
            <src path="${src}"/>
            <src path="${generated.src.dir}"/>
            <src path="${tools.dir}/migratetool"/>
            <src path="${common-framework-module.src}"/>
            <compilerarg value="-processor"/>
            <compilerarg value="com.mysema.query.apt.jpa.JPAAnnotationProcessor"/>
            <compilerarg value="-s"/>
            <compilerarg value="${generated.src.dir}"/>
        </javac2>



The problem is that the JPAAnnotationProcessor generates some classes that are referred to by other classes in the source tree and therefore during the initial compilation "round" of the annotation processor, javac reports errors.  However, these aren't really errors as the compilation completes successfully on a subsequence "round".

compile.basic:
[2011-07-21 18:47:06,640] out -    [javac2] C:\dev\TeamCity\BuildAgent2\work\9972e1254386badb\build.xml:213: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[2011-07-21 18:47:07,727] out -    [javac2] Compiling 3295 source files to C:\dev\TeamCity\BuildAgent2\work\9972e1254386badb\walrus-build\preweave
[2011-07-21 18:47:31,495] out -    [javac2] C:\dev\TeamCity\BuildAgent2\work\9972e1254386badb\src\com\walrus\model\dao\hibernate\UserDaoHibernateImpl.java:24: cannot find symbol
[2011-07-21 18:47:31,497] out -    [javac2] symbol  : class QUserImpl
[2011-07-21 18:47:31,498] out -    [javac2] location: package com.walrus.core.domain
[2011-07-21 18:47:31,499] out -    [javac2] import com.walrus.core.domain.QUserImpl;
[2011-07-21 18:47:31,500] out -    [javac2]                                 ^
[2011-07-21 18:47:31,501] out -    [javac2] C:\dev\TeamCity\BuildAgent2\work\9972e1254386badb\src\com\walrus\model\dao\hibernate\UserDaoHibernateImpl.java:44: cannot find symbol
[2011-07-21 18:47:31,502] out -    [javac2] symbol  : class QUserImpl
[2011-07-21 18:47:31,503] out -    [javac2] location: class com.walrus.model.dao.hibernate.UserDaoHibernateImpl
[2011-07-21 18:47:31,504] out -    [javac2]     private static final QUserImpl user = QUserImpl.userImpl;
[2011-07-21 18:47:31,504] out -    [javac2]                          ^
[2011-07-21 18:48:38,325] out -    [javac2] Note: Some input files use or override a deprecated API.
[2011-07-21 18:48:38,327] out -    [javac2] Note: Recompile with -Xlint:deprecation for details.
[2011-07-21 18:48:38,328] out -    [javac2] Note: Some input files use unchecked or unsafe operations.
[2011-07-21 18:48:38,329] out -    [javac2] Note: Recompile with -Xlint:unchecked for details.
[2011-07-21 18:48:38,330] out -    [javac2] Creating empty C:\dev\TeamCity\BuildAgent2\work\9972e1254386badb\walrus-build\preweave\com\walrus\message\package-info.class
[2011-07-21 18:48:40,891] out -    [javac2] Added @NotNull assertions to 3450 files


....

[2011-07-21 18:53:17,427] out - BUILD SUCCESSFUL
[2011-07-21 18:53:17,427] out - Total time: 6 minutes 50 seconds

The problem seems to be that teamcity thinks that these are real failures even though I have the feature "an error message is logged by build runner: OFF".

I've spent all day on this and I'm making no progress - does anybody know how to resolve this issue?

Regards,
Damien

4 comments
Comment actions Permalink

What runner do you use? Is it Ant or something else? If this is Ant, how it reacts to this error? Does it report it as error?

0
Comment actions Permalink

We are using the ant runner.  The teamcity-build.log on the agent has the following at the end of the build:

[2011-07-21 18:53:17,424] out - buildserver-commit:
[2011-07-21 18:53:17,427] out -
[2011-07-21 18:53:17,427] out - BUILD SUCCESSFUL
[2011-07-21 18:53:17,427] out - Total time: 6 minutes 50 seconds
[2011-07-21 18:53:17,549] err -
[2011-07-21 18:53:17,549] out -
[2011-07-21 18:53:17,549] err -
[2011-07-21 18:53:17,550] out - Process exited with code 0



So, the ant build seems to be happy that it completed successfully.  When I'm watching teamcity during the build, it appears to report the compilation failure before ant completes the javac task, therefore it looks like teamcity is watching the log and reporting the complication failure as a result of the errors that are reported by javac.

I should have also mentioned that we are using teamcity 6.0.2.

Regards,
Damien
0
Comment actions Permalink

Yes, TeamCity watches for specific messages in the output and if they are very similar to javac errors and are produced by javac task, TeamCity will treat them as compilation errors. Probably we need to be smarter here and report all of the errors at the end of the javac task. Could you please submit a bug report to our tracker?

0
Comment actions Permalink

Filed by Damien as TW-17764.

0

Please sign in to leave a comment.