invertase / firestore-ios-sdk-frameworks

⚡ Precompiled Firestore iOS SDKs extracted from the Firebase iOS SDK repository release downloads for faster build times.
Apache License 2.0
448 stars 49 forks source link

Allow patch updates to dependencies? #115

Open ChaseGuru opened 2 weeks ago

ChaseGuru commented 2 weeks ago

I was getting an error when trying to add:

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.4.0'

When it works fine with my Podfile locking - Firebase/Firestore (11.4.0): and - Firebase/Firestore (11.4.0):.

My iOS minimum deployment target is 13.0 Podfile:

platform :ios, '13.0'

...

And every instance of deployment target in the pbx project is: IPHONEOS_DEPLOYMENT_TARGET = 13.0;

But I get this error doing a pod install:

firebase_crashlytics: Using Firebase SDK version '11.4.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "FirebaseCoreExtension":
  In snapshot (Podfile.lock):
    FirebaseCoreExtension (= 11.4.1, ~> 11.4)

  In Podfile:
    FirebaseCoreExtension (= 11.0.0)

Specs satisfying the `FirebaseCoreExtension (= 11.0.0), FirebaseCoreExtension (= 11.4.1, ~> 11.4)` dependency were found, but they required a higher minimum deployment target.

I swear that was happening with pod update or when I removed the podfile.lock alike, and it was throwing me off because it sounds like it's saying it wants me to upgrade my deployment target for iOS.

Though, if I manually specify FirebaseCoreExtension 11.4.0, it works.

  pod 'FirebaseCoreExtension', '11.4.0'
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.4.0'

But resetting, it's now working if I pod update or rm Podfile.lock. I'm not sure what changed, BUT at this point it seems like the error is just because I had resolved 11.4.1 and your package requires 11.4.0 specifically.

It still seems like a bad cocoapods error, i would expect something like:

In compatible requirements `FirebaseCoreExtension (= 11.4.1, ~> 11.4), FirebaseCoreExtension (= 11.4.0)`

but maybe this is the typical error :shrug:

Request: So perhaps some of this was me being dumb somehow and not doing pod update/removing the Pod lock like I thought, though it also seems like it may be good for the package to be allowing patch updates:

In addition to the logic operators CocoaPods has an optimistic operator ~>:

'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher

Since I suspect your package isn't actually incompatible with for example 11.4.1. So perhaps:

  s.dependency 'FirebaseCore', firebase_firestore_version
  s.dependency 'FirebaseCoreExtension', firebase_firestore_version
  s.dependency 'FirebaseFirestoreInternalBinary', firebase_firestore_version
  s.dependency 'FirebaseSharedSwift', firebase_firestore_version

Should be something like:

  s.dependency 'FirebaseCore', "~> #{firebase_firestore_version}"
  s.dependency 'FirebaseCoreExtension', "~> #{firebase_firestore_version}"
  s.dependency 'FirebaseFirestoreInternalBinary', "~> #{firebase_firestore_version}"
  s.dependency 'FirebaseSharedSwift', "~> #{firebase_firestore_version}"
mikehardy commented 2 weeks ago

We've had problems with optimistic locking letting versions slip and creating unexpected problems with transitives breaking builds, so they're exact in purpose. I thought they would be better as well but in practice, over a long enough time scale, it has caused us problems

mikehardy commented 2 weeks ago

Here is the problem I mention, for posterity - which was actually an incompatibility with an untested patch release:

https://github.com/firebase/flutterfire/issues/13527