How to create a suitable build-wrapper-dump.json for HPE NonStop C source code?

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

Hi @rando,

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.

Hi Sir,

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?

Best regards, Randolph

Hi @rando,

I am sorry but I don’t understand what is your problem from this message.

Hi Sir,

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!

Best regards, Randolph

Hi @rando,

please explain what you are trying achieve:

  • In which OS do you build your code?
  • What compiler are you using?
  • What build command are you using to build your project?

Hi Sir,

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.

Best regards, Randolph

Hi @rando,

Unfortunately this compiler is not supported. The up to date list of supported compilers is available on our website https://www.sonarsource.com/c/ or in the documentation page: https://docs.sonarqube.org/latest/analysis/languages/cfamily/.