SonarCloud Analysis for an Xcode Project on macOS

Hi everyone,

I’m trying to setup analysis for an Xcode project using Objective-C and Swift.
I’m using the build wrapper but the build-wrapper-dump.json is almost empty:
{
“version”:“6.55”,
“captures”:[
]}

In the build-wrapper.log I get this:
Thu May 23 17:14:52 2024: argv[9]:
Thu May 23 17:14:52 2024: argv[10]:
Thu May 23 17:14:52 2024: skipping process with pid: 15291
Thu May 23 17:17:12 2024: finalizing json file
Thu May 23 17:17:12 2024: returned with code: 0

Any ideas on how to make it work?

Thanks

Hey there.

Can you share the command you’re using to trigger the build wrapper / build?

Hi,

Thanks for the quick reply!

sure:

build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir . xcodebuild -sdk iphoneos -configuration Debug -workspace Project.xcworkspace -scheme BSmart clean build

Thanks! And I should have asked this before, but what version of XCode are you using?

I’m using Xcode 15.2 on 2 machines with the same result. A Macbook Pro Intel macOS 14.5 and a Mac mini M1 on macOS 14.3.1.

Looks like you’re facing CPP-4941

There’s a workaround documented in the ticket.

Thanks!

The build wrapper succeeds now and produces a non empty json file.
(using the JSON Compilation Database workaround)

I would suggest a new topic, if that’s fine with you :pray:

Will do that.
One suggestion: given that Xcode 15 is now the only accepted version for new/updated apps on the app Store, could it be possible to add this limitation and workaround for the build-wrapper in the documentation? I believe it would be helpful (and save you some time)

Thank you for your help :blush:

Let me ask some friends :wink:

Hi @Abdennour and thanks for sharing your suggestion,

We are working on addressing this limitation so that build-wrapper can work with SIP enabled.

In the meantime, we don’t want to encourage users to disable SIP in the docs, but we will consider adding some information about build-wrapper and XCode 15 instead.

Thanks for taking the time to share your feedback. :pray:

Best regards,
Michael

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