I created a pipeline to run SonarQube analysis on the CMake project.
The project is C++/CLR DLL which I intend to pack as a NuGet package.
I run the following steps:
CMake
Azure pipelines task SonarQubePrepare@4
Azure pipelines task MSBuild@1
Azure pipelines task SonarQubeAnalyze@4
Azure pipelines task SonarQubePublish@4
In step 4 I get the following error: ##[error]java.lang.IllegalStateException: The base directory of the module '47FC3477-1769-3BF1-9D9C-F82E22B35809' does not exist: C:\Agent1.1\_work\17\s\Medtronic.Native.VideoConstruction\CMakeFiles\CMakeScratch\TryCompile-967m7d
Things I tried:
Generate the CMake products in a directory above the sources
Generate the CMake products in a temp directory
Change project base dir
Add exclusions
Disabling the ZERO_CHECK project
I’m out of ideas on how to resolve that issue, I’d appreciate assistance. log.txt (21.1 KB)
Can we have the full debug job log, starting at least from step 2?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
I think I probably should have asked for all of them. Could you share the one for that first step, too? The missing base directory has CMakeFiles in it. Does the CMake step do any cleanup before it exits?
Following some investigation I did, I noticed that CMake is running compilation to check the compiler.
The files of this check are deleted afterward.
Because I ran the SonarQubePrepare before the CMake (unlike I wrote in the original question) the analyzer was looking for them and failing when it couldn’t.
For the sake of testing I disabled that delete using --debug-trycompile.
The process was completed and the analysis phase is now failing with another error:
The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed.
Digging around, lead me to this thread.
It is a very old version of SonarQube so my question is CLR still not supported?