Skip to content

[Xcode 15] GeneratedAssetSymbols in a framework or application target cause cache miss #211

Description

@polac24

My integration setup

  • CocoaPods cocoapods-xcremotecache plugin
  • Automatic integration using xcprepare integrate ...
  • Manual integration
  • Carthage

Expected/desired behavior

If a target has .xcassets, a target should still be cacheable

Minimal reproduction of the problem with instructions

  • Use Xcode 15 beta 1
  • run E2E standalone test
  • The test will fail with an error that the final target (StandaloneApp) had a cache miss

Consumer Logs

....
** BUILD SUCCEEDED ** [3.885 sec]

reverting e2eTests/StandaloneSampleApp
rake aborted!
Failure: Unexpected misses: 1 (4). Expected 0
/Users/bartosz/Development/XCRemoteCache/tasks/e2e.rb:251:in `valide_hit_rate'

Environment

  • XCRemoteCache: 0.3.24
  • cocoapods-xcremotecache: 0.0.16
  • HTTP cache server: local nginx
  • Xcode: Version 15.0 beta (15A5160n)

Others

A feature to generate assets references (known as R.), has been added in Xcode 15:

Xcode now generates Swift and Objective-C symbols for each color and image in the asset catalog. These symbols provide a safer, more assistive way to reference assets that’s resilient to renames & typos, leverages compiler type checking, and integrates with code completion.

  • In the producer's post_build phase, the generated .swift file is not listed as a dependency
  • on the consumer side, an unknown input file is reported and fallbacking to the local compilation happens
    • A quick investigation shows that generating GeneratedAssetSymbols.swift and GeneratedAssetSymbols.h happens after the prebuild step so these files cannot be considered in the prebuild phase to decide if a cached artifact is reusable or not, even if we add those 2 files (GeneratedAssetSymbols.{swift|h}) to the list of dependencies
Screenshot 2023-06-05 at 10 09 59 PM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions