How to disable caching depdendencies for Mac Catalyst

Question or problem

Is there any way to exclude the build under MacCatalyst when calling the tuist cache command?

Context

  • Tuist version: 4.39.1

I want to include GitHub - appmetrica/appmetrica-sdk-ios: AppMetrica SDK for iOS in my project and cache this dependency. This dependency is not supported by MacCatalyst

00:04:14.908  Generating project KSCrash
00:04:14.908  Generating project AppMetrica
00:04:14.908  Building cacheable targets
00:04:14.908  Building scheme Binaries-Cache-iOS for the simulator
00:04:14.908  Building scheme Binaries-Cache-iOS for Mac Catalyst
00:04:14.908  The 'xcodebuild' command exited with error code 65 and message:
00:04:14.908  ** BUILD FAILED **
00:04:14.908  
00:04:14.908  
00:04:14.908  The following build commands failed:
00:04:14.908  	CompileC /var/folders/dp/hrng4tf10_zcl2svj9b0h0gr0000gp/T/TemporaryDirectory.t6W4Yj/derived-data/Build/Intermediates.noindex/AppMetrica.build/Debug-maccatalyst/AppMetricaCore.build/Objects-normal/x86_64/AMAStartupClientIdentifierFactory.o /Users/jenkins/workspace/OkkoApp-PR-8370@11/Tuist/.build/checkouts/appmetrica-sdk-ios/AppMetricaCore/Sources/AMAStartupClientIdentifierFactory.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'AppMetricaCore' from project 'AppMetrica')
00:04:14.908  (1 failure)

Reproduction (mandatory for problems)

In Package.swift:

let package = Package(
    dependencies: [ 
         .package(
			url: "https://github.com/appmetrica/appmetrica-sdk-ios",
			exact: "5.9.0"
          ),
    ]
)

Run bash command:

tuist cache AppMetricaCore

Looks like even PackageSettings.productDestinations doesn’t allow to remove Mac Catalyst:

I also encountered an unusual result:

  1. If you first call the command tusit cache AppMetricaLog (this is a dependency of AppMetricaCore) - it is built successfully
  2. Then call tuist cache AppMetricaCore then caching also occurs successfully.

That is, if you do step-by-step caching manually, then everything works, but if you call the command to cache the root product, then an error occurs.

Note: AppMetricaCore has many dependent targets, but for some reason one was enough to fix the error

Try adding this to your Package.swift:

#if TUIST
import ProjectDescription
    
let packageSettings: PackageSettings = .init(
    baseSettings: .settings(
        base: [
            "SUPPORTS_MACCATALYST": "NO",
            "DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER": "NO"
        ],
        …
)
#endif
1 Like