Cache Push/Pull Not working with Carthage 3.0.6

#1

Hi,

I’ve followed the steps here How to cache Carthage dependencies to set caching for Carthage since it takes +25min for us. However caching doesn’t seem to be working.

Cache pull fails with:

2017/04/18 16:01:17 => stepParams: main.StepParamsModel{CacheAPIURL:"https://bitrise-build-cache.herokuapp.com/cache/5315d2f64343ef65/IPDbJDnPJZv4pHnKxrZNtg", IsDebugMode:true}
2017/04/18 16:01:17 => Downloading Cache ...
2017/04/18 16:01:17 => cacheTempDir: /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise-cache125843056
2017/04/18 16:01:17  [!] Failed to download cache archive: Failed to generate Download URL: Download URL was rejected (http-code:404): {"error":"Build Cache Not Found"}
exit status 1

Whereas cache push is failing with:

2017/04/18 09:19:39 => Provided list of paths to cache:
2017/04/18 09:19:39  * ./Carthage
2017/04/18 09:19:39  (!) Skipping (./Carthage/Cachefile): Specified path does not exist

I am using the bootstrap command as instructed in the above guide. I am at a loss here at where I can look to figure out what’s happening.

Here is the carthage log as well:

+------------------------------------------------------------------------------+
| (4) carthage@3.0.6                                                           |
+------------------------------------------------------------------------------+
| id: carthage                                                                 |
| version: 3.0.6                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-04-18T08:56:43-07:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[08:56:43]  * [OK] Step dependency (go) installed, available. 
INFO[08:56:43]  * [OK] Step dependency (carthage) installed, available. 

Configs:
- CarthageCommand: bootstrap
- CarthageOptions: --platform ios
- GithubAccessToken: 

Carthage version: 0.20.1
To save cache files use Cache Pull and Cache Push steps


Running Carthage command
Built in cache is available, adding --cache-builds flag
$ carthage "bootstrap" "--platform" "ios" "--cache-builds"
0 Likes

#2

Hey @kaishin! :wave:t2:

Thank you for reporting your issue here.

The problem is:
From the version of carthage 0.20.0, they have a built in cache method, that can be used with a flag --cache-builds, from carthage step version 3.0.6, we automatically add this flag if you did not set up. In the previous step versions we’ve used our own solution to cache carthage files, and that method used the cachefile. So now with your carthage version: 0.20.1 and carthage step version 3.0.6 you won’t have cachefile (I’ll update the how-to you’ve linked, that’s a good catch!) instead you will have:

|- Cartfile.resolved
|- Carthage

So the correct configuration for your Cache Push step would be:

./Cartfile.resolved
./Carthage -> ./Cartfile.resolved

You always need to cache your Cartfile.resolved and if it changed only then you will need to cache your Carthage folder.

Hope this helps! :wink:

2 Likes

#3

At the same time, the post updated:

2 Likes

#4

Thanks! You suggestion is working like a charm now for Carthage step version 3.0.6 ! :+1:

2 Likes