Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cached Xcode Derived Data Not Being Used In CI

I am trying to experiment with caching xcode derived data on CI to improve CI build times. I know caching derived data can be risky, but I am trying to gauge the potential build time increases. I am using fastlane to facilitate things, and bitrise to host everything.

I have derived data caching working, but when pulling the cache in CI and doing a build, xcode doesn't seem to use the cached derived data. This is being tested on the same commit, so there are no code changes.

I've tried setting the last modified date to some time in the past, but that doesn't seem to make a difference. It doesn't look like any of my fastlane code is clearing derived data; when running fastlane scan I am passing in clean: false. I saw this post about setting IgnoreFileSystemDeviceInodeChanges, but that didn't seem to help either.

Is there a way to debug why xcode decides not to use cached build artifacts from derived data?

like image 977
Alex Pelletier Avatar asked Dec 11 '25 20:12

Alex Pelletier


1 Answers

Do you use CocoaPods?

I'm trying to do the same thing to optimize the pipelines, but I've found out CocoaPods being recompiled every time what consumed about 80% of the time needed for the whole job.

I found some solutions to it:

  • leavez/cocoapods-binary - Not really new and even not updated by more than a year now with a pretty long list of issues, but recommended by cocoapods.org as you can read here.
  • grab/cocoapods-binary-cache - Pretty fresh solution still WIP but seems like a good solution for caching pods.

I hope this will help you find a solution to your problem!

like image 84
Bartłomiej Świerad Avatar answered Dec 13 '25 15:12

Bartłomiej Świerad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!