Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt frameworks using Swift 5.5 (Carthage) #498

Closed
pokryfka opened this issue Oct 14, 2021 · 17 comments
Closed

Prebuilt frameworks using Swift 5.5 (Carthage) #498

pokryfka opened this issue Oct 14, 2021 · 17 comments
Labels
bug Something isn't working build Issues related to build and CI/CD follow up Requires follow up from maintainers

Comments

@pokryfka
Copy link

Describe the bug

Please prebuilt frameworks using Swift 5.5. (Carthage)

To Reproduce
Steps to reproduce the behavior:

echo github "awslabs/aws-mobile-appsync-sdk-ios" > Cartfile
carthage update --use-xcframework

Result:

*** Downloading aws-sdk-ios binary at "AWS SDK for iOS 2.26.1"
*** Downloading aws-mobile-appsync-sdk-ios binary at "3.4.1"
***  Skipped installing aws-mobile-appsync-sdk-ios binary due to the error:
	"Incompatible Swift version - framework was built with 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1) and the local version is 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)."

    Falling back to building from the source

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
n/a

Environment(please complete the following information):

  • AppSync SDK Version: 3.4.1
  • Dependency Manager: Carthage
  • Swift Version : 5.5, Xcode 13.0

Device Information (please complete the following information):
n/a

Additional context
n/a

@ameter ameter added the bug Something isn't working label Oct 15, 2021
@ameter
Copy link
Contributor

ameter commented Oct 15, 2021

Hi @pokryfka, thanks for bringing this to our attention. aws-mobile-appsync-sdk-ios uses Travis CI, which does not yet support Xcode 13.

Until Xcode 13 is available in our CI pipeline, it should be possible for Carthage to build the SDK from source. Is this behavior working for you?

@pokryfka
Copy link
Author

Thank you for following up on that.

Yes, I can compile it.

The main issue with it is that it takes quite a long time.
It compiles all the targets of AWSCore, most of them are not needed by AppSync itself.

Looking forward to CI update.

@royjit royjit added the pending investigation It has been triaged and discussed but the actual work is still pending label Oct 19, 2021
@pokryfka
Copy link
Author

pokryfka commented Nov 1, 2021

@ameter Travis CI added an image with Xcode 13.1

from https://docs.travis-ci.com/user/reference/osx/#xcode-version

Xcode 13.1 is available by adding osx_image: xcode13.1 to your .travis.yml.

@pokryfka
Copy link
Author

👋

@ameter
Copy link
Contributor

ameter commented Nov 30, 2021

@pokryfka Thanks for following up. We'll update the build and provide an update here when the new version is ready.

@harsh62 harsh62 self-assigned this Dec 6, 2021
@harsh62 harsh62 added pending-release Work is done, but issue can't be closed since the changes were not released yet and removed pending investigation It has been triaged and discussed but the actual work is still pending labels Dec 6, 2021
@brennanMKE brennanMKE assigned diegocstn and unassigned harsh62 Dec 17, 2021
@diegocstn diegocstn added closing-soon-if-no-response This issue will be closed in 7 days unless further comments are made. and removed pending-release Work is done, but issue can't be closed since the changes were not released yet labels Dec 28, 2021
@stale stale bot removed the closing-soon-if-no-response This issue will be closed in 7 days unless further comments are made. label Dec 28, 2021
@diegocstn
Copy link
Contributor

@pokryfka we updated our CI script and released a new of version of the SDK. Let us know if that solves your issues

@pokryfka
Copy link
Author

Thank you for the change.
Unfortunately ABI changed again and the latest stable version, 5.5.2, is not binary compatible with 5.5.1 :/
I guess its primarily because of async/await backward compatibility.

*** Downloading aws-mobile-appsync-sdk-ios binary at "3.4.2"
***  Skipped installing aws-mobile-appsync-sdk-ios binary due to the error:
	"Incompatible Swift version - framework was built with 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6) and the local version is 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)."

Please note that Travis does have image with Xcode 13.2.1/Swift 5.5.2:

Xcode 13.2.1 is available by adding osx_image: xcode13.2 to your .travis.yml.

@harsh62 harsh62 self-assigned this Jan 21, 2022
@royjit royjit added build Issues related to build and CI/CD pending-response Issue is pending triage labels Jan 25, 2022
@pokryfka
Copy link
Author

Thank you!

@pokryfka
Copy link
Author

Well, binaries are fetched as expected but they dont include AppSync at all.

@pokryfka pokryfka reopened this Feb 10, 2022
@lawmicha lawmicha added pending triage Not triaged yet and removed pending-response Issue is pending triage labels Feb 18, 2022
@lawmicha lawmicha removed the pending triage Not triaged yet label Feb 18, 2022
@diegocstn
Copy link
Contributor

diegocstn commented Feb 24, 2022

@pokryfka We released AppSync SDK v3.5.0 that includes a pre-built version of the framework bundled in a XCFramework. Let us know if that solves your issue.

@diegocstn diegocstn added the pending-response Issue is pending triage label Feb 24, 2022
@pokryfka
Copy link
Author

pokryfka commented Feb 28, 2022

@pokryfka We released AppSync SDK v3.5.0 that includes a pre-built version of the framework bundled in a XCFramework. Let us know if that solves your issue.

Thank you for the update.

I made a quick test and the generated framework can be imported (embedded), however when the library is loaded (runtime) it lacks some symbols from AppSyncRealTimeClient.
(I did embed AppSyncRealTimeClient).
Will try to investigate further.

dyld[41253]: Symbol not found: _$s21AppSyncRealTimeClient0aB11MessageTypeO9subscribeyACSScACmFWC
  Referenced from: /Users/michal/Library/Developer/Xcode/DerivedData/SuperPro-buvmonsqzsflotdpwrvmqdchvsof/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/AWSAppSync
  Expected in: /Users/michal/Library/Developer/Xcode/DerivedData/SuperPro-buvmonsqzsflotdpwrvmqdchvsof/Build/Products/Debug-iphonesimulator/AppSyncRealTimeClient.framework/AppSyncRealTimeClient
Symbol not found: _$s21AppSyncRealTimeClient0aB11MessageTypeO9subscribeyACSScACmFWC

For the record, Cartfile does not pin any specific version:

github "awslabs/aws-mobile-appsync-sdk-ios"

and its resolved to:

github "aws-amplify/aws-appsync-realtime-client-ios" "1.9.0"
github "aws/aws-sdk-ios" "2.27.1"
github "awslabs/aws-mobile-appsync-sdk-ios" "3.5.0"
github "daltoniam/starscream" "4.0.4"
github "stephencelis/SQLite.swift" "0.12.2"

@diegocstn
Copy link
Contributor

@pokryfka are you getting that error from a clean build? If you haven't done that already, I'd also recommend to clean your derived data folder just to rule out that the issue isn't related to old artifacts.

@pokryfka
Copy link
Author

pokryfka commented Mar 5, 2022

@pokryfka are you getting that error from a clean build? If you haven't done that already, I'd also recommend to clean your derived data folder just to rule out that the issue isn't related to old artifacts.

removing derived data does not help.
I just rechecked it in clean environment and the problem remains:

dyld[37985]: Symbol not found: _$s21AppSyncRealTimeClient0aB11MessageTypeO9subscribeyACSScACmFWC
  Referenced from: /Users/pokryfka/Library/Developer/Xcode/DerivedData/SuperPro-aojgolpochodiodkgrdjucubyrye/Build/Products/Debug-iphonesimulator/AWSAppSync.framework/AWSAppSync

The problem does not happen when I build xframeworks myself which I do using using Carthage:

carthage build --use-xcframeworks --platform ios --no-use-binaries

(without --no-use-binaries Carthage downloads binaries which saves a lot of compilation time but, for now, does not work - see error above)

Cartfile:

github "awslabs/aws-mobile-appsync-sdk-ios"

Cartfile.resolved:

github "aws-amplify/aws-appsync-realtime-client-ios" "1.9.0"
github "aws/aws-sdk-ios" "2.27.2"
github "awslabs/aws-mobile-appsync-sdk-ios" "3.5.0"
github "daltoniam/starscream" "4.0.4"
github "stephencelis/SQLite.swift" "0.12.2"

--

enums seem to be compiled/bridged/exported differently,
I also noticed warning when switching AWSAppSyncClientError value to handle "unknown" case
which does not happen when I compile frameworks myself.

@pokryfka
Copy link
Author

pokryfka commented Mar 7, 2022

BTW Reachibility is not explicitly listed as dependency, it used to be prior to 3.5.0

@diegocstn
Copy link
Contributor

diegocstn commented Mar 7, 2022

@pokryfka how are you linking the framework in your project?
Your target should be linking at least the following binaries:

  • AppSyncRealTimeClient
  • AWSAppSync
  • AWSCore
  • SQLite
  • Starscream

BTW Reachibility is not explicitly listed as dependency, it used to be prior to 3.5.0

That's expected, we've opted to temporarily embed and renamed that to AWSAppSyncReachability to circumvent this Swift compiler issue. In the long term we'd like to use Apple's Network framework.

@pokryfka
Copy link
Author

pokryfka commented Mar 8, 2022

right, I link all of these:

private let appSyncFrameworks = [
    "AWSAppSync",
    "AppSyncRealTimeClient",
    "AWSCore",
    "SQLite",
    "Starscream",
    "Reachability",
]

it all works well when I build them myself via carthage build --use-xcframeworks --platform ios --no-use-binaries
if I fetch them, which I do using carthage build --use-xcframeworks --platform ios there are linking problems

@lawmicha lawmicha added follow up Requires follow up from maintainers and removed pending-response Issue is pending triage labels Apr 15, 2022
@pokryfka
Copy link
Author

pokryfka commented Oct 6, 2022

we can close it as far as I am concerned,
I switched to SPM as Xcode support of SPM got a bit better

BTW I noticed that even when adding AppSync via SPM it still gets AWSCore xcframeworks,
its just that they are not downloaded by Carthage

@pokryfka pokryfka closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Issues related to build and CI/CD follow up Requires follow up from maintainers
Projects
None yet
Development

No branches or pull requests

6 participants