Skip to content

feat: [SDK-4998] enable KMP logger on Mac Catalyst - #1714

Open
fadi-george wants to merge 2 commits into
fadi/sdk-4978from
fadi/sdk-4998
Open

feat: [SDK-4998] enable KMP logger on Mac Catalyst#1714
fadi-george wants to merge 2 commits into
fadi/sdk-4978from
fadi/sdk-4998

Conversation

@fadi-george

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Enables the shared KMP logger when the iOS SDK is built for Mac Catalyst.

Details

Motivation

Mac Catalyst builds currently use a no-op remote logger because the KMP XCFramework does not expose a Catalyst slice. With the Catalyst slice added in OneSignal-KMP-SDK#18, the iOS SDK can compile, link, and run the shared logging pipeline on Catalyst.

Scope

  • Removes the Catalyst exclusions from the Swift KMP logger adapters.
  • Links the Mac Catalyst slice from OneSignalKMP.xcframework.
  • Adds CI verification for both Catalyst architectures and Mach-O platform metadata.
  • Archives OneSignalOSCore for Catalyst and runs a small host that exercises log, flush, and shutdown.
  • Stacked on SDK-4978.

Testing

Unit testing

No new unit tests are needed for the platform guards and Xcode link settings. CI adds a Catalyst runtime host that exercises the KMP logger adapters end to end.

Manual testing

  • Rebuilt and verified the KMP XCFramework with arm64 and x86_64 Mac Catalyst slices.
  • Archived OneSignalOSCore for generic/platform=macOS,variant=Mac Catalyst.
  • Compiled and ran the Catalyst logger host successfully.
  • Ran 23 focused crash-handler and logger-adapter tests successfully on the stacked base.
  • SwiftLint reported no violations in the changed source files; the repository-wide local run encountered existing generated demo build-file violations.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multimodal adversarial review (interrogate)

Verdict: request changes. The Catalyst enablement is not self-consistent at this head: CI already fails, and the next steps would fail for independent reasons.

Intent

Enable the shared KMP remote logger on Mac Catalyst by removing #if !targetEnvironment(macCatalyst) no-ops, linking the Catalyst XCFramework slice, and adding CI that verifies the slice, archives OneSignalOSCore for Catalyst, and runs a host through log/flush/shutdown.

Reviewers

  • A: claude-fable-5-thinking-xhigh — 9 findings
  • B: gpt-5.6-sol-xhigh — 3 findings
  • C: cursor-grok-4.5-high-fast — 7 findings
  • D: claude-opus-5-thinking-high — 10 findings

Act On

  1. KMP gitlink not bumped (A/B/C/D). Head still pins OneSignal-KMP-SDK @ 72581f3, which only builds iosX64 / iosArm64 / iosSimulatorArm64. No ios-arm64_x86_64-maccatalyst slice exists. CI run 31646971241 already dies at lipo on the missing path. Removing the Catalyst stubs also means Catalyst archives (including build_all_frameworks.sh) will fail to import OneSignalKMP until the pin includes KMP #18.
  2. Host target arch ≠ runner arch (A/B/C/D). Job is macos-15-large (Intel; confirmed via JAVA_HOME_17_X64 in the failed run). Host is hardcoded to arm64-apple-ios14.0-macabi, then executed. After the slice exists, this step fails with bad CPU type.
  3. No shared OneSignalOSCore scheme (C; verified). Shared schemes have Core / UnitTestApp / etc., but not OneSignalOSCore. Archive uses -scheme OneSignalOSCore and will fail on a clean CI checkout once the prior step passes.
  4. Host never calls start() (A/B/C/D). HTTP send is gated by lifecycle.performIfTransportActive (isStarted). Without start(), flush completes as disabled while the semaphore still succeeds — false green for the stated log/flush/shutdown exercise.

Consider

  • Drop or co-land kotlinVersion / swiftVersion / additionalVersionAttributes with the KMP pin that actually declares them (A/C/D).
  • Move Catalyst Mach-O checks into KMP verifyOneSignalKMPXCFramework instead of duplicating lipo/ar/vtool in YAML (A/C/D).
  • Put FRAMEWORK_SEARCH_PATHS[sdk=macosx*] on OneSignalOSCore next to the iOS keys, not only project-level configs (A/C/D).
  • Prefer xcodebuild test of OneSignalOSCoreTests on Catalyst over a bespoke host (A/D).
  • Add a Catalyst platform discriminator so logs are not indistinguishable from iPad (sdkBase/UIDevice vs kern.osversion) (A/D).

Noted

  • "unavailable" preconditions are tautological after stub removal (A/D).
  • Leftover no-op OSRemoteLoggerProtocol.start() default (A).
  • Hardcoded slice path proliferation / [sdk=macosx*] broader than Catalyst (D).
  • Import/format leftovers from #if deletion (D).

Agreement map

All four models independently flagged the unpinned Catalyst slice and the host disabled/start() gap. Three+ flagged the Intel-vs-arm64 host target. Scheme absence and protocol-stub drift were lower fan-out but verified in-repo. No reviewer found the PR ready to merge as-is.

Skill: Cursor interrogate (pstack).

Open in Web View Automation 

Sent by Cursor Automation: Untitled

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread iOS_SDK/OneSignalSDK/CatalystLoggerHost/main.swift
Comment thread iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj Outdated
Pin the Catalyst-capable KMP artifact and exercise the active logger lifecycle on the CI runner architecture through a shared archive scheme.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant