Flag to disable caching Manifests due Project generation

Why is this needed?

We have encountered a problem with unnecessary manifest caching on CI.
Because each build on CI has a new directory/workspace and environment variables → the necessary manifest cache is always missing in ~/.cache/tuist directory → manifests are always compiled → the cache is stored in ~/.cache/tuist and gradually grows.

I know that the cache directory can be overridden using the environment variable XDG_CACHE_HOME, but we do not want to disable the entire cache. We still need to share the dependency cache.

The tuist clean manifests command is unsafe in a multi-process scenario.
There may be several builds on a single CI node in parallel, which can lead to unexpected behavior if the cache is deleted during project generation. We have encountered such a problem in practice when use this approach.

Proposal

A new flag --no-manifests-cache could be added, which would not cache Manifests and ProjectDescriptionHelpers when generating a project:

tuist generate --no-manifests-cache

:wave: @Ernest0N

I’m not sure if I follow the problem here. Is the problem that:

  • The cache is not re-used across builds
  • The cache grows indefinitively and that’s concerning
  • The cache leads to non-deterministic behaviours in Tuist

Would you mind expanding more on the problem/challenge?

I believe this is not a problem that we should be solving by adding an extra flag.

Have you considered cleaning the cache weekly during your company’s downtime?

Alternatively, you can use a custom XDG_CACHE_HOME and symlink the parts of the Tuist cache that you still want to be in the global cache directory.