-
Notifications
You must be signed in to change notification settings - Fork 870
Description
Summary
When migrating an iOS project to XcodeGen, local Swift packages (Firmware and GraphQL) that work correctly in the
original Xcode project are being improperly added to the generated project. Instead of being referenced as
proper Swift Package Dependencies, they appear under the main target's "Packages" folder as file references,
causing GUID collision errors during build.
Current Behavior
- Local packages defined in project.yml are added as file references under Backbone/Packages/ in the project
navigator - Build fails with error: The workspace contains multiple references with the same GUID 'PACKAGE:...'
- Packages don't appear under "Package Dependencies" where they should be
Expected Behavior
- Local packages should appear under "Package Dependencies" in the project navigator (not under the main target)
- Should be referenced using XCLocalSwiftPackageReference (Xcode 15+ standard)
- No GUID collision errors during build
Steps to Reproduce
- Define local packages in project.yml:
packages:
Firmware:
path: Backbone/Accessory/Firmware
GraphQL:
path: Backbone/Generated/GraphQL
targets:
Backbone:
dependencies:
- package: Firmware
- package: GraphQL
2. Run xcodegen generate
3. Open project and attempt to build
4. Observe GUID collision error
Technical Details
Original Xcode project references (working):
98CE7DD82C758068002132DC /* XCLocalSwiftPackageReference "Backbone/Accessory/Firmware" /
98935C362DD67B3D009F17FE / XCLocalSwiftPackageReference "Backbone/Generated/GraphQL" */
XcodeGen generated references (broken):
- Creates file references instead of package references
- Places packages under main target's file hierarchy
- Results in duplicate GUID errors
Attempted Workarounds (all failed)
- Using localPackages feature in project.yml
- Post-generation Ruby script to add XCLocalSwiftPackageReference
- Various dependency configurations (product names, explicit targets)
- Workspace configurations
Impact
- Prevents successful migration to XcodeGen for projects using local Swift packages
- Blocks builds with "Could not compute dependency graph" errors
- Forces manual Xcode project maintenance instead of declarative configuration
Environment
- XcodeGen version: 2.44.1
- Xcode version: 15+
- Swift version: 5.0
- Platform: iOS
Additional Context
- Local packages contain legitimate Swift Package Manager packages with Package.swift files
- Same packages work correctly when added through Xcode's UI
- Issue appears to be fundamental limitation in how XcodeGen handles local package references
- Package resolution also affected - only downloads 3 packages then halts
Related Files
- /Backbone/Accessory/Firmware/Package.swift - Local firmware package
- /Backbone/Generated/GraphQL/Package.swift - Local GraphQL package (Apollo iOS generated)
- Both packages have proper Swift Package Manager structure with Sources directories
This appears to be a fundamental incompatibility between XcodeGen's file-based approach and Xcode's native local
package reference system introduced in recent versions.