Skip to content

[6.3]Check ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS and STRING_CATALOG_GENERATE_SYMBOLS build settings before moving compilation of Asset Catalog and String Catalog into Souece phase#1176

Merged
shahmishal merged 2 commits into
swiftlang:release/6.3from
Tantalum73:andreas_n/respect-build-setting-disabling-symbol-generation-targetting-6.3
Mar 11, 2026
Merged

Conversation

@Tantalum73

Copy link
Copy Markdown
Contributor

Same changes as #1174, but targetting release/6.3.

Asset Catalogs and String Catalogs can generate code to allow for easy access to colors, images, and strings. Because of this, their compilation needs to happen in the Sources build phase. When configured to be in a Resources phase, we move them into Sources automatically.
#705 refactored the code to generalize the idea.

By accident, that changed a behavior where build settings to generate these symbols were not taken into account. Before #705, Asset Catalogs were only moved when ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS was YES. After #705, the move happened unconditionally.

This PR fixes that by only moving Catalogs to the Sources phase when they actually produce sources to compile.

…_GENERATE_SYMBOLS build settings before moving compilation of Asset Catalog and String Catalog into Souece phase
@owenv

owenv commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Explanation:
See above

Scope:
Projects with ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS=NO

Original PRs:
#1174

Risk:
Low-to-Moderate. Affects asset catalog and xcstrings compilation ordering, but in a targeted manner. Changes are covered by tests

Testing:
Added unit tests

Reviewers:
@owenv

@owenv

owenv commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

@swift-ci test

@owenv owenv changed the title Check ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS and STRING_CATALOG_GENERATE_SYMBOLS build settings before moving compilation of Asset Catalog and String Catalog into Souece phase [6.3]Check ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS and STRING_CATALOG_GENERATE_SYMBOLS build settings before moving compilation of Asset Catalog and String Catalog into Souece phase Mar 10, 2026
@daveyc123 daveyc123 requested review from daveyc123 March 10, 2026 21:06
@owenv

owenv commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Tests need a small adjustment for the 6.3 branch:

build/Tests/SWBTaskConstructionTests/XCStringsSymbolGenTests.swift:1124:60: error: extra argument 'hostOS' in call
13:39:12  1122 | 
13:39:12  1123 |         let core = try await getCore()
13:39:12  1124 |         let xcstringsTool = MockXCStringsTool(hostOS: core.hostOperatingSystem, relativeOutputFilePaths: [ 

@owenv

owenv commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

@swift-ci test

@shahmishal shahmishal merged commit fc3609a into swiftlang:release/6.3 Mar 11, 2026
58 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants