C/C++ analysis with build wrapper

Hello everyone!
I’m using SonarQube server with azure devops for analysis of C/C++ code during build pipeline run. For an accurate analysis, I’ve included steps to use build wrapper along with other SonarQube tasks to wrap the complete build inside it. The build system is ninja which gets prepended with the build wrapper command and the compilation database JSON file is generated.
The problem is, during analysis, the pipeline fails with the error logs showing that certain analysis attributes are not supported in Compile-Commands mode. I’m pasting a chunk of the error logs here:

2025-10-24T12:54:41.5299056Z 14:54:41.527 INFO  CFamily analysis configuration mode: Compile-Commands
2025-10-24T12:54:41.5476651Z ##[error]14:54:41.544 ERROR Error during SonarScanner Engine execution
java.lang.IllegalArgumentException: The properties sonar.cfamily.customTargetArch, sonar.cfamily.customTargetVendor, sonar.cfamily.customTargetSystem, sonar.cfamily.customTargetEnv are not supported in Compile-Commands mode. Set value: arm-UNSET-UNSET-UNSET
	at com.sonar.cpp.plugin.AutoScanConfiguration.handleAutoScanTargetProperties(AutoScanConfiguration.java:157)
	at com.sonar.cpp.plugin.AutoScanConfiguration.configure(AutoScanConfiguration.java:127)
	at com.sonar.cpp.plugin.AnalysisConfiguration.setupPluginPropertiesConfig(AnalysisConfiguration.java:201)
	at com.sonar.cpp.plugin.AnalysisConfiguration.<init>(AnalysisConfiguration.java:117)
	at com.sonar.cpp.plugin.CFamilySensor.prepareAnalysisConfig(CFamilySensor.java:391)
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:215)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:190)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:201)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:197)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:170)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:350)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
	at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
	at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
	at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
2025-10-24T12:54:41.5480677Z 14:54:41.544 ERROR Error during SonarScanner Engine execution
2025-10-24T12:54:41.5497566Z java.lang.IllegalArgumentException: The properties sonar.cfamily.customTargetArch, sonar.cfamily.customTargetVendor, sonar.cfamily.customTargetSystem, sonar.cfamily.customTargetEnv are not supported in Compile-Commands mode. Set value: arm-UNSET-UNSET-UNSET
2025-10-24T12:54:41.5501360Z 	at com.sonar.cpp.plugin.AutoScanConfiguration.handleAutoScanTargetProperties(AutoScanConfiguration.java:157)
2025-10-24T12:54:41.5501804Z 	at com.sonar.cpp.plugin.AutoScanConfiguration.configure(AutoScanConfiguration.java:127)
2025-10-24T12:54:41.5518535Z 	at com.sonar.cpp.plugin.AnalysisConfiguration.setupPluginPropertiesConfig(AnalysisConfiguration.java:201)
2025-10-24T12:54:41.5519319Z 	at com.sonar.cpp.plugin.AnalysisConfiguration.<init>(AnalysisConfiguration.java:117)
2025-10-24T12:54:41.5519534Z 	at com.sonar.cpp.plugin.CFamilySensor.prepareAnalysisConfig(CFamilySensor.java:391)
2025-10-24T12:54:41.5519728Z 	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:215)
2025-10-24T12:54:41.5519871Z 	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:190)
2025-10-24T12:54:41.5520445Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
2025-10-24T12:54:41.5520625Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
2025-10-24T12:54:41.5520791Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
2025-10-24T12:54:41.5520946Z 	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
2025-10-24T12:54:41.5521129Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2025-10-24T12:54:41.5521290Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2025-10-24T12:54:41.5521450Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:201)
2025-10-24T12:54:41.5521624Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:197)
2025-10-24T12:54:41.5521836Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:170)
2025-10-24T12:54:41.5522026Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2025-10-24T12:54:41.5522198Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2025-10-24T12:54:41.5522377Z 	at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:350)
2025-10-24T12:54:41.5522542Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2025-10-24T12:54:41.5522705Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2025-10-24T12:54:41.5522956Z 	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
2025-10-24T12:54:41.5523136Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:226)
2025-10-24T12:54:41.5523299Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:205)
2025-10-24T12:54:41.5523534Z 	at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
2025-10-24T12:54:41.5523815Z 	at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
2025-10-24T12:54:41.5523953Z 	at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
2025-10-24T12:54:41.5524023Z 
2025-10-24T12:54:41.9142739Z 14:54:41.911 INFO  EXECUTION FAILURE
2025-10-24T12:54:41.9148525Z 14:54:41.912 INFO  Total time: 8.664s
2025-10-24T12:54:42.2736062Z 
2025-10-24T12:54:42.2777343Z ##[warning]Error while executing SonarQube:Analyze task: The process 'D:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\6.3.5\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
2025-10-24T12:54:42.2785866Z ##[error]The process 'D:\agent\_work\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\6.3.5\sonar-scanner\bin\sonar-scanner.bat' failed with exit code 1
2025-10-24T12:54:42.2856445Z ##[section]Finishing: [SQ] SonarQube Analysis

What could be the issue here? I can’t change or delete the properties i.e. customTargetArch, and others from the project settings since I don’t have the privileges to do so. Is there a workaround for getting this to work with build wrapper? Any help would be appreciated.

The following are the versions in use:
SonarQube server: 2025.1
Sonar-Scanner: 6.3.5

Hello @M.W, and welcome to the community!

The properties listed in this exception are intended for use in AutoConfig mode to fine-tune the analysis configuration, see the docs here.

In compilation database mode, these parameters are deduced from the provided compilation database. This is the reason these properties are not supported when a compilation database is provided.

From the exception you shared, I could see Set value: arm-UNSET-UNSET-UNSET. This means that you have sonar.cfamily.customTargetArch set to arm in the project settings:

Unfortunately, I couldn’t think of a way to unset outside the UI. I would recommend either contacting someone with the necessary rights to reset the value on the project, or analyze using a new SQ project where this setting hasn’t been altered.

Let us know if this works for you,

Best regards,
Michael