The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed for C code

Hello team !

I’m trying to scan my projects using sonar-scanner. Building using the build wrapper is successful, but I get this error when running the sonar-scanner:

14:25:07.957 ERROR Error during SonarScanner CLI 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.process(CFamilySensor.java:609)
               at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:241)
               at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
               at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
               at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
               at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
               at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
               at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
               at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:398)
               at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:394)
               at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:363)
               at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
               at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
               at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:139)
               at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
               at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
               at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
               at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
               at org.sonarsource.scanner.lib.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:41)
               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.lib.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:62)
               at jdk.proxy3/jdk.proxy3.$Proxy2.execute(Unknown Source)
               at org.sonarsource.scanner.lib.InProcessScannerEngineFacade.doAnalyze(InProcessScannerEngineFacade.java:39)
               at org.sonarsource.scanner.lib.ScannerEngineFacade.analyze(ScannerEngineFacade.java:61)
               at org.sonarsource.scanner.cli.Main.analyze(Main.java:77)
               at org.sonarsource.scanner.cli.Main.main(Main.java:63)

Question:

Is this related to the toolchain being used and is this toolchain supported, or is this a configuration issue ? I have listed my config below and can send the sonar-project.properties and output build-wrapper.log, build-wrapper-dump.json, and scanner.log (Verbose) files to you privately.

Commands being used:

build-wrapper-linux-x86-64 --out-dir bw-output make clean all
sonar-scanner -X -Dsonar.token=xxxxxxxxxxxxxxxxxxx > scanner.log 2>&1

OS:

NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"

ARM Toolchain –

codesourcery/arm-2011.09-69-arm-none-eabi
gcc (Sourcery CodeBench Lite 2011.09-69) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ARM toolchain is dynamically linked:

/opt/codesourcery/arm-2011.09/arm-none-eabi/bin$ ldd gcc 
        linux-gate.so.1 (0xf7f53000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7e35000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7c59000)
        /lib/ld-linux.so.2 (0xf7f55000)

SonarQube Server Version 10.3
image

Sonar-Scanner Version -

    sonar-scanner-6.1.0.4477-linux-x64/conf/sonar-scanner.properties
    14:31:56.972 INFO  Project root configuration file: /home/ali/EMCMdev/EMCMFirmware/sonar-project.properties
    14:31:56.994 INFO  SonarScanner CLI 6.1.0.4477
    14:31:57.006 INFO  Java 17.0.11 Eclipse Adoptium (64-bit)
    14:31:57.007 INFO  Linux 5.4.0-150-generic amd64

Build-wrapper version -

     build-wrapper, version 6.50 (linux-x86)
    Copyright (C) 2014-2023 SonarSource SA, info@sonarsource.com

I have looked at other discussions and have tried looking at most fixes but can’t seem to debug what the issue is.

Any help would be greatly appreciated.

Thanks,

Ali

Hi @ali.q, and thanks for sharing the problem with us.

In order to help us identify the issue, would be willing to share the following files with us?

  • build-wrapper-dump.json and build-wrapper.log.
  • The full verbose output of the scanner (using -X flag).

We can then look on our side and identify the problem. I can also open a private thread with you in case you prefer to share these files privately.

Best regards,
Michael

Hi @michael.jabbour ,

Thanks for the reply,

Could you open a private thread ? I would like to share the files with you privately.

Thanks,
Ali

1 Like