Unnecessary rebuild spm package on watchOS target for Debug configuration

We have a problem with undesirable rebuild with Debug configuration for watchOS target dependencies. There is a iOS project with watch extension target. Both have some SPM package dependency. Build Active Architecture Only for Debug is Yes for both app/extension targets. When build app, watch target is building not only for active arch(arm64) but also i386/x86_64. It can be fixed by adding Excluded Architectures = i386 x86_64 for watch target. But it don't help to avoid rebuild SPM package dependency for this architectures.

This can happen when no platforms are specified in the package manifest. Without the platform array in the package manifest, the package is built to support the widest deployment range that Xcode supports for that platform. Xcode 16 still supports watchOS 4 as a deployment target. So while it's no longer possible to run watchOS 4 in a simulator (see the Xcode Support page for the supported versions), Xcode still builds for the simulators that supported watchOS 4 in the past due to the deployment target still being supported, and some of these simulators used the i386 architecture. If you only support more recent watchOS deployment targets, you should specify that in the package manifest, and Xcode will then build the appropriate architecture mix for that more limited range of watchOS versions.

—Ed Ford,  DTS Engineer

Thank you! After specify platforms in package manifest it stop to rebuild for i386. But still rebuild for x86_64. Any ways we can avoid it too?

There isn't a way to avoid that in your package target through the use of the Build Active Architecture Only build setting at the watchOS app target level, which I presume is what you're expecting. That would make a nice enhancement request, so I encourage you to open that request and post the FB number here for posterity.

—Ed Ford,  DTS Engineer

Unnecessary rebuild spm package on watchOS target for Debug configuration
 
 
Q