-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find all CocoaPods with a circular dependency #6
Comments
Thanks for getting this list @segiddins, I'll see to it that all these pod specs are fixed. |
What’s the plan of action here? |
Send them PRs if they will outright cause breakages? |
We have to fix them in the |
I might have the same issue. I ran pod install in our current Podfile and it went in an infinite loop. $ time bundle exec pod install
Analyzing dependencies
^C[!] Cancelled
real 6m34.152s
user 6m15.978s
sys 0m5.308s |
This is the experience that @pietbrauer got:
@segiddins Ideally we should immediately bail on a circular dependency. |
@segiddins Also, seeing as we only output during verbose mode, what about logging the requirements that the resolver is trying to resolve so that we/users can easily pinpoint where the problem is? |
I shared our Podfile for further investigation. |
We do immediately fail on circular dependency and the |
@kylef Ace 👍 I was indeed wondering if it wasn’t a different issue. I guess then the question is if this resolve is going to a lot of incompatible permutations and does eventually finish. @pietbrauer Can you give it a try? (i.e. just let it run for an indeterminate time and also time the amount of time taken again) |
I've made an issue on Analytics's repo showing how to fix it. |
Just got this problem with one of my libraries. Is there a good explanation why circular dependencies are evil besides the challenge to properly implement the logic to support them? I think it can be perfectly valid to require two subspecs to be installed together.
|
I'm not 100% sure what the concrete plan of attack is for this issue, but SlackTextViewController can safely be removed from the list, as a fix is in trunk. |
@lazerwalker do you mean all past versions have also been fixed? |
Ah, right. Negative, just the latest version. This is a deep rabbithole. |
Started over at CocoaPods/Specs#12783 |
@kylef I don't see how older and even current podspecs can be "fixed" without modifying their code or functioning. |
Am I correct in understand that the biggest pain is for podspecs that have subspecs? Possibly related to root specs depending on subspecs and subspecs on other specs? Basically, I would like to see simple reduced examples of the situation that we can reason about better. @rivera-ernesto @kylef If you can provide simple examples of when it currently breaks and which examples you think should be acceptable to still work. @segiddins In case you know of the examples that people will run into, can you provide the same and explain why it’s good for everyone that that would no longer work? (so some details that describe the improvement to users that outweighs the pain to users for having to fix those situations) |
It is impossible to write an iterative dependency resolver that supports conflict resolution and also allows for cyclic dependencies. Cycles make it impossible to reason about the 'sources' for each specification, since there are infinitely many. That means you can't backtrack to select conflicting states. Additionally, your program will never halt because each time you add a dependency on the given cyclic spec, you will be entering an infinitely recursive section of code. |
From a more practical perspective, if two specs 'have to be installed together', then they really are one dependency. |
@segiddins Unless you want to keep them as separate podspecs for clarity/reusability/logic.
I think this is far from impossible, just like visiting graph nodes, I can understand that it may not be a priority, but at the very least it should be marked as not implemented, instead of saying circular dependencies are errors that have to be fixed. |
They're not truly reusable, since they are mutually dependent -- you can't have one without the other.
Please open CocoaPods issues for any such shortcomings.
I disagree. Circular dependencies will not be supported in this library, because they are errors. For further reading, see rubygems/bundler#2652. |
I can see two reasons for needing circular dependencies within subspecs of a given pod (as it stands in CocoaPods at the moment):
Both of these are hacks and the only known way to solve a certain problem (without further changes to CocoaPods). |
Ok, so for this we should implement
I think you said that you did not actually find an occurrence of this in the ‘master’ spec-repo? |
It can also be just two subspecs that require each other: Pod::Spec.new do |s|
s.name = 'ServerKit'
#...
s.default_subspecs = 'Server'
s.subspec 'Server' do |sub|
#...
sub.dependency 'ClientCore'
end
s.subspec 'ClientCore' do |sub|
#...
sub.dependency 'Server'
end
s.subspec 'ClientA' do |sub|
#...
sub.dependency 'ClientCore'
end
s.subspec 'ClientB' do |sub|
#...
sub.dependency 'ClientCore'
end
end
I don't think that merging |
Your example just proves that allowing circular dependencies would be bad design, as well as your Server and ClientCore subspecs/modules depending on each other would be bad library conception and design in any OOP language, right? Instead one would have a common base/API/subspec that defines all common stuff like interfaces/protocols needed by everything else (let's call it |
I don't see how OOP has anything to do with it. Simply two subspecs that depend on each other while wanting to keep them separate. Off course anyone can come up with a different solution but that is not the point. |
I don't get how that could be a good idea and good design. |
We are having an issue with this podspec on 0.35-rc2: https://github.com/ChatSecure/XMPPFramework/blob/release/XMPPFramework.podspec.json When we edit it to remove the circular dependency, it seems to have cached the broken version somewhere and edit: separate issue added here: CocoaPods/CocoaPods#2828 |
The bulk of this work was graciously done by @kylef in CocoaPods/Specs#12783, and the remainder will become possible after my work on CocoaPods/CocoaPods#2829 is merged, so this issue is going to be closed. In the future, issues on the |
Attempt to resolve this error on ```pod install``` and ```pod update``` with Cocoapods 0.35.0 ```[!] There is a circular dependency between XMPPFramework/Core and XMPPFramework/Authentication``` - Manually add the latest Podfile from the official specs repo - Initial attempt to remove circular dependencies - The 3rd party Podfile in the spec repo is maintained by a 3rd party, and aborts ```pod update``` ```pod install``` for version 0.35.0 of the ```pod``` gem. - This is due to the newly added dependency conflict auto-resolution - This is a workaround to address issues breaking all update/installs for our project dependent on XMPPFramework. The permanent solution to this is being addressed as part of: CocoaPods/Molinillo#6 - Initial ID of problem CocoaPods/Specs#12783 - Fixes, including XMPPFramework
Find all podspecs in CocoaPods master and ensure they are not circular dependencies. A quick search and I found two manually (KFData 1.0.1/ARAnalytics).
I know this is outside the scope of Resolver. But considering I found two pod specs by core contributors to CocoaPods which have circular dependencies which have been working before. I think it's important we check how many their are and potentially fix them before we break many CocoaPods projects for our users.
The text was updated successfully, but these errors were encountered: