leavez / cocoapods-binary

integrate pods in form of prebuilt frameworks conveniently, reducing compile time
MIT License
1.3k stars 207 forks source link

all_binary! works incorrectly with :binary => false #81

Open apstygo opened 5 years ago

apstygo commented 5 years ago

Environment:

CocoaPods : 1.7.2
Xcode : 10.2.1 (10E1001)
cocoapods-binary      : 0.4.4
plugin('cocoapods-binary')

Problem

Using all_binary! and setting :binary => false for select pods doesn't work the same way as setting :binary => true for the pods I want to prebuild.

So this does not build:

plugin('cocoapods-binary')
platform(:ios, '11.0')

target 'rubeacon-app' do
  use_frameworks!
  all_binary!

  # Core
  pod('RxSwift', '~> 5.0')
  pod('RxCocoa', '~> 5.0')
  pod('RxDataSources', '~> 4.0')
  pod('Moya/RxSwift', git: 'https://github.com/Moya/Moya', tag: '14.0.0-alpha.1')
  pod('Swinject', '~> 2.0')

  # Push Notifications
  pod('Firebase/Core', '~> 6.0', binary: false)
  pod('Firebase/Messaging', '~> 6.0', binary: false)

  # Convenience
  pod('InputMask', '~> 4.0')
  pod('SDWebImage', '~> 5.0')
  pod('RxAppState', '~> 1.0')

end

Result:

Screenshot 2019-06-20 at 20 44 54

While this builds perfectly fine:

plugin('cocoapods-binary')
platform(:ios, '11.0')

target 'rubeacon-app' do
  use_frameworks!

  # Core
  pod('RxSwift', '~> 5.0', binary: true)
  pod('RxCocoa', '~> 5.0', binary: true)
  pod('RxDataSources', '~> 4.0', binary: true)
  pod('Moya/RxSwift', git: 'https://github.com/Moya/Moya', tag: '14.0.0-alpha.1', binary: true)
  pod('Swinject', '~> 2.0', binary: true)

  # Push Notifications
  pod('Firebase/Core', '~> 6.0')
  pod('Firebase/Messaging', '~> 6.0')

  # Convenience
  pod('InputMask', '~> 4.0', binary: true)
  pod('SDWebImage', '~> 5.0', binary: true)
  pod('RxAppState', '~> 1.0', binary: true)

end
vineetshah commented 5 years ago

I am experiencing something similar. Using all_binary! along with :binary => false results in the the non-binary frameworks missing their source files in the project.

wangchou commented 4 years ago

I met the same issue on Firebase pods, too.

meccatol commented 4 years ago

when we use it with 'all_binary!', it try binary build sub pods of our specific pod. thus we need to not use 'all_binary' and should to use with ':binary => true' option.

TheCoordinator commented 4 years ago

Hi there, do we have any updates on this?

cnadeau commented 3 years ago

a bit late, but I ran into the exact same issue in case it might help someone

It's caused by cocoapods-binary that will precompile ALL pods not EXPLICITLY DEFINED in the Podfile.

if you simply add

pod 'Firebase', :binary => false

It will still precompile ALL its depdencies...

in order to avoid that, you would have to explicitly add all the dependencies of Firebase in your Podfile

This is the method I ended up building make sure verything is built by XCode (we use Crashlytics, you might need less than these):

