Configurable cache upload policy for Xcode Compilation Cache
We just shipped a new feature for the Xcode Compilation Cache: configurable upload policy. You can now control whether your local cache service uploads artifacts to the remote cache or operates in read-only mode.
Why this matters
Until now, every machine using the Xcode Compilation Cache both downloaded and uploaded artifacts. This works well for CI, but uploading from local machines slows down local builds and the artifacts produced during incremental local builds are frequently never reused by anyone else. You’re paying the upload cost for no benefit.
By restricting uploads to CI only, local builds stay fast (download-only) while CI populates the remote cache with the artifacts the rest of the team actually needs.
How it works
A new cache option in your Tuist.swift file lets you control the upload behavior:
Disable uploads entirely
import ProjectDescription
let tuist = Tuist(
fullHandle: "your-org/your-project",
cache: .cache(
upload: false
),
project: .tuist(
generationOptions: .options(
enableCaching: true
)
)
)
With upload: false, the local proxy will still download cached artifacts from the remote cache, but it will never upload new ones. Your builds still get faster from cache hits without contributing potentially unreliable artifacts back.
NOTE: When changing the value of upload, you need to re-run tuist setup cache for the new value to take effect.
Upload only from CI
If you want to restrict uploads to CI only, we added Environment.isCI to make this easy:
import ProjectDescription
let tuist = Tuist(
fullHandle: "your-org/your-project",
cache: .cache(
upload: Environment.isCI
),
project: .tuist(
generationOptions: .options(
enableCaching: true
)
)
)
Environment.isCI checks for the CI environment variable that most CI providers (GitHub Actions, CircleCI, Bitrise, etc.) set automatically. On CI, artifacts get uploaded. On developer machines, they don’t.
Build analytics
When uploads are disabled, the upload-related CAS outputs are automatically filtered from build analytics in tuist inspect build. This means your dashboard accurately reflects actual uploads rather than showing skipped operations.
Getting started
This feature is available starting with Tuist 4.139.0. Update your CLI and add the cache option to your Tuist.swift. No migration is needed, the default behavior (upload: true) is unchanged, so existing setups continue to work as before.
We’d love to hear how this works for your team. If you have questions or feedback, drop them in this thread!