Closed divaproduct closed 4 years ago
Hi @divaproduct, thanks for the PR - I'm commenting to 1) let you know I did see this and 2) to let you know I'm sitting on this for a bit... I read a few other comments on this (like https://github.com/Alamofire/Alamofire/issues/2990) where they're holding off on it because of the "the rather extreme restrictions it places on the library's evolution"... I'm admittedly not as familiar with what those extreme restrictions are, but I'd like to understand them prior to enabling this setting. Can you (or anyone else) elaborate on the pros and cons of the setting? Also, it looks like the CocoaPods issue referenced mentions that they might handle this with a future version out of the box?
I am not sure what are the "rather extreme limitations" of enabling this flag. They way I see it is that if you enable it you can keep distributing the lib as source code while also making it easier to create and manage pre-built binaries (without forking). Am I missing something ?
FYI, see this post on Swift.org - https://swift.org/blog/library-evolution/
From that post, it says (emphasis mine):
Frameworks that are always built and distributed together, such as Swift Package Manager packages or binary frameworks that are internal to your app, should not be built with library evolution support.
and...
Library evolution support should only be used when a framework is going to be built and updated separately from its clients.
Even though many consume this library via CocoaPods or Carthage, I suspect the future direction for pure Swift libraries is via the Swift Package Manager meaning that their recommendations are to not enable this feature. In addition, I wouldn't expect any consumers of SWXMLHash to want to receive a new version of it without also updating both other dependencies and their app, too.
The reasons to not enable this are also mentioned on that post. See the paragraph beginning with:
Enabling library evolution support changes your framework’s performance characteristics...
I hope this helps! I appreciate your interest and contribution regardless. Thanks again!
Hi,
If you try to use
SWXMLHash
as a dependency in a Swift 5.1 based framework you will get the warning:To be able to use
SWXMLHash
using Swift >= 5.1 it need to be built with the flagBUILD_LIBRARY_FOR_DISTRIBUTION = YES
. This PR enable it on both the xcodeproj and on thepodspec
. This is because otherwise during thepod install
phase it will be ignored by cocoapods (see #9232)For more information check this: ABI Stability and More and this: Binary Frameworks in Swift
Tested using Swift 5.1.3 and XCode 11.3 targetting an iOS project
Regards, R.