iosswiftxcodexcodebuildtuist

tuist cache not taken into account when generating project file


I am trying the caching features of tuist (https://tuist.io) using one of the demos provided on Github, the app_with_spm_dependencies (https://github.com/tuist/tuist/tree/main/projects/tuist/fixtures/app_with_spm_dependencies). I was trying to see the power of caching dependencies using tuist. My approach was running the commands tuist fetch and I got here a warning about some watch target, but it shouldn't invalidate the iOS simulator targets, tuist cache warm, and finally tuist generate. I didn't see any changes in the build times. Checking the ~/.tuist/Cache/BuildCache shows an empty folder. The command tuist cache print-hashes outputs a list of hashes of the targets and external dependencies of this demo project, therefore I can assume some hashes were created. But where is the cache stored in this case? Why is the cache not being used on the tuist generated project file in Xcode 14? I saw the compile steps for each dependency so I am sure everything is being built from scratch.


Solution

  • This is all down to expectations. tuist cache is nothing more than what a clean build on the Xcode project would do: download dependencies into your Build folder and compile them to be used by your code. Each cleancommand erases the Build folder, which in turn results in an empty cache. So, it turns out that the caching feature, in practice, would be the same as keeping the Build folder intact.