Carthage: Misleading error message: The dependency graph contained a cycle

Created on 13 Jun 2017  路  16Comments  路  Source: Carthage/Carthage

  • carthage version: 0.23.0
  • xcodebuild -version: Xcode 8.2.1
  • Are you using --no-build? Yes
  • Are you using --no-use-binaries? NO
  • Are you using --use-submodules? NO
  • Are you using --cache-builds? NO

Cartfile

Cannot provide

Carthage Output

[!] Exit status of command 'carthage checkout ****' was 1 instead of 0.
The dependency graph contained a cycle: ....

This error is not due to a dep cycle. It is related to commitsh not matching in Cartfile.resolved when using branch names.

Can the error message reflect this please? I'm happy to try to fix it myself if anyone can point me in the right direction.

bug checkout

Most helpful comment

*** xcodebuild output can be found in /var/folders/yj/msyjmsq56fzggm0f8j288wlr0000gn/T/carthage-xcodebuild.j8NywJ.log

The dependency graph contained a cycle:
SwiftyBeaver:
Hermes: Neuro, Depot, Alchemy
Hestia: Depot, Hermes, Neuro, Alchemy
Pontus: Depot, Hestia, Neuro, Alchemy
ReactiveCocoa: ReactiveSwift
Depot: Neuro
ReactiveSwift: Result
Alchemy: Bits
Neuro:
Result:

Where is the cycle? Besides, Alchemy does not depend on Bits.
This has been introduced after update from 0.23 to 0.24

All 16 comments

So this may be a duplicate of #1328?

@ikesyo Feels related at least. Not sure it's a dupe. Here in the Cartfile the versions are not pinned they are expressed as

git ..core.. "release/2.0.0"

so for every subproject depending on core the hash might be different.

This is not a dep. cycle, it's just mismatching hashes. Unfortunate the the error is misleading :( . Caused me to go rounds for some hours.

Can you provide a reproducible case? I'd definitely like to fix up the error if it's wrong, but I don't quite understand what's happening from your description.

A.framework Cartfile.resolved

github "typelift/Swiftz" "8c04257b31063df2f0d92092904b13d518ff0c3d"

B.framework Cartfile.resolved

github "typelift/Swiftz" "34b2d28e1b1f142737dfc04bab87d3ea771ce914"

C.framework Cartfile.resolved

github "A/A" "v1.0.0"
github "B/B" "v1.0.0"
github "typelift/Swiftz" "8c04257b31063df2f0d92092904b13d518ff0c3d" # taken from B manually

Actual Result:

[!] Exit status of command 'carthage checkout ****' was 1 instead of 0.
The dependency graph contained a cycle: ....

Expected Result:

[!] Exit status of command 'carthage checkout ****' was 1 instead of 0.
The dependency graph contained a unresolvable conflict 
*** xcodebuild output can be found in /var/folders/yj/msyjmsq56fzggm0f8j288wlr0000gn/T/carthage-xcodebuild.j8NywJ.log

The dependency graph contained a cycle:
SwiftyBeaver:
Hermes: Neuro, Depot, Alchemy
Hestia: Depot, Hermes, Neuro, Alchemy
Pontus: Depot, Hestia, Neuro, Alchemy
ReactiveCocoa: ReactiveSwift
Depot: Neuro
ReactiveSwift: Result
Alchemy: Bits
Neuro:
Result:

Where is the cycle? Besides, Alchemy does not depend on Bits.
This has been introduced after update from 0.23 to 0.24

Also after downgrade to 0.23.0 this error has gone.

@plasmLC can you paste the different Cartfile and Cartfile.resolved of the dependencies?

@blender sure, but there is no useful info for you since it contains internal repositories which are not available in public.

Cartfile:

#Acronis International GmbH
git "ssh://[email protected]:7989/amb/Hermes.git" ~> 0.1.0
git "ssh://[email protected]:7989/amb/Hestia.git" ~> 0.1.0
git "ssh://[email protected]:7989/amb/Pontus.git" ~> 0.1.0

#Third-parties
github "SwiftyBeaver/SwiftyBeaver" ~> 1.0.0
github "ReactiveCocoa/ReactiveCocoa" "6.0.0-rc.3"

Cartfile.resolved:

git "ssh://[email protected]:7989/amb/Alchemy.git" "v0.1.0"
git "ssh://[email protected]:7989/amb/Depot.git" "v0.1.0"
git "ssh://[email protected]:7989/amb/Hermes.git" "v0.1.1"
git "ssh://[email protected]:7989/amb/Hestia.git" "v0.1.0"
git "ssh://[email protected]:7989/amb/Neuro.git" "v0.1.0"
git "ssh://[email protected]:7989/amb/Pontus.git" "v0.1.0"
github "ReactiveCocoa/ReactiveCocoa" "6.0.0-rc.3"
github "ReactiveCocoa/ReactiveSwift" "2.0.0-rc.3"
github "SwiftyBeaver/SwiftyBeaver" "1.3.0"
github "antitypical/Result" "3.2.3"

Besides:

  1. Mentioned graph of the dependencies is correct and does not contains any cycles, but contains branches like: (A->B->C), (D->A, B), (F->A, D)
  2. After downgrading Carthage to 0.23.0 all seems to be OK. Still using this version until fixes will be reported.

I'm also seeing this issue in Carthage 0.24.0.

Happening in 0.26.2 as well, brew switch carthage 0.24.0 was enough in my case - working fine on this version.

0.27.0 still have this issue.

Still in 0.28.0

This is blocking our upgrade of carthage

Please read the contents of this ticket.

This is a about a misleading error message, the problem is actually that in your Cartfile you have an undecidable dependency. The first and foremost solution is: __fix your Cartfile(s).__

Second, try with --new-resolver and see if it gets any better.

@blender pardon any unwanted frankness, but I wouldn't have commented here if it was as simple as fixing my Cartfile. I wouldn't have went to the trouble to search, find, read, then comment on this thread. I tried --new-resolver after your suggestion, same result. It is a blocker to upgrade because I'm not simply changing Cartfile(s) as a work around (this is a major change).

So an app depends on module-A and module-B, and module-A depends on module-B.
Is this undecidable? It worked this way for about a year? Why would it suddenly be undecidable?

@drkibitz I hear you but again, this is not the right ticket. This ticket is about an undecidable case where the error could be improved.

App -> (A, B), A -> B is a perfectly valid case and Carthage should handle it.

Unless:
App -> B "branch/a"
A -> B "branch/b"

As the ticket says:

This error is not due to a dep cycle. It is related to commitsh not matching in Cartfile.resolved when using branch names.

If you have verified that this is not the case, and you are still having problem with the latest carthage, please open another ticket.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itinance picture itinance  路  3Comments

jdecarlo picture jdecarlo  路  3Comments

3lvis picture 3lvis  路  3Comments

pmhood picture pmhood  路  3Comments

JustinJiaDev picture JustinJiaDev  路  3Comments