Hive Hive
Sign in

fix(cli): resolve renamed macro cache artifacts

GitHub issue · Closed

Metadata
Source
tuist/tuist #11561
Updated
Jul 5, 2026
Domains
CLI Cache
Details

What changed

This parent change points the cache package submodule at the storage-layer fix and adds coverage for macro cache artifacts whose product name differs from the target name. It also covers the module-cache path where a downloaded archive does not contain a usable artifact.

Related pull requests

Why

There is already a storage fetch step that decides whether a cache artifact is present before the graph is mutated. The issue was that this step looked for macro artifacts using the target name only, while Swift macro artifacts can be named after the macro product instead.

Root cause

For packages such as Point-Free’s dependencies package, the cache item can be keyed by a target like DependenciesMacrosPlugin, while the restored executable artifact is named after the macro product, for example DependenciesMacros.macro. The storage layer treated that present artifact as missing because it only searched for DependenciesMacrosPlugin.macro.

Approach

The cache package keeps the exact artifact-name lookup first. If that lookup fails, it accepts a single .macro artifact in the restored directory or archive. When the module-cache archive does not contain a matching artifact at all, it now returns the normal cache miss path instead of force-unwrapping a missing value.

Impact

Renamed macro artifacts are restored and used correctly. If a macro artifact is genuinely absent, the existing cache miss behavior keeps the affected targets on sources instead of producing a generated project that references an unusable artifact.

Validation

  • mise run cli:lint --fix
  • xcodebuild test -workspace Tuist.xcworkspace -scheme TuistCacheEEUnitTests -destination 'platform=macOS' '-only-testing:TuistCacheEETests/CacheLocalStorageTests/fetch_whenMacroProductNameDiffersFromTargetNameWithValidSignature()' '-only-testing:TuistCacheEETests/CacheRemoteStorageTests/fetch_when_macro_product_name_differs_from_target_name()' '-only-testing:TuistCacheEETests/ModuleCacheRemoteStorageTests/fetch_when_macro_product_name_differs_from_target_name()' '-only-testing:TuistCacheEETests/ModuleCacheRemoteStorageTests/fetch_when_downloaded_archive_does_not_contain_artifact_returns_empty()' CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" COMPILATION_CACHE_ENABLE_CACHING=NO
  • git diff --check
  • git -C cli/TuistCacheEE diff --check
Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments