Reuse DerivedData From Cache

Hi there,

I am trying to reuse a cache of DerivedData across CI jobs. When the cache is restored, even though the files are "unmodified", it will continue to rebuilds majority of the source code. I am using fastlane to build my project.

I've tested these on my computer:
  1. Build using Fastlane (7 minutes)

  2. Modify a single file

  3. Build using Fastlane (1 minute)

  4. Observed that it only recompiles that file

  5. Compress the DerivedData into derived.tar.gz

  6. Delete DerivedData

  7. Unpack DerivedData from derived.tar.gz

  8. Build using Fastlane (5 minutes)

From WWDC 2018 - Behind the Scenes of the Xcode Build Process, each task in the build graph has a signature computed from stat info and other metadata.

Does anyone know what is used to compute this build signature?

Thanks,
Errol
I'm trying to achieve the exact same thing. Did you make any progress with this?

This might have something to do with the way how you "restore" your cache or how you checkout the git repo. E.g. when we do git clone all he files in the repo receive the current timestamp when clone is happening. If timestamps of the files are changed during the next build execution - xcodebuild might decide that it needs to rebuild the cache. OR if local timestamps of the cached files are too old (which might be the case when you do tar xzf derived.tar.gz) then xcodebuild might think that cache is too old.

i am looking into this same thing. its possible your issue can be related to IgnoreFileSystemDeviceInodeChanges

see https://michalzaborowski.medium.com/circleci-60-faster-builds-use-xcode-deriveddata-for-caching-96fb9a58930

Reuse DerivedData From Cache
 
 
Q