I would like for external dependencies to have default dependency caching only for those platforms that are explicitly specified in the external dependency’s Package.swift file or based on PackageSettings.productDestinations
.
For some reason, when generating an Xcode project, PackageInfoMapper automatically sets all sorts of destinations for external dependencies, which seems a bit premature.
This also led to some bugs intermittently related to MacCatalyst support, causing some packages to fail to compile: GitHub · Where software is built
I also encountered this problem when trying to cache the SDK which is included via Tuist/Package.swift
(via .package(path:)
)
Building scheme Binaries-Cache-iOS for Mac Catalyst
note: Using codesigning identity override:
⚠️ Target 'VendorPlayerSDK' does not support any of the imposed platforms 'macosx' and a single platform could not be chosen from its own supported platforms 'appletvos appletvsimulator iphoneos iphonesimulator'. For backwards compatibility, it will be built for macOS.
...
...
❌ path/to/vendor-sdk/Modules/SomeModule/Source/Models/ActivityIndicatorComponentStyle.swift:8:8: no such module 'UIKit'
⚠️ `DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER` is not supported. Remove the build setting and conditionalize `PRODUCT_BUNDLE_IDENTIFIER` instead. (in target 'Storage' from project 'VendorPlayerSDK')
⚠️ `DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER` is not supported. Remove the build setting and conditionalize `PRODUCT_BUNDLE_IDENTIFIER` instead. (in target 'PlaylistModule' from project 'VendorPlayerSDK')