Skip to content

Comments

fix(cli): restore asset symbol generation for external static frameworks#9382

Merged
pepicrft merged 1 commit intomainfrom
fix/static-framework-resources-asset-symbols
Feb 10, 2026
Merged

fix(cli): restore asset symbol generation for external static frameworks#9382
pepicrft merged 1 commit intomainfrom
fix/static-framework-resources-asset-symbols

Conversation

@pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Feb 9, 2026

Summary

PR #9344 generated separate resource bundles for external static frameworks, which broke Xcode's GenerateAssetSymbols build phase. Packages using Image(.name) syntax stopped compiling because the asset catalog was moved to the bundle target, and Xcode only generates ImageResource extensions for targets that directly contain asset catalogs.

This PR keeps resources inside the static framework itself (both for source builds and the cached XCFramework path), updates the Swift/ObjC bundle accessors to find resources there, and bumps the cache version so stale artifacts get rebuilt.

Changes

  • ResourcesProjectMapper: static frameworks no longer get a separate .bundle target. The Swift accessor uses swiftStaticFrameworkBundleAccessorString for all static frameworks (local and external). The ObjC accessor tries loading the .framework candidate directly before falling back to .bundle.
  • GraphTraverser: direct static XCFrameworks whose libraries are .framework bundles are now embedded in the app, so their resources are reachable at runtime after tuist cache.
  • Cache version: bumped from 1.0.0 to 1.1.0 to force a rebuild of cached artifacts.

Closes #9336

@dosubot dosubot bot added the size:XS For issues that take less than minutes to implement label Feb 9, 2026
@dosubot
Copy link

dosubot bot commented Feb 9, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added domain:generated-projects Issues related to the project-generation features type:bug Something isn't working labels Feb 9, 2026
@pepicrft pepicrft self-assigned this Feb 9, 2026
@tuist
Copy link

tuist bot commented Feb 9, 2026

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Cache hit rate Tests Skipped Ran Commit
TuistCacheEEAcceptanceTests 82 % 14 0 14 9236575c3
TuistCacheEEUnitTests 76 % 118 0 118 027e6559b
TuistDependenciesAcceptanceTests 77 % 18 0 18 b573f8746
TuistGeneratorAcceptanceTests 77 % 73 0 73 b573f8746
TuistKitAcceptanceTests 84 % 44 0 44 9236575c3
TuistUnitTests 84 % 2200 1 2199 9236575c3

Builds 🔨

Scheme Status Duration Commit
TuistAutomationAcceptanceTests 3m 6s 027e6559b
TuistCacheEEAcceptanceTests 1m 5s 027e6559b
TuistCacheEEUnitTests 42.7s 027e6559b
TuistDependenciesAcceptanceTests 2m 54s 027e6559b
TuistGeneratorAcceptanceTests 3m 11s 027e6559b
TuistKitAcceptanceTests 3m 9s 027e6559b
TuistUnitTests 1m 36s 027e6559b

@pepicrft pepicrft requested review from a team, cschmatzler and fortmarek and removed request for a team February 9, 2026 14:10
@dosubot dosubot bot added size:S For issues that take an hour to implement and removed size:XS For issues that take less than minutes to implement labels Feb 9, 2026
Copy link
Member

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused external static frameworks to generate separate resource bundles, moving xcassets away from the framework target. Xcode's GenerateAssetSymbols only runs for targets that directly contain asset catalogs, so the ImageResource extensions were never generated.

I believe you mentioned that SwiftPM also generates a separate bundle – how does it work in their case? I'm also curious why this issue is only coming up now although we had that support forever.

But feel free to go ahead.

@dosubot dosubot bot added lgtm This PR has been approved by a maintainer size:XS For issues that take less than minutes to implement size:M For issues that take a handful of hours to implement and removed size:S For issues that take an hour to implement size:XS For issues that take less than minutes to implement labels Feb 9, 2026
@pepicrft pepicrft force-pushed the fix/static-framework-resources-asset-symbols branch from 154405d to a0d0fde Compare February 10, 2026 13:07
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:M For issues that take a handful of hours to implement labels Feb 10, 2026
Static frameworks (including external ones) now keep resources inside
the framework instead of generating a separate resource bundle. This
lets Xcode's GenerateAssetSymbols build phase work correctly so packages
using Image(.name) syntax compile as expected.

Three changes make this work end to end:

1. ResourcesProjectMapper: static frameworks no longer generate a
   separate .bundle target. Both Swift and ObjC bundle accessors search
   inside the .framework first, then fall back to .bundle.

2. GraphTraverser: direct static XCFrameworks with .framework library
   bundles are now embedded in the app so their resources are accessible
   at runtime. This handles the cache path where tuist cache replaces a
   static framework target with a precompiled XCFramework.

3. Cache version bumped from 1.0.0 to 1.1.0 to force a rebuild of
   cached artifacts.

Closes #9336
@pepicrft pepicrft force-pushed the fix/static-framework-resources-asset-symbols branch from a0d0fde to dd38b10 Compare February 10, 2026 13:11
@dosubot dosubot bot added size:M For issues that take a handful of hours to implement and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Feb 10, 2026
@pepicrft pepicrft merged commit 5c3c85f into main Feb 10, 2026
18 of 21 checks passed
@pepicrft pepicrft deleted the fix/static-framework-resources-asset-symbols branch February 10, 2026 13:35
pepicrft added a commit that referenced this pull request Feb 13, 2026
This reverts the static framework resource embedding feature that was
introduced across multiple PRs (#9081, #9141, #9210, #9240, #9317,
#9382, #9419 and related fixes). Resources for static frameworks go
back to being placed in separate .bundle targets instead of being
embedded inside the framework itself.

The cache version is bumped to invalidate artifacts built with the
old embedding approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain:generated-projects Issues related to the project-generation features lgtm This PR has been approved by a maintainer size:M For issues that take a handful of hours to implement type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Extensions cannot access resources from external SPM packages built as static frameworks

2 participants