Swift libraries and frameworks are being copied to the device all the time

Originator:1101.debian
Number:rdar://33541565 Date Originated:July 26 2017
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:Yes
 
Xcode copies swift.*dylibs to a device every time I build the app. Though, I would expect it to happen only once.

I understand that the root of this issue is unstable Swift ABI. Therefore each app must have its copy of the swift libraries.
It is very likely that I am missing something, but I see no reason why the following would not work:

Upon the first run on a device, Xcode checks whether current runtime is available on the device. If not, then Xcode installs the libraries into some appropriate location (or the device fetches them from authorized source, or uses another way to make sure the libraries are not malicious). If the runtime is there already, then Xcode just installs the app. Then the app can be run resolving @rpath to, let's say, '/runtimes/deadbeef' (where deadbeef is the version of the current runtime).

The same goes for the AppStore: upon installing the app, device fetches required runtime if needed.

This way there are no duplications on a user' device (multiple runtimes stored in one place). Also, when the ABI is finally stable one could just drop this check upon app installation, making the transition smooth.

​What am I missing?

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!