Can't get Coverity Scan to work (Java / Kotlin / Gradle 3.3 on Windows and Travis)

UPDATE: see solution in Caleb's answer

I am trying very hard to make Coverity work for my build, but so far with little success.

Details first:

I started by downloading the package from: https://scan.coverity.com/download/java/win64

Then I added the bin directory to my path, navigated to my project root and executed the following commands.

$ set PATH=%PATH%;C:\Users\dimit\sandbox\cov-analysis\bin $ gradlew clean $ cov-build --dir cov-int gradlew jar 

The first 2 went as expected, the last - not so much:

 Coverity Build Capture (32-bit) version 8.7.0 on Windows 10 Professional, 64-bit (build 14393) Internal version numbers: b452b3f2c8 p-lodi-push-28091.612 The system cannot execute the specified program. [WARNING] Build command gradlew.bat jar exited with code 1. Please verify that the build completed successfully. [WARNING] No files were emitted. This may be due to a problem with your configuration or because no files were actually compiled by your build command. Please make sure you have configured the compilers actually used in the compilation. For more details, please look at: C:/Users/dimit/sandbox/nuggets/cov-int/build-log.txt 

I posted the build log here: https://gist.github.com/ddimtirov/9daa0e9f1f0954453f01fcec42ae2198

The "build troubleshooting error" on the instructions page pointed to the forum index page, which does not help at all: https://software-community-synopsys.force.com/s/#4838

Moving on, I thought that if I could only generate data in some other way, I could upload it to the scan service and work around the problem. I found https://github.com/mjdetullio/gradle-coverity-plugin

The Coverity Gradle plugin returned data, but when I pinned it and uploaded it to the scan service, it blocked the error message.

Last of all, I tried integration with TravisCI - after several attempts, I got it so that it completed without errors, but it did not seem to load anything ...

https://travis-ci.org/ddimtirov/nuggets/builds/196307253 https://scan.coverity.com/projects/ddimtirov-nuggets?tab=overview

I'm close to failure (BTW, not having access to documents on the Internet, does not help)

+6
source share
2 answers

Problem 1 - "The system cannot execute the specified program."

This problem arose because the 32-bit Windows suite was used for the 32-bit build of Windows. Attempting to connect a 32-bit process to a 64-bit reason fails.

  • The solution is to match the bits of the Coverity binaries with the bit value of your platform (use the 64-bit Windows kit).

Problem 2 - Failed to capture TravisCI for Linux

This issue occurs due to incompatibilities between Coverity Java Capture and the ErrorProne plugin, as evidenced by messages like this in the build log:

 WARNING: Failed load class file java/io/FileNotFoundException.class as a resource using the class loader net .ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader@ 36358417 
  • The solution here is to disable this plugin to build Coverity.

Varia

  • When debugging the problem, the well-known issue of the Gradle daemon that interferes with Coverity was discussed, but in the end it was not related to the problem.
  • Noticeable problems with the prepend command - user error; prepend is not a separate command to run, it is there for official purposes.
+4
source

A few notes, because reading our documentation is critical to successfully using our tool:

  • Kotlin is not supported.
  • The use of appropriate binaries for your platform is required (therefore, the use of win32 binaries on a 64-bit platform usually does not work).
0
source

Source: https://habr.com/ru/post/1014664/


All Articles