[JIRA] (JENKINS-52864) Cppcheck plugin fails to resolve files in details view

194 views
Skip to first unread message

ch.ehrlicher@gmx.de (JIRA)

unread,
Aug 3, 2018, 2:11:02 AM8/3/18
to jenkinsc...@googlegroups.com
Christian Ehrlicher created an issue
 
Jenkins / Bug JENKINS-52864
Cppcheck plugin fails to resolve files in details view
Issue Type: Bug Bug
Assignee: Marco Steffan
Components: cppcheck-plugin
Created: 2018-08-03 06:10
Priority: Critical Critical
Reporter: Christian Ehrlicher

In the cppcheck details view it is no longer possible to click on a file to show the source code. Switching back to 1.21 fixes the problem (also with the data generated with 1.23) so I assume the lookup code is somehow screwed up.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

aricio.joi.junior@gmail.com (JIRA)

unread,
Aug 4, 2018, 2:30:03 PM8/4/18
to jenkinsc...@googlegroups.com
Aricio Joi Junior commented on Bug JENKINS-52864
 
Re: Cppcheck plugin fails to resolve files in details view

I have some issues with cppcheck plugin when my job run in a slave node. Apparently, cppcheck store the full path off the source file based on the file system in the slave node, but the plugin runs on master node. Also I wish to use pipeline. I find a very simple work around that works with pipeline and slave node:

1) run the cppcheck

2) use https://github.com/danmar/cppcheck/tree/master/htmlreport to build html results 

3) publish html on jenkins with Html Publish Plugin

Example:

cppcheck.exe .\ --force --xml-version=2 -q 2> cppcheck-result.xml
python cppcheck-htmlreport --file=cppcheck-result.xml --title=Embedded --report-dir=.\cppcheckResult --report-dir=.\ --source-encoding="iso8859-1"

The disadvantage for this approach is :

  • missing the tables, trend and graphical as result from the build
  • use of space in master node, once the target source files with errors will be stored on it.

reference: https://dunterov.github.io/cppcheck/

 

michaelp@bsquare.com (JIRA)

unread,
Nov 1, 2018, 10:59:02 AM11/1/18
to jenkinsc...@googlegroups.com

Seeing the same thing on my setup (again since 1.21). Based on the error output it the plugin seems to be assuming that the workspaces paths are the same on the build slave as on the master. This isn't true in our setup as the build slave does not have access to the master filesystem at all.

 

However jenkins itself seems to have no problem displaying the workspace through the workspace link.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

michaelp@bsquare.com (JIRA)

unread,
Jan 2, 2019, 12:20:03 PM1/2/19
to jenkinsc...@googlegroups.com

While doing some jenkins updates I've now dug into this a little more deeply and I can now see exactly why the files are not being displayed. If I go to one of the summary view panes e.g.( cppcheckResult/source.all) I get an error like:

Can't read file: /var/jenkins_home/jobs/<job-directory>/jobs/<jobname>/workspace-files/ed57db50.tmp

However if I go and look at the jenkins_home on the masterI can see that the path should actually be:{{}}

/var/jenkins_home/jobs/<job-directory>/jobs/<jobname>/builds/<build-number>/workspace-files/ed57db50.tmp{{}}

}}So it just looks like the plugin is generating the wrong filesystem path( its missing the {{builds/<buildnumber> bit) and it has nothing to do with the difference in FS path between the jenkins master and the build slave as I get the same issue even if I make cppcheck produce workspace root relative paths for its errors using:

{{ }}-rp=$WORKSPACE

In the cppcheck command line arguments.

{{}}

michaelp@bsquare.com (JIRA)

unread,
Jan 2, 2019, 12:20:04 PM1/2/19
to jenkinsc...@googlegroups.com
Mike Pumford edited a comment on Bug JENKINS-52864

michaelp@bsquare.com (JIRA)

unread,
Jan 2, 2019, 12:21:03 PM1/2/19
to jenkinsc...@googlegroups.com

michaelp@bsquare.com (JIRA)

unread,
Jan 2, 2019, 12:21:04 PM1/2/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages