Compilation extremely slow since macros adoption

Yup, working on a solution now. Essentially the plan is to prebuild the swift-syntax modules needed for macros for all our supported host platforms for the last two major releases of swift-syntax and for the last two releases of the swift compiler. Swift Package Manager will resolve the dependencies for macros and if the required version of swift-syntax has binaries available it'll download them into the cache and extract them into the scratch directory so we can build against them. If it's in the cache, we of course skip the download. And if binaries are not available, we build from source as we currently do. As such, there's no changes needed to your packages for this to work.

One interesting advantage we get from this is that for macros to be performant we really need swift-syntax to be built in release mode. And that can take at least 3 minutes of build time. So this should be good all around.

I'll post again once I start pushing PRs up to swift-package-manager so you can follow along. That should probably be right after the US thanksgiving holiday next week. Being in Canada, that'll give me a nice quiet week to get some code done :).

62 Likes