Hello All,
I’m decorating my Bitbucket repository pull requests with sonarqube. So far I have been successful in integrating it for Go & python projects. I have been struggling to do the same for C++ and would be grateful for any suggestions/ advise given.
Steps:
- Created a Toy C++ project which I can analyze in my local machine using build-wrapper & sonar-scan.
- Trying to do the same in bit bucket pipelines. Refer the yaml attached.
bitbucket-pipelines.yml.txt (1.4 KB) - I have a Sonarqube server with self signed certificate. So I have created a docker container installing my cert on top of sonarqube-scan. It is working sucesfully for Go & python & this should be the same for C++.
- When running the pipeline on bitbucket for my toy project I’m getting below error.
01:25:18.208 WARN: Invalid probe found, skip analysis of files: [/opt/atlassian/pipelines/agent/build/test.cpp]
The compiler probe 'stdout' is expected to contain at least one '#define' directive:
01:25:18.209 INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
01:25:18.209 INFO: SE: 0 out of 0
01:25:18.209 INFO: Z3 refutation rate: 0 out of 0
01:25:18.209 INFO: Subprocess(es) done in 26ms
01:25:18.210 INFO: 0 compilation units analyzed
01:25:18.234 INFO: ------------------------------------------------------------------------
01:25:18.234 INFO: EXECUTION FAILURE
01:25:18.234 INFO: ------------------------------------------------------------------------
01:25:18.235 INFO: Total time: 1:21.277s
01:25:18.317 INFO: Final Memory: 26M/97M
01:25:18.318 INFO: ------------------------------------------------------------------------
01:25:18.318 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: 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 CFamily 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
* you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
full log:
pipelineLog-25.txt (60.2 KB)
As per my understanding I’m runing the build-wrapper & sonar-scanner in the same directory. I’ve been reading other posts but could not find a solution. Any help is highly appreciated.
Thanks,
Thisara