# firebase is a special case: we can't just precompile everything in it and we can't
# simple set Firebase, :binary => false when using all_binary!
# all deps must be explicitly excluded in order for Firebase and its dep to be excluded
def pod_firebase
  pod 'Firebase'                             , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAnalytics'                    , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAnalyticsInterop'             , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAuth'                         , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAuthInterop'                  , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCore'                         , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCoreDiagnostics'              , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCoreDiagnosticsInterop'       , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCrashlytics'                  , :inhibit_warnings => true, :binary => false
  # binary false because it's required for the build phase script to execute
  pod 'FirebaseCrashlytics'                  , :inhibit_warnings => true, :binary => false
  pod 'FirebaseFirestore'                    , :inhibit_warnings => true, :binary => false
  pod 'FirebaseInstanceID'                   , :inhibit_warnings => true, :binary => false
  pod 'FirebaseInstallations'                , :inhibit_warnings => true, :binary => false

  pod 'GoogleAppMeasurement'                 , :inhibit_warnings => true, :binary => false
  pod 'GoogleDataTransport'                  , :inhibit_warnings => true, :binary => false
  pod 'GoogleDataTransportCCTSupport'        , :inhibit_warnings => true, :binary => false
  pod 'GoogleUtilities'                      , :inhibit_warnings => true, :binary => false
  pod 'GTMSessionFetcher'                    , :inhibit_warnings => true, :binary => false

  pod 'abseil'                               , :inhibit_warnings => true, :binary => false
  pod 'BoringSSL-GRPC'                       , :inhibit_warnings => true, :binary => false
  pod 'gRPC-C++'                             , :inhibit_warnings => true, :binary => false
  pod 'gRPC-Core'                            , :inhibit_warnings => true, :binary => false
  pod 'leveldb-library'                      , :inhibit_warnings => true, :binary => false
  pod 'PromisesObjC'                         , :inhibit_warnings => true, :binary => false
  pod 'nanopb'                               , :inhibit_warnings => true, :binary => false
  pod 'nanopb/decode'                        , :inhibit_warnings => true, :binary => false
  pod 'nanopb/encode'                        , :inhibit_warnings => true, :binary => false
end
sisoje commented 3 years ago

a bit late, but I ran into the exact same issue in case it might help someone

It's caused by cocoapods-binary that will precompile ALL pods not EXPLICITLY DEFINED in the Podfile.

if you simply add

pod 'Firebase', :binary => false

It will still precompile ALL its depdencies...

in order to avoid that, you would have to explicitly add all the dependencies of Firebase in your Podfile

This is the method I ended up building make sure verything is built by XCode (we use Crashlytics, you might need less than these):

# firebase is a special case: we can't just precompile everything in it and we can't
# simple set Firebase, :binary => false when using all_binary!
# all deps must be explicitly excluded in order for Firebase and its dep to be excluded
def pod_firebase
  pod 'Firebase'                             , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAnalytics'                    , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAnalyticsInterop'             , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAuth'                         , :inhibit_warnings => true, :binary => false
  pod 'FirebaseAuthInterop'                  , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCore'                         , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCoreDiagnostics'              , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCoreDiagnosticsInterop'       , :inhibit_warnings => true, :binary => false
  pod 'FirebaseCrashlytics'                  , :inhibit_warnings => true, :binary => false
  # binary false because it's required for the build phase script to execute
  pod 'FirebaseCrashlytics'                  , :inhibit_warnings => true, :binary => false
  pod 'FirebaseFirestore'                    , :inhibit_warnings => true, :binary => false
  pod 'FirebaseInstanceID'                   , :inhibit_warnings => true, :binary => false
  pod 'FirebaseInstallations'                , :inhibit_warnings => true, :binary => false

  pod 'GoogleAppMeasurement'                 , :inhibit_warnings => true, :binary => false
  pod 'GoogleDataTransport'                  , :inhibit_warnings => true, :binary => false
  pod 'GoogleDataTransportCCTSupport'        , :inhibit_warnings => true, :binary => false
  pod 'GoogleUtilities'                      , :inhibit_warnings => true, :binary => false
  pod 'GTMSessionFetcher'                    , :inhibit_warnings => true, :binary => false

  pod 'abseil'                               , :inhibit_warnings => true, :binary => false
  pod 'BoringSSL-GRPC'                       , :inhibit_warnings => true, :binary => false
  pod 'gRPC-C++'                             , :inhibit_warnings => true, :binary => false
  pod 'gRPC-Core'                            , :inhibit_warnings => true, :binary => false
  pod 'leveldb-library'                      , :inhibit_warnings => true, :binary => false
  pod 'PromisesObjC'                         , :inhibit_warnings => true, :binary => false
  pod 'nanopb'                               , :inhibit_warnings => true, :binary => false
  pod 'nanopb/decode'                        , :inhibit_warnings => true, :binary => false
  pod 'nanopb/encode'                        , :inhibit_warnings => true, :binary => false
end

thanks, this fixes the problem, but dependencies are still build even though they are not used... its kind of slow