Hello SonarSource Community,
I’m encountering an issue with SonarQube analysis for C/C++ code in our Azure DevOps Server (2022) pipeline. We’re using Docker to manage the build wrapper output, as our CI/CD agents aren’t configured to build projects independently on the command line. Despite successfully wrapping the build and producing the build-wrapper-dump.json
file, the analysis step reports that no files are being scanned. Here is the error we’re seeing:
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
Pipeline Setup Overview
Our pipeline follows these steps:
- Prepare SonarQube configuration using the
SonarQubePrepare@7
task. - Checkout the main repository alongside supporting repositories.
- Build the project inside a Docker container using a custom image, wrapping the build with the SonarQube build-wrapper.
- Mount the
build-wrapper
output directory to a Docker volume and link it to the agent’s temp directory. - Run the analysis using the
SonarQubeAnalyze@7
task, pointing to the Docker volume’s output.
The analysis is expected to scan files from the main repository, which is correctly checked out during the pipeline execution. However, no files are being analyzed, even though the build-wrapper-dump.json
file is present and accessible.
What We’ve Checked So Far
- The
build-wrapper
output directory (sonar.cfamily.build-wrapper-output
) is correctly set. - The
build-wrapper-dump.json
file contains data. - The source code paths during the analysis step match those during the build (checked for absolute path consistency).
Questions and Help Needed
- Are there specific configurations or common pitfalls when using Docker with the build wrapper for CFamily analysis, especially when analyzing files from a specific repository?
- Could this issue be related to path handling or differences between how Docker manages volumes and how the Azure DevOps Server (2022) agent accesses files?
- What additional steps can we take to debug why the files in the main repository are not being scanned?
Thank you in advance for your support!