Hello. I have recently deployed Sonarqube at my company and we have succesfully managed to get a c project analysed that employs the arm-eabi-gcc compiler.
We are now trying get other C projects for another platform analysed in the same manner but are running into an issue whereby the C build-wrapper does not seem to recognize our compiler despite it also being a gcc compiler. In this case the code is compiled using the Microblaze gcc compiler which has a perhaps unusual executable name “mb-gcc” In this instance where the analysis fails we are compiling the project through the build-wrapper and the compilation completes succesfully. During the sonarscanner/upload script we are getting the following messages
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,thr oughHeader=0)
INFO: SE: 0 out of 0
INFO: Z3 refutation rate: 0 out of 0
INFO: Subprocess(es) done in 15ms
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.991s
INFO: Final Memory: 24M/94M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
I can confirm that the build-wrapper-dump.json is “empty” it contains only a version tag and an empty “captures” section
Looking at the logs it seems the build-wrapper is “skipping” the process that executes the compiler. In the logs below I have redacted filepaths and names, but you can see that process 23908 executes our compiler “mb-gcc” and then “skips” it seemingly not recognizing it as valid compiler
Tue Jun 07 13:40:25 2022: parent pid: 23904
Tue Jun 07 13:40:25 2022: working directory: </home/genericUser/Documents/Sandbox/FPGA/workingdir>
Tue Jun 07 13:40:25 2022: executable: </usr/bin/dash>
Tue Jun 07 13:40:25 2022: argv[0]: </bin/sh>
Tue Jun 07 13:40:25 2022: argv[1]: <-c>
Tue Jun 07 13:40:25 2022: argv[2]: <mb-gcc -Wall -O0 -g3 -c -fmessage-length=0 -MT"src/generic_source_name.o" -I/home/path/to/includes>
Tue Jun 07 13:40:25 2022: skipping process with pid: 23907
Tue Jun 07 13:40:25 2022: process created with pid: 23908
Tue Jun 07 13:40:25 2022: parent pid: 23907
Tue Jun 07 13:40:25 2022: working directory: </home/genericUser/FPGA/workingdir>
Tue Jun 07 13:40:25 2022: executable: </usr/bin/bash>
Tue Jun 07 13:40:25 2022: argv[0]: </bin/bash>
Tue Jun 07 13:40:25 2022: argv[1]: </tools/path-to-toolchain/mb-gcc>
Tue Jun 07 13:40:25 2022: argv[2]: <-Wall>
Tue Jun 07 13:40:25 2022: argv[3]: <-O0>
Tue Jun 07 13:40:25 2022: argv[4]: <-g3>
Tue Jun 07 13:40:25 2022: argv[5]: <-c>
....
other compiler options
....
Tue Jun 07 13:40:25 2022: argv[25]: <src/generic_source_name.o>
Tue Jun 07 13:40:25 2022: argv[26]: <../src/generic_source_name.c>
Tue Jun 07 13:40:25 2022: skipping process with pid: 23908
Tue Jun 07 13:40:25 2022: process created with pid: 23909
Tue Jun 07 13:40:25 2022: parent pid: 23908
Tue Jun 07 13:40:25 2022: working directory: </home/genericUser/Documents/Sandbox/FPGA/workingdir>
Tue Jun 07 13:40:25 2022: executable: </usr/bin/dirname>
Tue Jun 07 13:40:25 2022: argv[0]: <dirname>
Tue Jun 07 13:40:25 2022: argv[1]: <tools/path-to-toolchain/mb-gcc>
Tue Jun 07 13:40:25 2022: skipping process with pid: 23909
Tue Jun 07 13:40:25 2022: process created with pid: 23910
Tue Jun 07 13:40:25 2022: parent pid: 23908
Tue Jun 07 13:40:25 2022: working directory: </home/genericUser/FPGA/workingdir>
Tue Jun 07 13:40:25 2022: executable: </usr/bin/dirname>
Tue Jun 07 13:40:25 2022: argv[0]: <dirname>
Tue Jun 07 13:40:25 2022: argv[1]: <tools/path-to-toolchain/mb-gcc>
Tue Jun 07 13:40:25 2022: skipping process with pid: 23910
Tue Jun 07 13:40:25 2022: process created with pid: 23911
Tue Jun 07 13:40:25 2022: parent pid: 23908
Is there a way to force the build-wrapper to recognize mb-gcc as a gcc compiler?
Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this