Configure SCM in the Coverity Plugin

511 views
Skip to first unread message

Shobha Dashottar

unread,
Jun 23, 2015, 11:22:21 PM6/23/15
to jenkins...@googlegroups.com
Hi Team,

   I have configured the Coverity plugin for our build. The cov commands are issues from the build script itself.  Coverity itself runs fine but I wanted to enhance further and selected the Source Control (SCM) option. I selected the perforce option and entered the P4PORT.

But, looks it needs something more. The build run throws this error

java.lang.NullPointerException
08:13:29 	at jenkins.plugins.coverity.ScmOptionBlock.checkScmConfig(ScmOptionBlock.java:73)
08:13:29 	at jenkins.plugins.coverity.CoverityLauncherDecorator.decorate(CoverityLauncherDecorator.java:104)
08:13:29 	at hudson.Launcher.decorateFor(Launcher.java:695)
08:13:29 	at hudson.model.Slave.createLauncher(Slave.java:374)
08:13:29 	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:564)
08:13:29 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:495)
08:13:29 	at hudson.model.Run.execute(Run.java:1744)
08:13:29 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
08:13:29 	at hudson.model.ResourceController.execute(ResourceController.java:98)
08:13:29 	at hudson.model.Executor.run(Executor.java:374)

Jenkins version : 1.612
Coverity Plugin version : 1.5.0
Coverity version 7.5.0
SCM : Perforce

I checked the line 73 in ScmOptionBlock.java of Coverity Plugin. It says
if(!version.compareToAnalysis(new CoverityVersion(7, 5, 0)) && this.scmSystem.equals("perforce2009")){


Any idea what is going wrong? I mainly wanted to see the defect trend on the job's main page.

Thanks
Shobha

Ginga, Dick

unread,
Jun 24, 2015, 7:31:09 AM6/24/15
to jenkins...@googlegroups.com

I have found that you need to add P4 to the “cov-build blacklist”. This tells Coverity to no wrap these calls.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e42dd99a-8792-427d-a141-0148eaab1d17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shobha Dashottar

unread,
Jul 28, 2015, 7:07:29 AM7/28/15
to Jenkins Users, Dick....@perkinelmer.com
Thanks .

I have now added p4 to the blacklist and it went ahead. But it fails further down the line on every single file.

MAKE SUCCESSFUL
13:28:48 + exit 0
13:28:48 [WARNING] 1313 C/C++ compilation units (85%) are ready for analysis
13:28:48  For more details, please look at:
13:28:48     /home/builder/COV_TEMP/idirs/<project_name>/build-log.txt
13:28:48 [Coverity] cmd so far is: [/home/builder/cov-analysis-linux64-7.5.0/bin/cov-import-scm, --dir, /home/builder/COV_TEMP/idirs/<project_name>, --scm, perforce]
13:28:48 $ /home/builder/cov-analysis-linux64-7.5.0/bin/cov-import-scm --dir /home/builder/COV_TEMP/idirs/<project_name> --scm perforce
13:28:49 Extracting SCM data for 4431 files...
13:28:50 User builder doesn't exist.
13:28:51 [WARNING] An error occurred while executing command at '/home/builder/jenkins/workspace/<project_name>/<subdir>......':
13:28:51 COMMAND: '/usr/bin/p4 filelog -t -i -h somesourcefile.c' failed. Error code 1. Proceeding...


This error is thrown for every single file. On executing the p4 filelog command locally, I get the correct results. Looks like the cov-import-scm command needs some more commandline arguments which I can give using the optional scm-tools or commands arguments but not sure what it wants :)

Thanks
Shobha

Ginga, Dick

unread,
Jul 28, 2015, 7:40:05 AM7/28/15
to Shobha Dashottar, Jenkins Users

I don’t use that option, but it looks like maybe Perforce does not have a user named Builder?

Shobha Dashottar

unread,
Jul 28, 2015, 7:56:07 AM7/28/15
to Jenkins Users, Dick....@perkinelmer.com
yes. Perforce does not have that user but it is just the system user "builder" doing the builds. Why is the Plugin getting this user anyways?


Ginga, Dick

unread,
Jul 28, 2015, 7:57:51 AM7/28/15
to Shobha Dashottar, Jenkins Users

I don’t know. I’m just guessing.

 

From: Shobha Dashottar [mailto:shobha.d...@gmail.com]
Sent: Tuesday, July 28, 2015 7:56 AM
To: Jenkins Users
Cc: Ginga, Dick
Subject: Re: Configure SCM in the Coverity Plugin

 

yes. Perforce does not have that user but it is just the system user "builder" doing the builds. Why is the Plugin getting this user anyways?


Image removed by sender.

Reply all
Reply to author
Forward
0 new messages