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

Warnings Plugin MSBuild parser wrong parse msbuild15 warnings output

    • 5.0.0 (analysis-model and warnings-ng)

       In log i have  lines like this:

      17:4>Filters\FilterBuilder.cs(229,34): warning CS0168
      

      As a result, i see «... java.io.IOException: Failed to copy d:/workspace/ .../Filters/17:4>Filters/FilterBuilder.cs ...»,message when I try to see the warning.

      This leads to a constant emergence false-new warnings (because of changed path).

      Pipeline command used to build:

      bat """"${tool 'msbuild 15'}\\msbuild.exe" ${params.Solution} /p:TargetFrameworkVersion=v4.5;Configuration=Debug /p:DebugType=Full /consoleloggerparameters:ErrorsOnly;NoSummary /t:Build /m"""
      

          [JENKINS-48647] Warnings Plugin MSBuild parser wrong parse msbuild15 warnings output

          Ulli Hafner added a comment -

          Is this the exact log message? What does the 17:4 stand for? Is there no absolute path possible?

          Ulli Hafner added a comment - Is this the exact log message? What does the 17:4 stand for? Is there no absolute path possible?

          C Z added a comment - - edited

          This is begin of log line in actual warning log. Text after "warning CS0168" just skipped.

          17:4>Filters\FilterBuilder.cs(229,34): warning CS0168 

          What does the 17:4 stand for?

          I don't know? May be it about multi threaded build. Every line in warnings log starts with \s+\d+> or \s+d+:\d+>. For example:

            17:4>SqlConverter.cs(87,38): _skipped_
               6>Tools\..._skipped_

          Is there no absolute path possible?

          There is no problem with absolute or relative path. Just about extra characters in path. In jenkins message:

           

          Failed to copy d:/workspace/ .../Filters/17:4>Filters/FilterBuilder.cs

           only "17:4>" part is wrong. Thus, it seems that the parser falsely interprets service information (17:2>) as part of path. "     6>" lines parsed correctly.

          C Z added a comment - - edited This is begin of log line in actual warning log. Text after "warning CS0168" just skipped. 17:4>Filters\FilterBuilder.cs(229,34): warning CS0168  What does the 17:4 stand for? I don't know? May be it about multi threaded build. Every line in warnings log starts with \s+\d+> or \s+d+:\d+> . For example: 17:4>SqlConverter.cs(87,38): _skipped_ 6>Tools\..._skipped_ Is there no absolute path possible? There is no problem with absolute or relative path. Just about extra characters in path. In jenkins message:   Failed to copy d:/workspace/ .../Filters/17:4>Filters/FilterBuilder.cs  only "17:4>" part is wrong. Thus, it seems that the parser falsely interprets service information (17:2>) as part of path. "     6>" lines parsed correctly.

          Ulli Hafner added a comment -

          Is the 17:4 coming from the MS build tool or from Jenkins?

          Ulli Hafner added a comment - Is the 17:4 coming from the MS build tool or from Jenkins?

          C Z added a comment -

          17:4> coming from msbuild.

          C Z added a comment - 17:4> coming from msbuild.

          Ulli Hafner added a comment - - edited

          Ok, to sum up: the current regular expression needs to be improved so that absolute paths like C:\Path\File are detected and Logging Prefixes like 17:4> are removed from the path. I think we can improve the drive detection pattern to be something like [A-Z]:\

          Ulli Hafner added a comment - - edited Ok, to sum up: the current regular expression needs to be improved so that absolute paths like C:\Path\File are detected and Logging Prefixes like 17:4> are removed from the path. I think we can improve the drive detection pattern to be something like [A-Z] :\

          C Z added a comment -

          Like that.
          Looks like this bug related to JENKINS-6709.

          C Z added a comment - Like that. Looks like this bug related to JENKINS-6709 .

          C Z added a comment -

          I think we can improve the drive detection pattern to be something like [A-Z]:\

          or fix prefix part ([^\>]+\>)(path_pattern).

          Just in case I remind that this prefix i see with relative paths in msbuild log. 

          C Z added a comment - I think we can improve the drive detection pattern to be something like  [A-Z] :\ or fix prefix part ( [^\>] +\>)(path_pattern). Just in case I remind that this prefix i see with relative paths in msbuild log. 

          C Z added a comment - - edited

          in MsBuildParser.java

          private static final String MS_BUILD_WARNING_PATTERN = "(?:^(?:.*)Command line warning ([A-Za-z0-9]+):\\s*(.*)\\s*\\[(.*)\\])|"
          + ANT_TASK + "(?:(?:\\s*\\d+>)?(?:(?:(?:(.*)\\((\\d*)(?:,(\\d+))?.*\\)|.*LINK)\\s*:|(.*):)\\s*([A-z-_]*\\s?(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))\\s*:?\\s*([A-Za-z0-9]+)\\s*:\\s(?:\\s*([A-Za-z0-9.]+)\\s*:)?\\s*(.*?)(?: \\[([^\\]]*)[/\\\\][^\\]\\\\]+\\])?"
          + "|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*)))$";
          

          this part 

          (?:\\s*\\d+>)

          maybe need to change to (?:s*[^>]+>)

          or 

          "(?:\\s*(?:\\d+|\\d+:\\d+)>)"
          

          C Z added a comment - - edited in  MsBuildParser.java private static final String MS_BUILD_WARNING_PATTERN = "(?:^(?:.*)Command line warning ([A-Za-z0-9]+):\\s*(.*)\\s*\\[(.*)\\])|" + ANT_TASK + "(?:(?:\\s*\\d+>)?(?:(?:(?:(.*)\\((\\d*)(?:,(\\d+))?.*\\)|.*LINK)\\s*:|(.*):)\\s*([A-z-_]*\\s?(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))\\s*:?\\s*([A-Za-z0-9]+)\\s*:\\s(?:\\s*([A-Za-z0-9.]+)\\s*:)?\\s*(.*?)(?: \\[([^\\]]*)[/\\\\][^\\]\\\\]+\\])?" + "|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*)))$" ; this part  (?:\\s*\\d+>) maybe need to change to (?:s* [^>] +>) or  "(?:\\s*(?:\\d+|\\d+:\\d+)>)"

            hobbyte Raphael Furch
            upas C Z
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: