- ALM used: GitHub
- CI system used: Circle CI
- Scanner command used when applicable: sonar-scanner
- Languages of the repository: C, C++, C#
- Error observed:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 44.685s
INFO: Final Memory: 43M/786M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
* you are using the latest version of the build-wrapper and the SonarCFamily analyzer
* you are correctly invoking the scanner with correct configuration
* your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
* you are providing the path to the correct build-wrapper output directory
- Steps to reproduce: run sonar-scanner through circleci
- Potential workaround: unclear
I am attempting to integrate sonar scans into our CircleCI workflow, but am currently blocked by the above error. When I run the scanner on my local, it finishes without issue and posts results to localhost:9000 like in the documentation, however when trying to do the same via sonarcloud, the execution fails.
Addressing the points in the error:
* you are using the latest version of the build-wrapper and the SonarCFamily analyzer
Both are downloaded from the website as part of the docker build for the base image we’re scanning on, so they are definitely the latest.
* you are correctly invoking the scanner with correct configuration
Not 100% clear what this means, however it’s a pretty simple sonar-scanner -Dproject.settings=<path> -Dsonar.login=<token>
that we’re doing, and again the command works on local.
* your compiler is supported
Using same compiler as on local, so yes.
* you are wrapping your build correctly
It would appear not since this isn’t working. The specific command we are using is build-wrapper-linux-x86-64 --out-dir ../../bw-output ../build.sh
, where build.sh is just a script that runs all our build commands. Again, works on local.
* you are wrapping a full/clean build
Definitely full because we’re doing the same build process as local. Definitely clean because the build is done right after the Docker base image is spun up, which doesn’t have any files from a previous build on it.
* you are providing the path to the correct build-wrapper output directory
Definitely are because it is finding the build-wrapper-dump.json file.
Here’s a link to our repo if you’d like to take a look: https://github.com/usdot-fhwa-OPS/V2X-Hub. There are some odd configs and comments there since I’m currently trying to debug, so please let me know if you want any clarification on what we’re doing.