spm: enable Mac Catalyst for FirebasePerformance and FirebaseInAppMessaging (discussion) - #16468
spm: enable Mac Catalyst for FirebasePerformance and FirebaseInAppMessaging (discussion)#16468mikehardy wants to merge 1 commit into
Conversation
…ng targets Under SPM, the Wrap-based targets for FirebasePerformance and FirebaseInAppMessaging gate their real product dependencies with `.when(platforms: [.iOS, ...])` that omits `.macCatalyst`. On Mac Catalyst, SPM therefore only links the `SwiftPM-PlatformExclude/*Wrap` dummies (`FirebasePerformanceTarget.o` / `FirebaseInAppMessagingTarget.o`) and never compiles the real modules. This is speculative / discussion-only: draft PR asking whether the Catalyst exclusion under SPM was intentional. CocoaPods consumers with Mac Catalyst apps have historically been able to compile and link these products via the iOS podspec slice through the `Firebase/Firebase.h` umbrella, so the current SPM behavior is a divergence from that historical path. Package.swift already declares `.macCatalyst(.v15)` in `Package.platforms` and uses `.macCatalyst` alongside `.iOS` / `.tvOS` / `.macOS` for many other targets, so this change follows existing style. Source-level compile fitness on Catalyst is not verified by this change: FirebasePerformance's Objective-C sources already special-case `TARGET_OS_MACCATALYST` for CoreTelephony and FirebaseInAppMessaging's sources gate on `TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION` (TARGET_OS_IOS is 1 under Catalyst), but Google CI is the ground truth. App Distribution is intentionally left iOS-only. Consumer context: invertase/react-native-firebase#8933
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
Hey you all 👋 similar to my last post over here (on a Storage race condition thing) - I am driving an agent harness to post this stuff, but I'm doing my best to make sure it's not slop ;-) This is a real question, and macCatalyst really did seem to work for these products via Cocoapods. It also compiled and appeared to work for App Distribution via Cocoapods but on reflection that didn't seem to make sense (App Distribution for a "desktop app" isn't really a thing is it? Even if getting to "desktop" from "ios compat" which is how I think of the macCatalyst build type) So I didn't propose for App Distribution, but perf and in-app-messaging seem like they should be okay Also similar to before I get completely snowed under by github notifications but I would love to collaborate if it's useful and am available via direct pings in email or gmail chat or similar Cheers |
|
Thanks, @mikehardy! At this time, I would prefer not to expand our supported surface area for Performance and In-App Messaging. Since neither product is currently supported on macOS (as seen in our CocoaPods distribution), adding Mac Catalyst support would result in a configuration that's largely untested. These platform gaps are currently documented at https://firebase.google.com/docs/ios/learn-more, and more assessment would need to be done to determine how these products fit into a desktop experience. |
|
Understood - supported surface area is definitely different than saying "it compiled" and macCatalyst is definitely niche. Closed and I'll edit related comments in rnfb before merge to remove uncertainty. Thanks |
Summary
Under SPM on Mac Catalyst, the umbrella
.targetentriesFirebasePerformanceTargetandFirebaseInAppMessagingTargetgate their real product dependencies with.when(platforms: [.iOS, ...])that omits.macCatalyst. The consequence is that a Mac Catalyst app that listsFirebasePerformance/FirebaseInAppMessagingas SPM products only links the emptySwiftPM-PlatformExclude/*Wrapdummies (FirebasePerformanceTarget.o/FirebaseInAppMessagingTarget.o) and never compiles the real modules.This draft adds
.macCatalystto the platform conditions for Performance and In-App Messaging wrap-target dependencies. Firebase App Distribution is intentionally left iOS-only in this draft (App Distribution's model is genuinely iOS-tester-only).Concretely:
.target( name: \"FirebaseInAppMessagingTarget\", dependencies: [ - .target(name: \"FirebaseInAppMessaging\", condition: .when(platforms: [.iOS, .tvOS])), + .target(name: \"FirebaseInAppMessaging\", + condition: .when(platforms: [.iOS, .tvOS, .macCatalyst])), ], path: \"SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap\" ), ... .target( name: \"FirebasePerformanceTarget\", dependencies: [.target(name: \"FirebasePerformance\", - condition: .when(platforms: [.iOS, .tvOS, .visionOS]))], + condition: .when(platforms: [.iOS, .tvOS, .visionOS, .macCatalyst]))], path: \"SwiftPM-PlatformExclude/FirebasePerformanceWrap\" ),The Package already declares
.macCatalyst(.v15)in `Package.platforms` and uses.macCatalystalongside.iOS/.tvOS/.macOSfor many other targets (Auth, Firestore, Analytics helpers, GoogleAppMeasurementIdentitySupport, etc.), so the style matches existing precedent in the same file.Questions for maintainers
.macCatalystforFirebasePerformanceTargetandFirebaseInAppMessagingTargetunder SPM intentional and permanent?s.ios+s.tvos, and Catalyst apps consuming those via CocoaPods historically got the iOS slice through theFirebase/Firebase.humbrella — so this is asking why SPM diverges.Compile fitness note (speculative — please treat as discussion)
I have not verified full build-and-link of a Catalyst target against this Package.swift on Google's CI matrix. Notes on source-level fitness:
```objc
#if __has_include("CoreTelephony/CTTelephonyNetworkInfo.h") && !TARGET_OS_MACCATALYST
```
and
MobileCoreServices/QuartzCorelink settings are already.when(platforms: [.iOS, .tvOS])(Catalyst has both frameworks available)..msources gate onTARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_VISION.TARGET_OS_IOSis 1 under Mac Catalyst (Catalyst is an iOS-derived variant), so these guards should pass on Catalyst. There is a separateFirebaseInAppMessaging_iOSsub-target (resources) that is.when(platforms: [.iOS])and remains iOS-only; I did not attempt to broaden it here.If Google CI reveals additional source-level Catalyst issues (availability annotations, missing UIKit-on-macOS APIs, IAM display flows, etc.) I'm happy to iterate on this branch, or to close it and let the team address it in whatever way fits your roadmap. The main ask is the policy question above.
Consumer context (why this came up)
React Native Firebase supports Mac Catalyst demos in its release qualification. In
invertase/react-native-firebase#8933we're qualifying an SPM-first path (SPM as the default resolver). On Catalyst:@import FirebasePerformance;/@import FirebaseInAppMessaging;therefore fail to compile on Catalyst.Firebase/Firebase.humbrella. So this worked historically without any RNFB-side change.We're going to land RNFB-side stubs on Catalyst for those two products regardless (mirroring what App Distribution already does), and cite this PR from those stub comments. But the root question — whether upstream SPM's exclusion is intentional — belongs here.
Related: invertase/react-native-firebase#8933.
Not in scope