Getting java.lang.IllegalStateException: unexpanded response file with Xcode 15.4+

SonarQube: 10.3
SonarScanner: 6.2.1.4610

I have an Xcode project with substantial amount of C++ code. We’ve been scanning it successfully using compilation database for quite some time. We’re recently started to upgrade from Xcode 15.2 to 16.0 and the scans are failing with 15.4 and 16.0 with the following error:

16:01:21 20:01:21.485 ERROR Error during SonarScanner CLI execution
16:01:21 java.lang.IllegalStateException: unexpanded response file
16:01:21 at com.sonar.cpp.analyzer.ClangDriver.onCapture(ClangDriver.java:532)
16:01:21 at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(CompilerDrivers.java:36)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.lambda$process$37(CFamilySensor.java:1447)
16:01:21 at com.sonar.cpp.plugin.CompileCommandsReader.readCaptures(CompileCommandsReader.java:61)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:1445)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.processConfigurationReader(CFamilySensor.java:750)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.lambda$process$4(CFamilySensor.java:468)
16:01:21 at java.base/java.lang.Iterable.forEach(Iterable.java:75)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:468)
16:01:21 at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:241)

I turned on more debug output but there is no additional info produced.

I tried adding CLANG_USE_RESPONSE_FILE=NO to xcodebuild command and that seems to work around this problem but I suspect this is some kind of Xcode15.4+ incompatibility with the scanner given that 15.2 works without any problems. Nothing else has been changed.

Not sure what else I can provide to help resolve this issue.

Hi,

Can you upgrade to the current version, SonarQube 10.7, and see if this is still replicable?

 
Thx,
Ann

Hi @michalszelagsonos,

I confirm what @ganncamp mentioned; It is fixed in 10.7; you will no longer need CLANG_USE_RESPONSE_FILE=NO.

XCode, started to use response files starting 15.3 And we started supporting response files recently: [CPP-3572] - Jira

Thanks,

2 Likes

Great, I will need to check with my admin to see when we’re scheduled for the next upgrade but we do upgrade on regular basis so once we do, I will be able to verify this in my environment. Thank you for the fast response on this!