Skip to content

Firestore and Swift Package Manager #6072

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

Merged
merged 12 commits into from
Aug 1, 2020
Merged

Firestore and Swift Package Manager #6072

merged 12 commits into from
Aug 1, 2020

Conversation

paulb777
Copy link
Member

@paulb777 paulb777 commented Jul 17, 2020

Current status is a successful build and run of the Firestore quickstart.

Next steps are to consider merging to master to facilitate early evaluation and to continue conversations about dependency open questions

Dependency Summary:

General porting notes:

  • Using Xcode 12 beta 2
  • Started with a master snapshot except boringssl and gRPC which branched from the versions currently depended upon by Firestore via CocoaPods
  • Strong preference to organize by directories, along with excludes to avoid major performance issues from listing files.
  • Detailed review of excludes needed. Prototype is a minimally sufficient implementation
  • Strategy for keeping Package.swift files up-to-date needed

boringssl - branched from January 22 version

  • Package.swift
  • TODO: Renaming strategy to avoid symbol collisions with other openssl libraries.

grpc - gRPC-Core 1.28.2 gRPC-C++ 1.28.2 - tagged May 20

  • Package.swift
  • Also created two directories to disentangle the public includes for the two libraries from the repo. The directories symbolic link to the public headers.

absl - branched from master July 13

  • Package.swift
  • First tried to match CocoaPods multiple-subspec target approach, but gave up due to circular dependencies and SwiftPM not supporting header-only targets
  • Added #pragma clang diagnostic ignored "-Wmodules-import-nested-redundant" to workaround build error

leveldb - PR

Screen Shot 2020-07-29 at 12 05 32 PM

@paulb777 paulb777 marked this pull request as draft July 17, 2020 23:44
@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

.product(name: "gRPC-cpp", package: "gRPC"),
],
path: "Firestore",
exclude: [
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are all these entries necessary? Shouldn't this only consist of things that would otherwise match the sources list?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's everything under Firestore that is not in sources. A better directory structure for SPM would be putting all sources in one directory. I've sorted the list now.

Package.swift Outdated
.headerSearchPath("../"),
.headerSearchPath("Source/Public"),
.headerSearchPath("Protos/nanopb"),
.headerSearchPath("Protos/objc/google/api"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is obsolete: we no longer use Objective-C protocol buffers

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed here and in the podspec

@@ -84,14 +96,18 @@ let package = Package(
url: "https://github.com/paulb777/nanopb.git",
.revision("849a9b82233aaa5af4286c6c594cd831ca48651c")
),
.package(
name: "abseil",
url: "https://github.com/paulb777/abseil-cpp.git",
Copy link
Contributor

Choose a reason for hiding this comment

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

For the purposes of internal experimentation this seems reasonable, but I don't think we should publish this to end users until we've settled how we're going to actually make these dependencies work. The outcome I don't want is that we end up stuck maintaining these ourselves because we've conditioned enough users to use Firestore via SPM that we can't call the experiment a failure.

Copy link

@nidegen nidegen Aug 1, 2020

Choose a reason for hiding this comment

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

Side note: I wouldn't be surprised to see SPM establish itself as a C++ dependecy manager, even if it currently lacks features vs CMake. Looking forward to see how Windows support in 5.3 will push that. I also would love to see Android NDK support Swift/SPM..

@paulb777
Copy link
Member Author

I'll make a separate PR for the nanopb change after it tests here.

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

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

LGTM

@wilhuff wilhuff assigned paulb777 and unassigned wilhuff Jul 31, 2020
@paulb777 paulb777 merged commit e69c701 into master Aug 1, 2020
@paulb777 paulb777 deleted the pb-spm-firestore branch August 1, 2020 15:43
@firebase firebase locked and limited conversation to collaborators Sep 1, 2020
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.

5 participants