Module XXX Was Not Built with Library Evolution Support

Viewed 2092

My iOS app has two dependencies (Alamofire and Charts) that it incorporates using Swift Package Manager. When I build it, I get this warning wherever I import the modules in question, e.g.:

import Alamofire

Module 'Alamofire' was not compiled with library evolution support; using it means binary compatibility for 'YourApp' can't be guaranteed

What I don't understand is:

  1. Why is this binary compatibility an issue, if my app builds the dependencies from source code using SwiftPM (not embedding frameworks distributed as binaries), and
  2. What should I do about it?

The Alamofire repository's issue threads suggest that Library Evolution Support cannot be added to the current version because it hinders development, however it is supported in the previous major version (4). Perhaps that could be a workaround, but I don't want to perform the major code modifications that would result on my app from downgrading Alamofire.

1 Answers

I think the point is that with binary compatibility we don’t have to embed the Swift language frameworks into the app; the system Swift language frameworks will keep working for your app even if the language evolves in the future, without your having to recompile the app. Hence the name, library evolution.

So without that guarantee, the language will be embedded into the app, swelling its size and losing the other advantages of binary stability, such as the ability of your app to take advantage of faster code in the system frameworks when they improve things in the future, etc.

You can probably test that theory by building the app and looking inside it.

So if I’m getting this right, that is the sense in which Alamofire is holding you back, and explains the warning.

Related