The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please ma

I did executed the Build Wrapper build command successfully using below command

build-wrapper-linux-x86-64 --out-dir bw-output g++

While executing above Scanner command to analysed the project getting below error.

INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=2ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=352ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=6ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version: 6.52.1.66618
INFO: Using build-wrapper output: /osp/sde/DH_TI_OSP20_view/sib/orvault/generic/cmm/chge/tcpge2/snd_dpr_ip/cov-build_test/build-wrapper-dump.json
INFO: Available processors: 16
INFO: Using 16 threads for analysis.
INFO: Found empty cache on server
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
INFO: Z3 refutation rate: 0 out of 0
INFO: SE: 0 out of 0
INFO: Subprocess(es) done in 46ms
INFO: 0/2 files marked as unchanged
INFO: Cache: 0/0 hits, 126 bytes
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:01.913s
INFO: Final Memory: 38M/176M
INFO: ------------------------------------------------------------------------
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

Hey there.

If the build wrapper is supposed to go to a bw-output folder as you’ve specified in the command… that’s not where it’s being looked for.

Where have you set sonar.cfamily.build-wrapper-output, and to what value?

HI Colin ,

I am executing below command from this directory /osp/sde/DH_TI_OSP20_view/sib/orvault/generic/cmm/chge/tcpge2/snd_dpr_ip

sonar-scanner
-Dsonar.projectKey=OSP_sib_test
-Dsonar.sources=.
-Dsonar.cfamily.build-wrapper-output=cov-build_test
-Dsonar.host.url=http://172.19.107.192:9000
-Dsonar.token=sqp_8ee79c176ac5567fb262e628365976a24d2d0444

Thanks Colin , now our code has been scanned successfully but one challenges I am facing currently,

My project has multiple components that need to be build/compiled separately.but when i build that component then , bw-output/build-wrapper-dump.json file has been override. and report has been generated for last build components only .

Hey there.

There’s a few options – like wrapping all of your builds into a single script that gets executed by the build wrapper (all info will captured from all the builds), or creating separate SonarQube projects for each build (which you can stitch back together as an Application).