Force Xcode to produce “universal” SPM dependency builds?

Hi all, I’m working with a large iOS app codebase that includes a mix of dependency types, including Carthage-built XCFrameworks and a number of older fat binary frameworks. The app’s build settings include EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64, allowing continued use of the older dependencies in Xcode 12 and later. As a result, when we run the app locally, it opens via Rosetta in an x86_64-based simulator.

We’re attempting to begin moving some dependencies over to SPM, but developers using ARM-based Macs now have a problem when building for the simulator. The SPM-based dependency build products are arm64-based, while those for the app are x86_64-based, due to the EXCLUDED_ARCHS setting mentioned above.

So for our developers using ARM-based Macs, builds are failing on import SomeDependency with the following:

Could not find module ‘SomeDependency’ for target ‘x86_64-apple-ios-simulator’; found: arm64, arm64-apple-ios-simulator

I haven’t found a way to get around this. Changing the Build Active Architecture Only build setting seemed potentially promising, but didn’t make a difference for SPM dependency builds in derived data. Is there a way I’ve missed that would force Xcode to produce “universal” SPM dependency builds?

Debug builds of packages are always enabling ONLY_ACTIVE_ARCH and there is currently no way to configure this differently.

Okay good to know! Thanks @NeoNacho.

Is there any update that would resolve this? Currently I can force the architecture for CocoaPods but not SPM dependencies.

@Jon889 did you find a solution to this?

Is there any update/solution on this?

Relevant: Restrict macOS builds to x86_64 with SPM