Cocoapods: Failure when uploading 2 podspecs where the 2nd one depends on the 1st one

Created on 23 Jan 2020  路  12Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

I have 2 frameworks that depends on each other. Let's call them FrameworkCore.framework and FrameworkMore.framework. They share the same release cycle, so when version 6.1.2 is released both versions are pushed and FrameworkMore.framework will require version 6.1.2 of FrameworkCore.framework.

To upload the 2 frameworks I am using pod trunk push xxx.podspec

What did you expect to happen?

I expect both frameworks to be uploaded successfully.

What happened instead?

The first framework is uploaded correctly

 馃帀  Congrats

 馃殌  FrameworkCore (6.1.2) successfully published
 馃搮  January 22nd, 18:39
 馃寧  https://cocoapods.org/pods/FrameworkCore
 馃憤  Tell your friends!
--------------------------------------------------------------------------------

The second one fails because the dependency cannot be found:

Validating podspec
 -> FrameworkMore (6.1.2)
    - ERROR | [iOS] unknown: Encountered an unknown error (CocoaPods could not find compatible versions for pod "FrameworkCore":
  In Podfile:
    FrameworkMore (from `.../FrameworkMore.podspec`) was resolved to 6.1.2, which depends on
      FrameworkCore (= 6.1.2)

I added a huge delay (10 min) in my CI script to avoid this failure, but is there a better approach or something else I can do?

CocoaPods Environment

Stack

   CocoaPods : 1.8.4
        Ruby : ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
    RubyGems : 3.0.6
        Host : Mac OS X 10.14.6 (18G2022)
       Xcode : 11.3 (11C29)
         Git : git version 2.25.0
Ruby lib dir : /usr/local/Cellar/ruby/2.6.5/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ 4525667108911797fa6905ca3ae29cd1dc6bdd19
               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0
workaround available

Most helpful comment

hm I must have confused it with pod repo push... Looks like trunk defaults to using CDN I think ... as seen here https://github.com/CocoaPods/cocoapods-trunk/blob/master/lib/pod/command/trunk/push.rb#L147

@igor-makarov perhaps we can update this to look for the git based repo first then CDN if it does not exist?

All 12 comments

See this issue https://github.com/CocoaPods/CocoaPods/issues/9497.

Please use the git based solution that the CDN is backed from to ensure eventual consistency.

I checked the other issue (sorry for the duplicate issue, I actually searched!) but it's not clear what I have to do. How do I use the git based solution?

Just add source 'https://github.com/CocoaPods/Specs.git' to your Podfile or pod repo add cocoapods-master 'https://github.com/CocoaPods/Specs.git' if I remember from the top of my head and use that source.

The CDN source is based on that git repo so its not going away. Its just slower to clone and update.

Going to close for now and we can continue discussion further and re-open if we find a bug or enhancement we can make.

I鈥檝e no Podfile. I just have 2 podspecs that I need to pod trunk push

Maybe I know what you mean. I guess that pod trunk push creates a project and a Podfile to validate the podspec. So yes, I can鈥檛 change the Podfile which is automatically generated, but I can do pod repo add cocoapods-master 'https://github.com/CocoaPods/Specs.git' before pushing. Is that what you meant?

yes do pod repo add ... once and then when you do pod trunk push pass in --sources with cocoapods-master. This way cocoapods will use that source, update it and "see" the other pod that was just published.

Great, I will try that. Thanks!

@dnkoutso pod trunk push does not have a --sources option. Is there another way to specify?

hm I must have confused it with pod repo push... Looks like trunk defaults to using CDN I think ... as seen here https://github.com/CocoaPods/cocoapods-trunk/blob/master/lib/pod/command/trunk/push.rb#L147

@igor-makarov perhaps we can update this to look for the git based repo first then CDN if it does not exist?

then at the moment, there is no real solution except sleep(600) 馃檨

Duplicate of #9497. PR pending.

I removed the sleep(600) and I'm using the new --synchronous options. It works great in most cases, at least in the past, but recently it's failing like 50% of the time.

Was this page helpful?
0 / 5 - 0 ratings