Running SonnarScanner for a C++ project on windows. It uses bazel for compilation .
This is the command for build:
build-wrapper-win-x86-64.exe --out-dir C:\sonartools\buildwrapper-ouput bazel --batch build --spawn_strategy=standalone --genrule_strategy=standalone //source/ztna/ZtnaAgentLib/…
this is the command for analysis:
sonar-scanner -Dproject.settings=C:\sonartools\ztna_sonar-project.properties
It creates the analysis json file, detail is attached but the analysis is failing with the error below
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
attaching the zip file for details. sonarscannererror.zip (72.0 KB)
standalone is deprecated, try to use local instead
--spawn_strategy=local
--strategy=Genrule=local
If the analysis is still failing after applying all the suggestions, Can you share your build-wrapper JSON and log files in addition to the scanner output in verbose mode. I can send you a private message if you prefer to send them privately.
Thanks Abbas,
Have tried with above suggested options , but still I see the same error.
Please send me a private message to shared the requested data privately.
Regards,
Madan