Carthage — Repositories with Same Name Clash

Created on 19 Jan 2015  Ā·  11Comments  Ā·  Source: Carthage/Carthage

The swift-development branch of ReactiveCocoa now requires LlamaKit/LlamaKit and Carthage cannot handle two repositories with the same name.

To Reproduce

git clone https://github.com/Carthage/Carthage
cd Carthage
git checkout 14d7ee916e
carthage update --no-build

Output

*** Fetching ReactiveCocoa
*** Fetching LlamaKit
*** Fetching xcconfigs
*** Fetching Commandant
*** Fetching ReactiveTask
*** Fetching Quick
*** Fetching Nimble
*** Fetching xcconfigs
*** Fetching LlamaKit
*** Fetching ReactiveCocoa
*** Checking out LlamaKit at "carthage-0.1.1"
*** Checking out LlamaKit at "v0.5.0"
*** Checking out Nimble at "v0.2.0"
*** Checking out Quick at "v0.2.0"
*** Checking out xcconfigs at "0.7.1"
*** Checking out ReactiveCocoa at "12dca983a22cd8f5ebf895dc95a929ce59a00e34"
*** Checking out Commandant at "2c0384bfa4d0c66ab0ebf5bc48739f9236ea2e0c"
*** Checking out ReactiveTask at "5fec64ec258b2d735ea9b22da21180a41a14eabc"

Most times, that's the end of the output and Carthage/Checkouts/LlamaKit is at commit e37b966998df6ca05445c0b5d9c6c9560f1e7b61.

However, once, I received the following error:

fatal: reference is not a tree: e37b966998df6ca05445c0b5d9c6c9560f1e7b61
Unable to checkout 'e37b966998df6ca05445c0b5d9c6c9560f1e7b61' in submodule path 'Carthage/Checkouts/LlamaKit'
bug update

Most helpful comment

Any known workaround for this problem? I try blowing away the directory in the caches for the dependency that is giving me problems, but that isn't working (and it used to). (~/Library/Caches/org.carthage.CarthageKit/dependencies/...)

Every time I try doing a carthage update it dies on a given dependency, with the above error.

All 11 comments

This is acceptable, and basically by design.

The correct fix is for Carthage to be on the same fork.

Wow, incredibly quick response :thumbsup:

So, to clarify, are you saying eventually the Carthage dependencies which currently require Carthage/LlamaKit will require a LlamaKit/LlamaKit version compatible with ReactiveCocoa?

Yep.

Should I open a more general issue about the clash between repositories with the same name?

It seems like even getting to the point where two checkouts are interacting with the same Carthage/Checkouts subdirectory is something that could be guarded against earlier in the process.

It's a valuable escape hatch to be able to use a forked repository even when a dependency specifies the upstream repo—for example, if Carthage needs to fix a bug in LlamaKit that does not affect the public APIs used by RAC, etc.

Sorry, I’m still confused… :confused:

To separate things a bit from the initial issue with Carthage and its dependencies, say I have a repository X where the Cartfile looks like

github "thoughtbot/Argo" == 0.3.2

If I need to fix a bug in thoughtbot/runes, Argoā€˜s only dependency, are you saying I should modify the Cartfile to

github "thoughtbot/Argo" == 0.3.2
github "jdhealy/runes"

Then, jdhealy/runes overwrites thoughtbot/runes in the directory Carthage/Checkouts/runes and thoughtbot/Argo will import jdhealy/runes instead of thoughtbot/runes.

Is that the ā€œescape hatchā€ scenario?

Yep, that's the basic idea, although I would really use a SHA or branch pinĀ on runes to ensure the behavior you're describing.

Then, jdhealy/runes overwrites thoughtbot/runes in the directory Carthage/Checkouts/runes and thoughtbot/Argo will import jdhealy/runes instead of thoughtbot/runes.

Just tested this out twice, got different behaviors both times, but neither time did jdhealy/runes overwrite thoughtbot/runes.

To reproduce

# empty directory
git init
echo 'github "thoughtbot/Argo" == 0.3.2' | tee Cartfile
carthage bootstrap --use-submodule
echo 'github "thoughtbot/Argo" == 0.3.2' "\n" 'github "jdhealy/runes" "jd-test"' | tee Cartfile
carthage update --use-submodule
head -n1 Carthage/Checkouts/runes/README.md

Output One

github "thoughtbot/Argo" == 0.3.2
*** No Cartfile.resolved found, updating dependencies
*** Fetching Argo
*** Fetching runes
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.AEIrDv.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
github "thoughtbot/Argo" == 0.3.2
 github "jdhealy/runes" "jd-test"
*** Fetching Argo
*** Fetching runes
*** Fetching runes
*** Checking out runes at "cee6b16f47dc766494dbd998bc17f4ca932e08c3"
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
fatal: Unable to create '/Users/jdhealy/Library/Caches/org.carthage.CarthageKit/dependencies/runes/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

# Runes #

Output Two

github "thoughtbot/Argo" == 0.3.2
*** No Cartfile.resolved found, updating dependencies
*** Fetching Argo
*** Fetching runes
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.N33y8b.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
github "thoughtbot/Argo" == 0.3.2
 github "jdhealy/runes" "jd-test"
*** Fetching Argo
*** Fetching runes
*** Fetching runes
*** Checking out runes at "6dd04c24f7fd00d19dde42f2fffb2cb58d93069c"
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.yyoah8.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
# Runes #

If jdhealy/runes overwrote thoughtbot/runes then the head command would have output # Fork of Runes #.

Just realized the submodules part of the previous wasn’t even executing. Should have been --use-submodules not just --use-submodule :sweat:

Similar results after correcting it though:

Output One

github "thoughtbot/Argo" == 0.3.2
*** No Cartfile.resolved found, updating dependencies
*** Fetching Argo
*** Fetching runes
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.aw6Dnk.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
github "thoughtbot/Argo" == 0.3.2
 github "jdhealy/runes" "jd-test"
*** Fetching Argo
*** Fetching runes
*** Fetching runes
*** Checking out runes at "6dd04c24f7fd00d19dde42f2fffb2cb58d93069c"
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
fatal: destination path '/private/tmp/carthage-run/Carthage/Checkouts/runes' already exists and is not an empty directory.
# Runes #

Output Two

github "thoughtbot/Argo" == 0.3.2
*** No Cartfile.resolved found, updating dependencies
*** Fetching Argo
*** Fetching runes
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.aw6Dnk.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
github "thoughtbot/Argo" == 0.3.2
 github "jdhealy/runes" "jd-test"
*** Fetching Argo
*** Fetching runes
*** Fetching runes
*** Checking out runes at "6dd04c24f7fd00d19dde42f2fffb2cb58d93069c"
*** Checking out runes at "v1.1"
*** Checking out Argo at "v0.3.2"
*** xcodebuild output can be found in /var/folders/40/mfn347_16093pn93zqwp01s40000gn/T/carthage-xcodebuild.P2EDCx.log
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Runes-iOS" in Runes.xcodeproj
*** Building scheme "Runes-Mac" in Runes.xcodeproj
*** Building scheme "Argo-iOS" in Argo.xcworkspace
*** Building scheme "Argo-Mac" in Argo.xcworkspace
# Runes #

Any known workaround for this problem? I try blowing away the directory in the caches for the dependency that is giving me problems, but that isn't working (and it used to). (~/Library/Caches/org.carthage.CarthageKit/dependencies/...)

Every time I try doing a carthage update it dies on a given dependency, with the above error.

Was this page helpful?
0 / 5 - 0 ratings