Sonarqube C Makefile Error

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 8.7.1.42226, SolarScanner 4.6.0.2311 build-wrapper, version 6.17 (linux-x86)
  • what are you trying to achieve
    Running SonarCube over my embedded C project
  • what have you tried so far to achieve this
    I have the Server and Scanner setup on a very similar project that seems to run fine, however this one always gives me:
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
INFO: SE: 0 out of 0
INFO: Subprocess(es) done in 208ms
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 59.477s
INFO: Final Memory: 84M/294M
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
  * 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
    at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:440)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:389)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:354)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I’m using a makefile and arm-none-gcc-eabi compiler. As mentioned works fine on a similar project. In debugging options it shows

generated metadata with charset 'windows-1252'

for some of the files, could that be an issue?

Edit: I converted all files to UTF-8, that didn’t solve the issue.

Hi @JSStabl ,

is the compiler statically linked?

Would you be able to share the build-wrapper-output folder and the sonar-scanner debug log?

I just ran it over a freshly checked out project and it ran fine, not sure what the issue was with the already cloned version.

1 Like

Hi @JSStabl ,

ok, thank you for the notification.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.