Is there a way to get TeamCity to recognise GCC compilation errors?

I would like TeamCity to highlight any warnings logged by the compiler. I found another thread on this forum that explained how this can be done for MSBuild. Is there a way to do this for a GCC build?

6 comments
Comment actions Permalink

Hi Ben

If your simply wanting TeamCity to mark the build as failed when you get GCC warning then to my way of thinking there are two solutions


1/ Teamcity build configuration step 4  has an option for you to specify the build failure text to look for.  Set that to match your warning text and your done.
2/  My prefered option is that if warning are treated  as failures then why not set  the GCC  compiler option to flag warnings as failures. Ie.  use  -Werror.


Stewart

0
Comment actions Permalink

Thanks Stewy, I want TeamCity to actually list and count compiler warnings/errors. It already fails the build if compilation fails. TeamCity supports this concept through service messages, but you need to get translate GCC format messages into TeamCity format messages somehow.

0
Comment actions Permalink

In that case does not build log -> important messages do that for you?

Does not give a count but certainly lists the compiler  error/warning messages.

0
Comment actions Permalink

stewy, GCC warning/error messages are not automatically recognised by TeamCity, so they do not appear in "important messages". Indeed, having them appear there is exactly the result I'm after.

0
Comment actions Permalink

We are building an embedded  Linux and Linux application applications in our system.
This is using gcc running in a Linux VM

Our build server is running on a windows VM  with a Linux agent run the Linux VM.
TeamCity version is 7.1.2
The builds are launched from within a Team city build step as a command line build,  using standard Linux script files.

When I look in the important messages I typically see messages like this

[10:03:58][Step 2/6] arch/powerpc/sysdev/optiscan/fpga_access.c:108: warning: passing argument 1 of 'down_interruptible' discards qualifiers from pointer target type

[10:03:58][Step 2/6] arch/powerpc/sysdev/optiscan/fpga_access.c:111: warning: passing argument 1 of 'up' discards qualifiers from pointer target type





So not sure what you are doing different.
Are you running gcc on  windows ?

When you run your build manually do you get the warnings on your console ?





0
Comment actions Permalink

Well that's interesting! Perhaps the difference in my case is that I'm running GCC from within NANT, so I get each line prepended with "[exec]" in the log. That might be tripping up TeamCity. I'll see if I can tell NANT *not* to add that prefix and see what that does. Thanks for the help!

0

Please sign in to leave a comment.