Getting "0 compilation units analyzed" when running SonarScanner with bazel for cfamily

I am running SonnarScanner for a C++ Windows project which uses bazel for compilation and see below log in the sonar scanner output:
“0 compilation units analyzed”

Apart from this I do not notice any warnings, errors or complaints from the debug output.

But the problem is I get 0 Bug, 0 Vulnerabilities, 0 Code Smells and 0 Duplications in the final report that gets generated and uploaded to the SonarQube Server.

Attaching the build output and json files (60.8 KB)

bazel version is: bazel 4.0.0
SonarScanner version: SonarScanner

Build command: build-wrapper-win-x86-64.exe --out-dir bazel --batch build --spawn_strategy=standalone --genrule_strategy=standalone //…

Appreciate any help on this.

Hi @mayurpremi ,

you are using a very old version of SonarQube which is not supported anymore, I would invite you to upgrade to a more recent version and test with a newer version.

Hi @mpaladin,
Thanks for the quick response.

When you say SonarQube version do you mean the SonarQube server version or SonarScanner version ?

Also we use the same SQ and SC set up for another project which has cfamily code(C++) and uses ‘msbuild’ for compilation. SonarQube works well with that. So wondering is there any change in the latest SonarQube wrt bazel ?

The SQ server we use is spread across various projects so above information will help me get the versions upgraded in our build servers. Thanks.


Hi @mayurpremi ,

I am referring to the SonarQube server, you have a very old version, 7.7.

Many changes have happened and many bugs have been fixed. The best is to update and test again.