VS2022: "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed

When we try to upgrade our compiler from VS2019 to VS2022 we have this error

INFO: CFamily plugin version: 6.50.0.64514
INFO: Using build-wrapper output: D:\DevOps_Agent\_work\1\s\mvt_build_wrapper_output_directory\build-wrapper-dump.json
INFO: Available processors: 6
INFO: Using 6 threads for analysis.
INFO: Loading cache from: server
WARN: Microsoft extension activated by "/openmp" compiler option is not supported, skip analysis of files: [D:/DevOps_Agent/_work/1/s/MvtSpoolerLib/MvtDefaultSignatureCorrection.cpp, ...]
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
INFO: Z3 refutation rate: 0 out of 0
INFO: SE: 0 out of 0
INFO: Subprocess(es) done in 188ms
INFO: 598/651 files marked as unchanged
INFO: Cache: 0/0 hits, 125 bytes
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:13.576s
INFO: Final Memory: 42M/160M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]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

That was not occurring with VS2019…
Same part of the analysis:

INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version: 6.50.0.64514
INFO: Using build-wrapper output: D:\DevOps_Agent\_work\1\s\mvt_build_wrapper_output_directory\build-wrapper-dump.json
INFO: Available processors: 6
INFO: Using 6 threads for analysis.
INFO: Loading cache from: server
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_slicescreen.c
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_slicescreen_fme_4x3.c
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_slicescreen_fms_1.c
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_slicescreen_fms_1x2.c
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_slicescreen_fms_1x3.c
INFO: Cache hit for: D:\DevOps_Agent\_work\1\s\MvtEngine\rx_spooler_ctrl\rx_slicescreen_lib\rx_tas.cpp
INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 6 (forceInclude=0,throughHeader=0)
INFO: Z3 refutation rate: 0 out of 7
INFO: SE: 6 out of 6
INFO: Subprocess(es) done in 725ms
INFO: 646/646 files marked as unchanged
INFO: Cache: 6/6 hits, 91939 bytes
INFO: 6 compilation units analyzed
INFO: Sensor CFamily [cpp] (done) | time=4474ms

We are doing a clean build (in fact in a empty folder) with the last version (downloaded at each run ‘https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip’)

So I could not understand why it does not work anymore.

Could you help pleas

Found that it is due to the ignore of “/openmp”…
I do not know why in VS2019 the option is not present BUT as we use msbuild it set the option for all files.

Really ignore files compiled with /openmp is a HUGE issue.

1 Like

Hi @Laurent ,

our analyzer doesn’t support openmp, in the past we were silently ignoring it leading to possible bad analysis results. Now, we prefer to skip files that are compiled with /openmp. I would encourage you to use /openmp only for the subset of files that require it. Is it something you can do?