Cygwin, cfamily, wrapper -> crash in 'sonar-scanner'

(SonarQube = 8.0.0.29455)

we have a C++ project. This project is compiled on clang, gcc and VisualStudio. Because we want to use GCov, we have to compile the project with G++ (and the corresponding gcov options).
I use the “make” of Cygwin in conjunction with the buildwrapper:

build-wrapper-win-x86-64.exe --out-dir C:\git\BlueConnect_Framework\build_wrapper_output_directory C:\software\cygwin\bin\make -j clean all

Build and link is successful.

After invoking sonar-scanner, sonar comes with an error message:

ERROR: Error during SonarQube Scanner 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 SonarCFamily 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:357)

Yes,

  • we use the latest wrapper and plugin,
  • we wrap correctly,
  • we make a full clean build,
  • paths are correct …

Is that possible and correct, how we do that?
Do you have any ideas?

Hi @RalfBalaszeskul-EH,

could you please provide C:\git\BlueConnect_Framework\build_wrapper_output_directory content?

Yes, but is there a possibility to send it as private message (because of NDA-constraints)?

Hi @RalfBalaszeskul-EH,

sure, I sent you a PM.

I suppose, the reason was that I was called the build-command (over the wrapper) and scan from different directories. As soon as I am further here, I will give feedback.
Currently I have a licensing problem, see also Licence "Developer-Edition" without CFamily (Sonar C++)

Hi Massimo, now I have the wrapper-content. Where can I send this file?

Hi @RalfBalaszeskul-EH,

I re-sent you a PM.

did you receive my e-mail (before lunch)

Hi @mpaladin, did you receive my zip-file?

Hi @RalfBalaszeskul-EH,

yes, let me apologize for the delay, you are affected by CPP-2438. Would you be able to build outside of cygwin?

We are in general able to build our project with XCode (on Macs), Android, Cygwin and Visual Studio.
The decision for Cygwin came because of two reasons: Windows is most convenient in our IT-structure and Code-coverage with gcovr depends on gcc. For that, Cygwin (in my understanding) is the only licence-free match (or am I wrong?).

Hi @RalfBalaszeskul-EH,

we support Visual Studio coverage format if you prefer to use Visual Studio or you could use Cygwin commands but from Windows prompt (note that in Cygwin you would still be affected by CPP-2438).

ok, tanks! That is the reason - I’ll have a look (later) and come back!

Dear @mpaladin
Visual Studiio is currently no option (because of licence-costs).
What do you mean with “you could use Cygwin commands but from Windows prompt”… ?
I now have a simple “HelloSonar” project (file, test file and googltest) that I can provide.
Best regards, Ralf

Hi @RalfBalaszeskul-EH,

fair enough.

when you work from cygwin prompt all the paths are unix style which aren’t recognized on our side on Windows. Could you try with mingw and a gcc build for mingw? If I am not wrong on mingw and other gcc distributions for Windows the paths are kept Windows style.

ok, Ill try …

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