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

Add a "gcc-include" parser

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • warnings-plugin
    • None
    • Platform: All, OS: All

    Description

      Hi,

      It might be interesting to add a "gcc-include" parser.
      I noticed that Emacs does have a "gcc-include" parser (visible from its
      "compilation-error-regexp-alist-alist" variable - highlights appearing in
      compilation mode), which differs from its own GNU parser, that why I suggest
      this enhancement.

      The current regexp pattern in Emacs is the following :
      "^(?:In file included| ) from (.)[0-9])(?|(,))?"

      From the example below :
      "
      In file included from /usr/include/c++/3.3/backward/warn.h:4,
      from /usr/include/c++/3.3/backward/iostream.h:31,
      from test_clt.cc:1:
      "
      ... Emacs will parse the two first line as "information" and the third line as
      an "error".

      If you think it's interesting to add this parser, the parsing could be
      Priority.LOW for the two fist line and Priority.HIGH for the third line, or
      whatever you think is better.

      Attachments

        Activity

          drulli Ulli Hafner added a comment -

          A patch would be nice, thanks. Feel free to define the severities in the way you
          like, I don't use GCC at all...

          drulli Ulli Hafner added a comment - A patch would be nice, thanks. Feel free to define the severities in the way you like, I don't use GCC at all...
          metavalon metavalon added a comment -

          Created an attachment (id=893)
          gcc-include parser patch

          metavalon metavalon added a comment - Created an attachment (id=893) gcc-include parser patch
          metavalon metavalon added a comment -

          Hi,

          The patch is in attachment. Feel free to apply it or not.
          This new parser (gcc-include) will only parse the third line of the example
          below and declare it as a warning (Priority.NORMAL) :
          "
          In file included from /usr/include/c++/3.3/backward/warn.h:4,
          from /usr/include/c++/3.3/backward/iostream.h:31,
          from test_clt.cc:1:
          "
          I finally decided not to parse the two first line (as Priority.LOW), even though
          I write the code and put it as commentaries.
          The goal of this parser is not obvious. I'd say it could help developers (GCC
          only) to identify files that include other files which have generated warnings
          or errors, thus making some warnings more priority to solve.

          metavalon metavalon added a comment - Hi, The patch is in attachment. Feel free to apply it or not. This new parser (gcc-include) will only parse the third line of the example below and declare it as a warning (Priority.NORMAL) : " In file included from /usr/include/c++/3.3/backward/warn.h:4, from /usr/include/c++/3.3/backward/iostream.h:31, from test_clt.cc:1: " I finally decided not to parse the two first line (as Priority.LOW), even though I write the code and put it as commentaries. The goal of this parser is not obvious. I'd say it could help developers (GCC only) to identify files that include other files which have generated warnings or errors, thus making some warnings more priority to solve.
          drulli Ulli Hafner added a comment -

          Thanks for the patch!

          drulli Ulli Hafner added a comment - Thanks for the patch!
          drulli Ulli Hafner added a comment -

          After applying the patch some GCC unit test are failing. Did you run the other
          tests, too?

          drulli Ulli Hafner added a comment - After applying the patch some GCC unit test are failing. Did you run the other tests, too?
          metavalon metavalon added a comment -

          Hi,

          I did run the other tests, but with previous version of the plugin, that's why
          maybe I didn't get test failure.

          Anyway, I made some code changes for the Gcc Parser in order to resolve issue4382.

          After that I applied the Gcc-include Parser patch I gave you, rebuilt the
          plugin, and no test failed, so it should be good.

          Tell me if it's not.

          metavalon metavalon added a comment - Hi, I did run the other tests, but with previous version of the plugin, that's why maybe I didn't get test failure. Anyway, I made some code changes for the Gcc Parser in order to resolve issue4382. After that I applied the Gcc-include Parser patch I gave you, rebuilt the plugin, and no test failed, so it should be good. Tell me if it's not.

          Code changed in hudson
          User: : drulli
          Path:
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/GccIncludeParser.java
          trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/GccIncludeParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/GccParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java
          trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java
          trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/all.txt
          trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc-include.txt
          http://fisheye4.cenqua.com/changelog/hudson/?cs=22099
          Log:
          [FIXED JENKINS-4383] Added a new parser for GCC include warnings.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : drulli Path: trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/GccIncludeParser.java trunk/hudson/plugins/warnings/src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/GccIncludeParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/GccParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java trunk/hudson/plugins/warnings/src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/all.txt trunk/hudson/plugins/warnings/src/test/resources/hudson/plugins/warnings/parser/gcc-include.txt http://fisheye4.cenqua.com/changelog/hudson/?cs=22099 Log: [FIXED JENKINS-4383] Added a new parser for GCC include warnings.

          People

            drulli Ulli Hafner
            metavalon metavalon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: