Sonar-scanner showed "EXECUTION FAILURE" while Source File Inclusions are set

Hi All:
I use SonarQube recently and the version information below:
SonarQube: Developer Edition Version 9.6.1 (build 59531)
Sonar-scanner:
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Linux 5.3.0-28-generic amd64

Problem description:
We want to scan the source code partially since some parts are not interested.
It is fine to scan the whole source without any change on the project setting.
Then we change the analysis scope and set the “source file inclusions” like “driver/**”
Redo the scanning and the system always show “EXECUTION FAILURE”
More detail can be found in the log.
scan.log (68.7 KB)

Could someone give the advice?
Thanks.

Fred

Hey there.

I suspect that you aren’t actually compiling the code under driver/**, therefore it’s not present in your build wrapper output and, with an analysis initiated with build wrapper information and no C/C++ successfully analyzed… the scan fails.

Are you actually compiling the code under driver/** when you wrap your compilation command with the build wrapper?

Hi Colin:
I don’t really understand how to compile the code under driver/** only.
Actually, when we user build wrapper to wrap the compilation command, the scope is whole source code, and this is the only way to compile it.
We have tried to use “source file exclusion” method and it also worked!
So I think there is something wrong in the file inclusion setting.
Do you have other suggestion or what kinds of information I can provide?
Thanks.

Fred

Hey there.

My question is – are you actually compiling this code at all?

Hi Colin:
Yes, we can compile the code without any problem.
Just found something interesting:
As long as I redo the scan again and again(usually >5 times), the scan process will be complete and show “EXECUTION SUCCESS”.

Hi,

In fact, C and C++ analysis uses an analysis cache, so you shouldn’t have to manage this manually if the uninteresting files aren’t changing. I suggest you reset sonar.sources to your entire codebase.

As a side note, inclusions and exclusions should describe filesets, not directories. So something like driver/**/*

 
Ann

Hi Ann:
Understood.
I think the issue is fixed by reset the sonar.sources to entire codebase
and rescan can be successful.
Thanks for help.

Fred

1 Like