Problems compiling xcframeworks using Carthage with the latest Xcode beta

I use Carthage to build a set of dependencies. I generate .xcframework files with code for both macOS and iOS. This works through Xcode 26 beta 4. With Xcode 26 beta 5, the resulting .xcframework files seem to have code only for iOS, not macOS. Each framework has a ios-arm64 directory and a ios-arm64_x86_64-simulator directory, but no macos-arm64_x86_64 directory.

This is affecting 3 of my 7 cross-platform dependencies that I compile with Carthage. What those 3 seem to have in common is that each has one target and scheme for the shared library – instead of one for iOS and another for macOS.

I may have to create a second scheme and target in each of these dependencies, or move to SPM. But I am wondering if anyone has another suggestion.

Thank you.

John

Are you able to reproduce this with just the xcodebuild commands, without any reliance on Carthage as part of the build process? If so, what are those exact commands? A test project that shows this off is even better if you can create one.

— Ed Ford,  DTS Engineer

Thank you for the reply. I am still working my way through this, but I have figured out at least one Xcode behavior change that appears to trigger the issue.

Take RSParser:

https://github.com/Ranchero-Software/RSParser

It moved away from Xcode projects entirely, but at this commit it had an Xcode project I could build with Carthage: fcbd9a34ecd8c080c6f26798a4b22ea0c98d8e74

Carthage runs this command to get a list of build settings:

xcodebuild -project RSParser.xcodeproj -scheme RSParser -configuration Release archive -showBuildSettings -skipUnavailableActions

With Xcode 26 beta 4, the output had: LLVM_TARGET_TRIPLE_OS_VERSION = macos10.13

With Xcode 26 beta 5, the output has: LLVM_TARGET_TRIPLE_OS_VERSION = ios13.0

This appears to be what makes Carthage not build the .xcframework for macOS.

John

Investigating further, it appears that Carthage does not specify the -sdk when compiling for macOS. It does for other platforms. Carthage has good documented reasons for this.

It looks Xcode 26 beta 4 and earlier assumed the platform was macOS when it was ambiguous, and Xcode 26 beta 5 does not.

I described the issue in more detail in a Carthage ticket: https://github.com/Carthage/Carthage/issues/3399

Would a an FB also make sense?

John

Would a an FB also make sense?

Since there's a significant behavior change here between neighboring beta versions, yes, that would be helpful in case there's something unusual happening here that we need to look at. Please pose the FB number here for reference.

Investigating further, it appears that Carthage does not specify the -sdk when compiling for macOS

The general recommendation these days is not to use -sdk, but to use -destination specifiers instead. That's because when compiling for a XCFramework that runs on macOS, you might be using the macOS SDK, or the iOS SDK via Mac Catalyst, which cannot be correctly expressed outside of the -destination option. I've made sure this is in the documentation, as I see folks make mistakes by using the -sdk option often.

— Ed Ford,  DTS Engineer

Thank you, Ed! I will experiment with the -destination specifier.

I filed FB19691776 about the change in behavior.

John

Problems compiling xcframeworks using Carthage with the latest Xcode beta
 
 
Q