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

wrong swiftimterfaces #3142

Closed
1 task
vdharankar opened this issue Apr 3, 2020 · 11 comments
Closed
1 task

wrong swiftimterfaces #3142

vdharankar opened this issue Apr 3, 2020 · 11 comments
Assignees
Labels
library evolution Issues around library evolution being enabled. support

Comments

@vdharankar
Copy link

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.

Per our *CONTRIBUTING guidelines, we use GitHub for
bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag alamofire.

Please remove this line and everything above it before submitting.

What did you do?

ℹ Tried building XCFramework using xcodebuild command line tool , built target for iOS and iOS-Simulator . Got both frameworks and tested them with sample code . The using '-create-framework' flag tried constructing XCFramework using both framework files. Go the XCFramework too but on using it with test code it showed an error related to wrong swift interface for 'cleanup' function in 'UploadRequest' class.

Expected that the resultant XCFramework will work just the way normal frameworks are working

ℹ Expected that the resultant XCFramework will work just the way normal frameworks are working

What happened instead?

ℹ Instead an error an error related to wrong swift interface for 'cleanup' function in 'UploadRequest' class.

Alamofire Environment

Latest Github version
11.4
5.2
iOS Simulator
10.15

@vdharankar
Copy link
Author

@jshier
Copy link
Contributor

jshier commented Apr 3, 2020

@vdharankar Can you provide the commands used to produce the xcframework? The commands you posted on StackOverflow don't work, there's probably something missing for a clean environment.

@vdharankar
Copy link
Author

Commands came from here Carthage/Carthage#2799

@vdharankar
Copy link
Author

Also You need to set the Build Libraries for Distribution option to Yes in your framework's build settings, otherwise the swift compiler doesn't generate the neccessary .swiftinterface files which are the key to future compilers being able to load your old library.

@vdharankar
Copy link
Author

Also You need to set the Build Libraries for Distribution option to Yes in your framework's build settings, otherwise the swift compiler doesn't generate the neccessary .swiftinterface files which are the key to future compilers being able to load your old library.

this setting is 'NO' in current build.

@jshier
Copy link
Contributor

jshier commented Apr 3, 2020

Yes, Alamofire doesn't support library distribution. If that's a requirement for XCFramework support, it will not work.

@vdharankar
Copy link
Author

Commands came from here [Carthage/Carthage#2799](Carthage/Carthage#2799

Commands I have mentioned on Stackoverflow work my end

@vdharankar
Copy link
Author

Yes, Alamofire doesn't support library distribution.

Can you explain that a bit ? do you mean old iOS style frameworks ? If yes I have created one and used it with a simple code and I found it working

@vdharankar
Copy link
Author

Issue happens only after embedding these individual frameworks into XCFramework .

@jshier
Copy link
Contributor

jshier commented Apr 3, 2020

It is unsafe to manually enable library distribution for libraries which don't have it enabled, like Alamofire, as our APIs are not guaranteed to maintain binary stability, as defined by the limitations of library evolution mode. You particular issue is caused by the fact that we added an override to cleanup for UploadRequest in 5.0.5, which is apparently not a resilient change, and is one of the reasons Alamofire doesn't support library mode.

@jshier jshier closed this as completed Apr 3, 2020
@jshier jshier self-assigned this Apr 3, 2020
@jshier jshier added support library evolution Issues around library evolution being enabled. labels Apr 3, 2020
@jshier
Copy link
Contributor

jshier commented Apr 3, 2020

It appears that adding an override is supposed to be a resilient change, so I'm not sure what the issue is, but its certainly related to library evolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library evolution Issues around library evolution being enabled. support
Projects
None yet
Development

No branches or pull requests

2 participants