I try to use sonar-scanner-cli to scan my C source code.
I will get follow error.
The “build-wrapper-dump.json” file was found empty.
Here is some information that I used.
SonarQube * Developer Edition * Version 8.4.1 (build 35646)
Sonar Scanner 4.4.0.2170
Here is my syntax to execute sonar scanner.
sonar-scanner -Dsonar.projectKey=OGG -Dsonar.sources=D:\OGG\sonar-scanner-4.4.0.2170\bin\src -X
Here is the error message.
10:43:56.407 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found empty. Please make sure that:
you are using the latest version of the build-wrapper and the CFamily analyzer
your compiler is supported
you are wrapping your build correctly
you are wrapping a full/clean build
if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
if you don’t give any detail we cannot help much. The error message give you some hints of what could be wrong, please check those points and if you still haven’t solved the issue after that please provide additional information about your build and the logs.
So far, I use follow steps to get the C analyze report via sonarscanner.
Build a project with C simple code via Windows.
Create a build-wrapper-dump.json via MSBuild.
Change the source code with original code with NSK.
Execute sonar-scanner to do code analyzing.
Then I will be able to get a report.
For the dedicated system, like HPE NonStop, is this a expected procedures?
My question is wish to know how to use sonar scanner for the C code which is not in Linux or Windows platform?
Because HPE NonStop is a dedicated system which has different OS with other open system.
So I wish to know my procedures to get the report is correct or not.
Many thanks!
Actually, I will build my code in the HPE NonStop Guardian which version is J06.21.
I will use native C compiler, CCOMP, to build my object.
Here is some information about HPE C compiler.
"HPE C for NonStop systems conforms to the C language standard as set forth in ISO/IEC 9899:1990, Programming Languages–C. (This is technically identical to ANSI C X3.159-1989, Programming LanguageC.) "
Here is my original syntax to compile in HPE NonStop.
“CCOMP/IN USEREXC/USERDLL ;NOLIST,EXTENSIONS,SYMBOLS,TANDEM_FLOAT”
At this moment, I use Microsoft Visual Studio 2019 to create a new C++ console project.
Then use “build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe /t:Rebuild” to create build-wrapper-dump.json file.
Replace the sample source code with my code.
Use “sonar-scanner -Dsonar.projectKey=OGG” in the project directory to scanner my code.