coverity持续集成_无法使Coverity Scan工作(Windows和Travis上的Java / Kotlin / Gradle 3.3)...

作者在尝试使用Coverity进行持续集成时遇到了问题,包括Windows环境下32位与64位不匹配导致的错误以及Travis CI上与ErrorProne插件的不兼容。解决方案包括使用匹配平台位数的Coverity工具和在Coverity构建时禁用ErrorProne插件。
摘要由CSDN通过智能技术生成

UPDATE: See the solution in Caleb's answer

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

First the details:

My project is run of the mill java library (no web or fancy containers), very few compile-only dependencies, built using Gradle

The production code is written in Java and Kotlin

The complete project is available on github: https://github.com/ddimtirov/nuggets

My development environment is Windows 10, Java 1.8.0_92, Gradle 3.3, CMD shell (though I also tried Cygwin and Mingw Bash)

there is also Travis build on Linux

Then I added the bin directory to my path, went to my project root and ran 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

The "Troubleshoot build failure" on the instructions page was pointing to a 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 the data in some other way I could upload it to the scan service and bypass the problem. I found https://github.com/mjdetullio/gradle-coverity-plugin

The Gradle Coverity plugin emitted the data, but when I zipped it and uploaded to the scan service, it barfed the error email.

As last resort, I tried the TravisCI integration - after a few attempts, I got it to complete without an error, but it didn't seem to upload anything...

I am close to giving up (BTW, not having docs available online doesn't help)

解决方案

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

This issue arose because a Windows 32-bit kit was used to attempt to capture a Windows 64-bit build. The attempt to attach a 32-bit process to a 64-bit one causes failure to execute.

The solution here is to match the bitness of Coverity binaries with the bitness of your platform (use a Windows 64-bit kit).

Issue 2 - Failure to capture TravisCI build on Linux

This issue appears to be due to an incompatibility between Coverity's Java Capture and the ErrorProne plugin, as evidenced by messages such as this one 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 that plugin for the Coverity build.

Varia

When debugging the issue, the known issue of the Gradle daemon interfering with Coverity was discussed, but was ultimately not relevant to the issue.

The noted issues with the "prepend" command are user error; the prepend command is not a separate command to run, it's there for utility purposes.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值