CopySwiftLibs build phase is expensive, runs too often

Originator:jalkut
Number:rdar://26063380 Date Originated:03-May-2016 10:49 AM
Status:Open Resolved:
Product:Developer Tools Product Version:7.3.1 GM Seed
Classification:Performance Reproducible:Always
 
Summary:
The CopySwiftLibs phase unfortunately takes several seconds to complete, and runs far more often than it should practically need to run. The result is a cumulative waste of many minutes when iterating over repeated builds of a project. This is particularly noticeable when doing quick unit testing iterations, and particulary frustrating when the rebuilt code doesn't even involve Swift.

Steps to Reproduce:
1. Create a Swift project, or even an Objective C project with a target whose "Contains embedded Swift" build setting is set to true.
2. Build once, and observe that the "CopySwiftLibs" build phase runs to install the necessary Swift libraries in the built project.
3. Build again without making any changes, and observe that the phase is NOT run again.
4. Make ANY trivial change to any file in the target and rebuild. For example add a space to an Objective C .m file in a target that happens to include/embed Swift content.

Expected Results:
CopySwiftLibs should be smart enough to only run when there is some expectation that the previously installed Swift libraries are out of date.

Actual Results:
CopySwiftLibs runs when virtually any change, to virtually any target that embeds Swift code is made.


Version:
Version 7.3.1 (7D1012)

Notes:


Configuration:
MacBook Pro 2014 edition 15"

Attachments:

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!