Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20016

Build in Jenkins fails when gcc finds errors

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Not A Defect
    • core
    • S.O.: Ubuntu Server 11.04; GCC version: 4; Compiler Warning Plugin: version 4.35; Jenkins version: 1.480.3

    Description

      Hello people

      I'm trying to build a C project using Jenkins. This project has many source files (over 500), so I'm doing this step by step.

      What I'm trying to achieve is to get all the errors and warnings into a file, this file is useful, because after that I need these results for Jenkins "Compiler Warning Plugin".

      To get all the information I need I'm running the following command as a "Build Step":

      gcc -Wall path/to/my/source/files.c 2>report.xml

      After that, I have other configurations and build steps, but when I execute the build, it fails because of the error messages triggered by gcc. And the rest of the steps an other configurations are never executed.

      The thing is, if I execute the same gcc command, to the same files, but outside Jenkins, I mean in a typically Linux terminal, I don't receive any message about failure. The xml file with warnings and errors output is generated and the Linux terminal finish the task without complaint

      How can I achieve the same behavior in Jenkins and not receive a build failure message? Thanks!

      Attachments

        Activity

          drulli Ulli Hafner added a comment -

          Or do you want to show the warnings even if there are errors? Then you can activate the run on failed checkbox in the configuration of the plug-in.

          drulli Ulli Hafner added a comment - Or do you want to show the warnings even if there are errors? Then you can activate the run on failed checkbox in the configuration of the plug-in.
          drulli Ulli Hafner added a comment -

          Is that the reason for the failure?

          fuentes/bsancomp/aux1.c:21:20: fatal error: deftra.h: No such file or directory
          compilation terminated.
          

          You need to ensure that your shell script is terminated with a success status!

          See http://www.linuxnix.com/2011/03/find-exit-status-script-command-linux.html

          drulli Ulli Hafner added a comment - Is that the reason for the failure? fuentes/bsancomp/aux1.c:21:20: fatal error: deftra.h: No such file or directory compilation terminated. You need to ensure that your shell script is terminated with a success status! See http://www.linuxnix.com/2011/03/find-exit-status-script-command-linux.html

          Ok, console log attached.

          Thanks!!

          acordinz Angelo Cordova added a comment - Ok, console log attached. Thanks!!
          drulli Ulli Hafner added a comment -

          Please attach the console log so we can see why the build fails.

          drulli Ulli Hafner added a comment - Please attach the console log so we can see why the build fails.

          People

            Unassigned Unassigned
            acordinz Angelo Cordova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: