awslabs / aws-mobile-appsync-sdk-ios

iOS SDK for AWS AppSync.
https://awslabs.github.io/aws-mobile-appsync-sdk-ios/
Other
262 stars 130 forks source link

chore: Fix build - move Headers before Compile Sources #546

Closed lawmicha closed 2 years ago

lawmicha commented 2 years ago

Issue #, if available:

Description of changes:

Building from the xcworkspace for the AppSync schema in Xcode 13.4.1 is resulting in "

Cycle inside AWSAppSync; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
Cycle details:
→ Target 'AWSAppSync' has link command with output '/Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/AWSAppSync'
○ Target 'AWSAppSync' has compile command for Swift source files
○ Target 'AWSAppSync' has copy command from '/Users/x/lawmicha/aws-mobile-appsync-sdk-ios/AWSAppSyncClient/AWSAppSync.h' to '/Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/Headers/AWSAppSync.h'
○ Target 'AWSAppSync' has compile command with input '/Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/DerivedSources/AWSAppSync_vers.c'
○ Target 'AWSAppSync' has compile command for Swift source files

Raw dependency cycle trace:

target:  ->

node: <all> ->

command: <all> ->

node: /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/AWSAppSync ->

command: target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc-:Debug:Ld /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/AWSAppSync normal ->

node: /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/Objects-normal/arm64/AWSAppSyncCacheConfigurationMigration.o ->

CYCLE POINT ->

command: target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc-:Debug:CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler ->

node: /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/Headers/AWSAppSync.h ->

command: target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc-:Debug:CpHeader /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/Headers/AWSAppSync.h /Users/x/lawmicha/aws-mobile-appsync-sdk-ios/AWSAppSyncClient/AWSAppSync.h ->

node: <target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc--phase2-compile-sources> ->

command: Gate target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc--phase2-compile-sources ->

node: /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/Objects-normal/arm64/AWSAppSync_vers.o ->

command: target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc-:Debug:CompileC /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/Objects-normal/arm64/AWSAppSync_vers.o /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/DerivedSources/AWSAppSync_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler ->

node: <target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc--generated-headers> ->

command: Gate target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc--generated-headers ->

node: /Users/x/Library/Developer/Xcode/DerivedData/AWSAppSyncClient-drporrsmzhvuenffekidsixmlzhc/Build/Intermediates.noindex/AWSAppSyncClient.build/Debug-iphonesimulator/AWSAppSync.build/Objects-normal/arm64/GraphQLResponse.o ->

command: target-AWSAppSync-658165f7728f7a083674edec37726384a580073b2242e4f51f51f6fd203732fc-:Debug:CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

Ref: https://stackoverflow.com/questions/50709330/cycle-inside-building-could-produce-unreliable-results-xcode-error

Confirmed that using Legacy System also worked. The fix in this PR is to move the Headers above Compile phase, as recommended by the build error

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.