which carthage: /usr/local/bin/carthagecarthage version: 0.33.0xcodebuild -version: Xcode 10.2.1, Build version 10E1001--no-build? no--no-use-binaries? no--use-submodules? no--cache-builds? yes--new-resolver? noCartfile
github "instacart/TrueTime.swift"
I'm running /usr/local/bin/carthage outdated --xcode-warnings as part of our build process. Unfortunately this command started failing, which causes our build to fail.
Carthage Output
*** Fetching TrueTime.swift
A shell task (/usr/bin/env git fetch --prune --quiet https://github.com/instacart/TrueTime.swift.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/manselm/Library/Caches/org.carthage.CarthageKit/dependencies/TrueTime.swift)) failed with exit code 1
Running the git command to see what's wrong, it looks like the TrueTime folks did something weird with a tag
/usr/bin/env git fetch --prune https://github.com/instacart/TrueTime.swift.git refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/*
From https://github.com/instacart/TrueTime.swift
! [rejected] 5.0.1 -> 5.0.1 (would clobber existing tag)
Expected output
Carthage's cache was out of date. It should be able to detect this and refresh its own cache, not fail.
Yup, git errors in this case and Carthage doesn't handle it.
We have hit the same problem also with 0.33.0. In our case it was happening in this situation:
0.1.2) was present in both original repo and our forkThe issue happens when checkout in the ~/Library/Caches/org.carthage.CarthageKit/dependencies/foobar is from a different repository than what is specified in Cartfile.
I've changed our build script to /usr/local/bin/carthage outdated --xcode-warnings || echo "warning: failed to check for outdated Carthage dependencies" because it should really never fail our build. It would still be nice if the outdated action essentially did the same thing internally or had the option to do so
Delete the cache as per this recommendation from another repository.
https://github.com/ashleymills/Reachability.swift/issues/340
Confirmed for me.
Most helpful comment
We have hit the same problem also with
0.33.0. In our case it was happening in this situation:0.1.2) was present in both original repo and our forkThe issue happens when checkout in the
~/Library/Caches/org.carthage.CarthageKit/dependencies/foobaris from a different repository than what is specified inCartfile.