grab / cocoapods-binary-cache

MIT License
477 stars 69 forks source link

Failed to push local cache due to unknown git error. #94

Closed chenxiao218 closed 3 years ago

chenxiao218 commented 3 years ago

This is what I override the Podfile:

config_cocoapods_binary_cache( cache_repo: { "default" => { "remote" => "my_repo_address", "local" => "_LocalBinaryPods" } }, device_build_enabled: true, bitcode_enabled: true, xcframework: true )

This is what in the project folder: image

I came up with following error when run pod binary push.

Error

RuntimeError - Fail to run command 'git -C /Users/myname/Documents/Project/mono-ios/project-ios-mobile/_LocalBinaryPods add .'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/command/executor/base.rb:30:in `git'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/command/executor/pusher.rb:30:in `commit_and_push_cache'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/command/executor/pusher.rb:17:in `block in run'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/cocoapods-binary-cache/ui.rb:5:in `block in step'
/Users/myname/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/cocoapods-binary-cache/ui.rb:5:in `step'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/command/executor/pusher.rb:13:in `run'
/Users/myname/.rvm/gems/ruby-2.6.3/bundler/gems/cocoapods-binary-cache-f73781c33d07/lib/command/push.rb:17:in `run'
/Users/myname/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/myname/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/myname/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/myname/.rvm/rubies/ruby-2.6.3/bin/pod:23:in `load'
/Users/myname/.rvm/rubies/ruby-2.6.3/bin/pod:23:in `<main>'
/Users/myname/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:22:in `eval'
/Users/myname/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:22:in `<main>'
trinhngocthuyen commented 3 years ago

Hi @chenxiao218, in this case, the CLI successfully prebuilt the frameworks but failed to push them to the cache repo. The push step is just the git commands (add + commit + push).

I think you can cd to the cache directory (ie. _LocalBinaryPods) to check anything went wrong.

chenxiao218 commented 3 years ago

@trinhngocthuyen Hi, I have fixed it by clearing the remote repo and retrying the setup steps, thx for the reach out.

shahzadmajeed commented 3 years ago

@chenxiao218 I am seeing same issue. What did you mean by retrying the setup steps? Thanks

chenxiao218 commented 3 years ago

@shahzadmajeed In our binary repo it hosted all the binary cache built in Debug, but someone pushed the cache generated from Release which has totally different configuration to the repo, then the error happens when I try to repush the origin copy.. not sure my scenario is similar to you, I cleared the binary repo via force push and retried the setup just like using the binary cache at first time, then it fixed somehow.