ERROR: Error during SonarQube Scanner execution (java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed.)

Hi, I’m using SonarCloud in Travis CI. The project is based on C++.
I didn’t have any problems until early this morning, but I’m starting to fail.

My project repo is https://github.com/utilForever/RosettaStone/tree/pytorch
The log of Travis CI is https://travis-ci.org/utilForever/RosettaStone/jobs/589436830

What should I do? T_T;

Hi @utilForever,

this change was introduced by https://jira.sonarsource.com/browse/CPP-2269, if you provide a build-wrapper-dump.json file and no files get analyzed it means there is an issue.

Looking at https://github.com/utilForever/RosettaStone/blob/pytorch/Scripts/travis_build_codecov_sonar.sh#L17 you are wrapping the wrong command, you are wrapping cmake build files generation, not the build itself. This results in not being able to analyze any C/C++ file.

You should probably change https://github.com/utilForever/RosettaStone/blob/e5de8ab77690718f26a95680f7eeae3c3fbbb051/Scripts/travis_build_codecov_sonar.sh#L17-L18 to something like:

cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERAGE=ON
build-wrapper-linux-x86-64 --out-dir ../bw-output make UnitTests
2 Likes

Thanks! This problem is resolved.
Thank you for your kind answer.

1 Like

A post was split to a new topic: Build-wrapper-dump.json file was found but 0 files were analyzed