C analysis fail when updating from SonarQube 8.9 to 9.6

Version:

  • SonarQube: Version 9.6 (build 59041)
  • Scanner: sonar-scanner-4.7.0.2747-linux
  • build-wrapper: downloaded from the SonarQube server

Hi,

When moving from SonarQube 8.9 to 9.6 (Developer edition) I’m not able to analyze C source file anymore. No change have been performed on the configuration. The database has been migrated via the SonarQube server.

The sonar-scanner failed with the error:
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed

It seems that the wrapper analyze some files, as I can see the log below when running the scanner with -X:
11:55:59.031 DEBUG: Not enough content in ‘<path/to/file.h>’ to have CPD blocks, it will not be part of the duplication detection

Did I miss something in the configuration? Do you know if the database will be automatically migrated again if I set-up the 8.9 version again?

I tried to analyze the project using the compilation database and got the same issue.
Do you confirm that SonarQube support ARM cross compiler based on gcc-11.3 (generated by buildroot)?

Hi @Anto,
In order to look into this, could you please provide us with:

  • The build-wrapper-dump.json and build-wrapper.log files;
  • The exact command you used to run the scanner and the directory you ran it from;
  • The sonar-project.properties file if you created one.
  • The complete output generated by the scanner when run in debug (-X).

If you’d rather not upload this data publicly, you can send me a direct message with them.

Thanks

Hi @Fred,

How I can provide you the logs privately (can’t find any envelope icon to send you a PM)?

@Anto I sent you a message just now. Please tell me if you cannot see it.

Hi @Anto,

Indeed the wrapper sees no compilation taking place according to the logs.

  • Did you test this same version of buildroot & GCC with SonarQube 8.9 or did you upgrade both SonarQube and the build system at the same time?
  • Do you know the name of the process that performs the compilation down the line?
  • Do you know if your compiler is statically linked? That could be what hides it from the wrapper.

On a different note, you said:

With the compilation database, the issue should not be the same and the error message should be different.

  • How did you generate the compilation DB?
  • Could you share the generated compilation DB with me through DM?
  • Could you also share the scanner logs in that case?

Thanks