grab / cocoapods-binary-cache

MIT License
474 stars 68 forks source link

Disable cloning of the spec repo #102

Closed Mattijah closed 2 years ago

Mattijah commented 2 years ago

Is there a way to disable cloning of the spec repo?

Cloning spec repo cocoapods from https://github.com/CocoaPods/Specs.git

I'm running cocoapods-binary-cache on the CI with all the Pods already available and the cloning of the spec repo is taking 10 minutes to run, which is acceptable. I haven't found an option for disabling it. Is it possible?

trinhngocthuyen commented 2 years ago

Hi @Mattijah, Just to be clear, the specs cloning is the behavior of CocoaPods, not this plugin.

AFAIK, CocoaPods introduced CDN support a while ago https://blog.cocoapods.org/CocoaPods-1.7.2#usage. With this, the specs are fetched pretty much faster, via CDN, rather than cloning the spec master repo.

I would suggest revising your setup and making sure CDN/trunk is in place.

Mattijah commented 2 years ago

Hey @trinhngocthuyen. Thank you for your reply. Yeah, I know that this is behaviour of CocoaPods however the only command I run is the following bundle exec pod binary prebuild so I thought maybe you're triggering it in the library or something... Is that not the case?

2022-03-30T22:21:36.1939780Z -----------------------------------------
2022-03-30T22:21:36.1940180Z 🚀  Prebuild frameworks
2022-03-30T22:21:36.1940540Z -----------------------------------------
2022-03-30T22:21:36.1940730Z 
2022-03-30T22:21:36.1940850Z Detect implicit dependencies
2022-03-30T22:21:36.1941220Z Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
2022-03-30T22:32:20.5748700Z Exclude pods with empty source files: [...]
trinhngocthuyen commented 2 years ago

The plugin calls resolve_dependencies for cache validation: pre_install.rb#L61-L62. This method from CocoaPods takes care of cloning specs. So, whether CDN or master repo is being used is inside this method. If backed by the CDN, this step should be lightweight :)

Mattijah commented 2 years ago

Adding CDN helped. Thanks!