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

Coverity plugin insert cov-build commands into perforce workspace causing P4 to fail

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • coverity-plugin

      While Not using Coverity Plugin:
      Building in workspace C:\Program Files (x86)\Jenkins\jobs\Demo\workspace
      Using master perforce client: coverity_demo_win
      [workspace] $ "C:\Program Files\Perforce\p4.exe" -P 2724A1B5872D6C885C36A8633DEEEE3A workspace -o coverity_demo_win
      'Don't update client' is set. Not saving the client changes.
      Note: .repository directory in workspace (if exists) is skipped during clean.
      Quickly cleaning workspace...
      .
      .
      .
      .
      Build succeeded.
      .
      .
      .
      .
      Time Elapsed 00:01:28.86

      While Using Coverity Plugin:
      Building in workspace C:\Program Files (x86)\Jenkins\jobs\Demo\workspace
      Using master perforce client: coverity_demo_Win
      [workspace] $ "C:\Program Files\Coverity\Coverity Static Analysis\bin\cov-build" --dir C:\Demo\coverity --instrument --encoding UTF-8 --enable-pch C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\demo\win32\vc10\demotest.sln /p:configuration=Release /p:platform=x64 /nr:false "C:\Program Files\Perforce\p4.exe" workspace -o coverity_demo_win

          • Perforce client workspace 'coverity_demo_win' doesn't exist.
          • Please create it, or allow Jenkins to manage clients on it's own.
          • If the client name mentioned above is not what you expected,
          • check your 'Client name format for slaves' advanced config option.
            ERROR: Error accessing perforce workspace.
            Finished: FAILURE

      Please note workspace "coverity_demo_win" does exist.
      The error occur while coverity plugin is enable.
      When Coverity plugin is disable Perforce were able to sync & build without any issue.

      Coverity plugin interfere with perforce commands.

          [JENKINS-16797] Coverity plugin insert cov-build commands into perforce workspace causing P4 to fail

          I can confirm this misbehavior on Linux (RH4.8) with

          • Jenkins ver. 1.513
          • Coverity plugin: 1.2.0
          • Perforce plugin 1.3.21

          In our case it is not only a bug, it is a showstopper.

          Log output:

          Using master perforce client: <client_name>
          [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 workspace -o <client_name>

          Saving modified client <client_name>
          [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 -s client -i
          Last build changeset: 2617584
          [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 changes -s submitted -m 1 //<client_name>/...
          FATAL: null
          java.util.NoSuchElementException
          at java.util.StringTokenizer.nextToken(Unknown Source)
          at com.tek42.perforce.parse.AbstractPerforceTemplate.parseList(AbstractPerforceTemplate.java:105)
          at com.tek42.perforce.parse.Changes.getChangeNumbers(Changes.java:186)
          at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:892)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1369)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
          at hudson.model.Run.execute(Run.java:1575)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)

          Guenther Heinz added a comment - I can confirm this misbehavior on Linux (RH4.8) with Jenkins ver. 1.513 Coverity plugin: 1.2.0 Perforce plugin 1.3.21 In our case it is not only a bug, it is a showstopper. Log output: Using master perforce client: <client_name> [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 workspace -o <client_name> Saving modified client <client_name> [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 -s client -i Last build changeset: 2617584 [workspace] $ /depot/coverity/cov-sa-linux64-6.5.0/bin/cov-build --dir intermediate/PD /SCRATCH/pd_buildloops/Perforce/p4 changes -s submitted -m 1 //<client_name>/... FATAL: null java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(Unknown Source) at com.tek42.perforce.parse.AbstractPerforceTemplate.parseList(AbstractPerforceTemplate.java:105) at com.tek42.perforce.parse.Changes.getChangeNumbers(Changes.java:186) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:892) at hudson.model.AbstractProject.checkout(AbstractProject.java:1369) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) at hudson.model.Run.execute(Run.java:1575) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237)

          This issue is also present with the latest Coverity plugin 1.2.5.

          Albin Prathapan added a comment - This issue is also present with the latest Coverity plugin 1.2.5.

          Caleb Mayeux added a comment -

          I know this bug is three years old, but ran into this myself, and wanted to update for those who still might run into it.

          It's not really a defect - it's a configuration issue. By default coverity wraps all the commands, but there's a field, "cov-build blacklist", where you put a comma-delimited list of commands that shouldn't be wrapped. Thus, the proper configuration where this will work is to put the path to your p4 executable in that field, something like: /auto/perforce/p4bin/current/p4. Then you can checkout without issue.

          Also you can use the newer P4 Jenkins plugin (as opposed to the Perforce Plugin) that's supported by perforce itself, and it doesn't require this configuration.

          Hope this helps.

          Caleb Mayeux added a comment - I know this bug is three years old, but ran into this myself, and wanted to update for those who still might run into it. It's not really a defect - it's a configuration issue. By default coverity wraps all the commands, but there's a field, "cov-build blacklist", where you put a comma-delimited list of commands that shouldn't be wrapped. Thus, the proper configuration where this will work is to put the path to your p4 executable in that field, something like: /auto/perforce/p4bin/current/p4. Then you can checkout without issue. Also you can use the newer P4 Jenkins plugin (as opposed to the Perforce Plugin) that's supported by perforce itself, and it doesn't require this configuration. Hope this helps.

            Unassigned Unassigned
            cyliew Chung Yee Liew
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: