SonarCloud analysis failing with CFamily plugin version:

Sonar Cloud connected to Bitrise within SonarQube Scanner step
INFO: SonarScanner
INFO: Java 17.0.9
INFO: Mac OS X 14.1.2
INFO: Xcode 15.3

When I used CFamily plugin version: it worked as expected

Running the analysis from the pipeline stops with several of these errors

INFO: Sensor Generic Coverage Report (done) | time=260ms
INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version:
INFO: Using compile commands: /Users/vagrant/git/compile_commands.json
INFO: Available processors: 4
INFO: Using 4 threads for analysis.
INFO: Found empty cache on server
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 32.983s
INFO: Final Memory: 72M/250M

INFO: ------------------------------------------------------------------------

ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: unexpanded response file
at com.sonar.cpp.analyzer.ClangDriver.onCapture(
at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$37(
at com.sonar.cpp.plugin.CompileCommandsReader.readCaptures(
at com.sonar.cpp.plugin.CFamilySensor.process(
at com.sonar.cpp.plugin.CFamilySensor.processConfigurationReader(
at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(
at java.base/java.lang.Iterable.forEach(
at com.sonar.cpp.plugin.CFamilySensor.process(
at com.sonar.cpp.plugin.CFamilySensor.execute(
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.scanner.scan.ProjectScanContainer.scan(
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
at org.sonar.core.platform.ComponentContainer.startComponents(
at org.sonar.core.platform.ComponentContainer.execute(
at org.sonar.batch.bootstrapper.Batch.doExecute(
at org.sonar.batch.bootstrapper.Batch.execute(
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
at org.sonarsource.scanner.api.EmbeddedScanner.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.execute(
at org.sonarsource.scanner.cli.Main.main(\

Hi @vadimux,

This error means that your compilation database contains unexpanded response files.

Are you using Cmake? if yes, which version? Have a look at this Unexpanded response file error when using Sonarlint for VSCode - #6 by Abbas. It might be that you changed the CMake version, and those unexpanded response file started appearing.

If you aren’t using CMake, How are you generating the compilation database? Can you share it? I can send you a private message if you prefer to share it privately.

We added support for response file expansion in 6.54 which should be available on SC in a couple of days: [CPP-3572] - Jira.


Hi @Abbas thank you for replying, so, I use this command in Bitrise custom script

# Build the project and generate the compile_commands.json file
xcodebuild -workspace "$XCODE_PROJECT" -scheme "$SCHEME" -destination 'generic/platform=iOS' -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO  -skipMacroValidation | xcpretty -r json-compilation-database -o compile_commands.json


Did you check if you have unexpanded response files in your compilation database?
If it was working previously, this means that these response files are new and weren’t there before.

Also, you didn’t reply if you are willing to share your compilation database content.

Also, not that the compilation database generated by xcpretty is inaccurate. see [CPP-3665] - Jira.

You can check the recommended way with XCode in this ticket description: [CPP-3987] - Jira


sorry @Abbas I can’t find a private message (direct message) button - could you please highlight how can I do this? I’ve prepared compile_commands.json for sharing.

about build-wrapper - [CPP-3987] - Jira I mentioned that I had an issue with macOS 14.2.1 - Build wrapper is not working as expected, Objective C, XCode - #13 by vadimux


Hi @vadimux,

I sent you a private message.

I didn’t refer to build-wrapper. I was referring to the ticket description on how to generate a compilation database:

#add to your xcodebuild command: OTHER_CFLAGS=“$(inherited) -gen-cdb-fragment-path $(PROJECT_DIR)/CompilationDatabase”
xcodebuild clean build arg1 … argN OTHER_CFLAGS=“$(inherited) -gen-cdb-fragment-path $(PROJECT_DIR)/CompilationDatabase”
pushd CompilationDatabase
sed -e ‘1s/^/['$’\n’‘/’ -e ‘$s/,$/'$’\n’‘]/’ *.json > …/compile_commands.json

Hi, we are hitting the same exact problem. We have xcpretty generating the compile_commands.json, but it suddenly stopped working yesterday.

I had a look at the cpp library, and it seems the error comes from checks around response files.
In the compile_commands lists command keys with these kind of values:

"/Applications/ \
-Wunguarded-availability \

Hi @mcomisso,

but it suddenly stopped working yesterday.

Was there an update to XCode yesterday?


These are called response files, they start with @, but they are not supported yet, an initial support was added in the next version that should be available on SC this week.

If it was working before it means that they weren’t generated before and a change happened that started adding them.

Thanks for the quick reply!

There was no update to Xcode, we are running on bitrise, stack 15.2.

The failures started at Apr 2, 2:48pm BST, with sonarcloud throwing

java.lang.IllegalStateException: unexpanded response file

in all our pull requests. We’ve been trying to mitigate the issue and updated the stack to 15.3, but without any impact.

@mcomisso @vadimux,

I was able to reproduce the issue.

It is fixed by adding this option to xcode CLANG_USE_RESPONSE_FILE=NO

for example:

xcodebuild clean build CLANG_USE_RESPONSE_FILE=NO

Please add this option to your build command to unblock.

If necessary, you can try to remove this option in a week when the support of the response file is deployed on SonarCloud.

There was no change on our side, so there must be a change in the XCode defaults or system settings that led to this.



Thank you, I will add it to our flags.

I opened logs on various pull requests trying to match sonarcloud lib versions, and I can confirm there was no change between passing or failing workflows.

Thanks for the help, I’ll post back tomorrow with the results.

1 Like

Hi all, yes, the solution from @Abbas works as expected in Bitrise (the report has been provided to SonarCloud correctly). Great and thank you for your effort! Really appreciate.

Final Note:

I tested with XCode 15.2, but I couldn’t reproduce the issue.

After further investigation, it turns out that this option CLANG_USE_RESPONSE_FILE was introduced in 15.3 and it defaults to Yes.


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