I really like the binary caching feature for speeding up my builds, but I’ve run into a bit of a workflow challenge.
Currently, I use binary caching for all my Swift Package dependencies, which works great most of the time. However, sometimes I need to debug or modify a specific package, so I replace the remote URL with a local path in my Tuist/Package.swift
file and generate the project without binary caching.
The issue is that when I do this, I lose caching for ALL packages, not just the one I’m working on, and my builds become painfully slow again.
I’m wondering if there’s a way (or could be in the future) to disable binary caching for just specific packages? This would let me work directly with the packages I need to modify while keeping the speed benefits for everything else.
Has anyone found a workaround for this? Is this something that might be possible to implement?
Thanks for any tips!
Hey @FelixLisczyk 
The behavior that you’re describing should be the current behavior. The hash of dependencies is determined by the current revision: tuist/Sources/TuistLoader/Loaders/SwiftPackageManagerGraphLoader.swift at main · tuist/tuist · GitHub
If that’s not the case, it’d be great if you could create an issue with a reproducible sample.
Note that instead of changing the url in the Tuist/Package.swift
manifest, you can run a command such as tuist generate MyApp Alamofire
where Alamofire
would be the name of the dependency that you want to debug. That way, you can get its sources instead of the binary without changing the URL.
Thank you for the information, Marek! Passing the package names as additional parameters to tuist generate
solved my problem. I still need to modify my Package.swift
file because I want to work with my actual package directories instead of the copies in Tuist/.build
. However, this isn’t a big issue since I’ve already written a script to automate the process. Thanks again for your help!