Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Firestore] Combine Firestore and FirestoreSwift into a single module #11321

Closed
wants to merge 26 commits into from

Conversation

ncooke3
Copy link
Member

@ncooke3 ncooke3 commented May 23, 2023

This is experimental and not for merging.

Context

  • Merged the FirestoreSwift pod into the Firestore pod

    • This merge led to a problem we haven't seen before. We had an xcframework containing a .swiftmodule (FirebaseFirestore) exporting API from a source Swift target (SharedSwift). The issue is that FirebaseFirestore's .swiftmodule file is built with BUILD_LIBRARY_FOR_DISTRIBUTION=YES (this is required; see https://forums.developer.apple.com/thread/125646), but is trying to export a type (see the FirebaseSharedSwift's FirebaseData(En|De)Coder types in Firestore's Swift source) from a Swift module (FirebaseSharedSwift) that isn't built BUILD_LIBRARY_FOR_DISTRIBUTION=YES (this is because SPM does not offer a way to set BUILD_LIBRARY_FOR_DISTRIBUTION=YES for source targets). The issue surfaces during the linking phase and materializes in a several undefined symbol errors from the FirebaseSharedSwift module (as ABI stable symbols cannot be found). The solution is to convert FirebaseSharedSwift's release distribution from source to binary, since binaries give allows us to set BUILD_LIBRARY_FOR_DISTRIBUTION=YES.
  • Built an xcframework from the combined Firestore pod

    Expand to see the `zip-builder` invocation
    sudo xcode-select -s /Applications/Xcode_13.3.1.app 
    swift run --package-path ReleaseTooling zip-builder \                                                                                              (1.181s) 
      --disable-build-dependencies \
      --disable-carthage-version-check \
      --no-dynamic \
      --keep-build-artifacts \
      --no-update-pod-repo \
      --pods FirebaseFirestore \
      --local-podspec-path /Users/nickcooke/Developer/firebase-ios-sdk/
    
  • Manually tested SPM integration with the Firestore QS

Remaining Work

  • Update QS to handle this
  • Decide what to do to existing FirestoreSwift changelog
  • Add changelog entry for this new change

@github-actions
Copy link
Contributor

github-actions bot commented May 23, 2023

✅  No API diff detected

Commit: 08bb33e
Last updated: Fri May 26 11:18 PDT 2023
View workflow logs & download artifacts


@ncooke3
Copy link
Member Author

ncooke3 commented May 26, 2023

Checkpoint– 995e536 has all tests except expected QS failure.

@ncooke3
Copy link
Member Author

ncooke3 commented May 26, 2023

At this point, the only remaining FirestoreSwift mentions are as followed.

➜  firebase-ios-sdk git:(nc/firestore-flatten) 
‣ git grep 'FirestoreSwift'
CoreOnly/NOTICES:FirebaseFirestoreSwift
FirebaseCore/CHANGELOG.md:  Podfile like `pod 'FirebaseFirestoreSwift', '~> 7.0-beta'`.
Firestore/CHANGELOG.md:  `FirebaseFirestoreSwift` module dependency to your build target (#9426).
Firestore/Swift/CHANGELOG.md:- [added] **Breaking change:** `FirebaseFirestoreSwift` has exited beta and is
Firestore/Swift/CHANGELOG.md:- [changed] FirebaseFirestoreSwift now requires a minimum iOS version of 11 for

@ncooke3
Copy link
Member Author

ncooke3 commented Oct 6, 2023

Closing in favor of #11806

@ncooke3 ncooke3 closed this Oct 6, 2023
@firebase firebase locked and limited conversation to collaborators Nov 6, 2023
@ncooke3 ncooke3 deleted the nc/firestore-flatten branch December 19, 2023 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants