Explanation: swift-syntax libraries in compiler has been complied with -enable-library-evolution because the toolchain provides them as a public interface for building plugins (i.e. lib/swift/host/*.swiftmodule). But that was not great for the performance in the compiler. This PR changes that by separating swift-syntax libs for the compiler from the one for the plugins. So the compiler and the plugin now can use different version/ABI of swift-syntax libraries from the compiler. Now swift-syntax for the compiler are compiled without library evolution.
Scope: Macro plugins
Risk: Mid. This changes the mechanism of in-process plugins significantly. Now in-process plugins are communicate with the compiler using the same messaging serialization with other plugins (i.e. swift-plugin-server, and other executable plugins), instead of directly calling the Macro.Type expansion method. Also, to separate the swift-syntax libraries, this introduces another set of shared swift-syntax libraries in the toolchain.
Testing: Passes current test suite.
Issue: rdar://130532628
Reviewer: Hamish Knight (@hamishknight) Alex Hoppen (@ahoppen) Ben Barham (@bnbarham)
Cherry-pick #304 into
release/6.0
(copied from https://github.com/swiftlang/swift/pull/74740)
-enable-library-evolution
because the toolchain provides them as a public interface for building plugins (i.e.lib/swift/host/*.swiftmodule
). But that was not great for the performance in the compiler. This PR changes that by separating swift-syntax libs for the compiler from the one for the plugins. So the compiler and the plugin now can use different version/ABI of swift-syntax libraries from the compiler. Now swift-syntax for the compiler are compiled without library evolution.swift-plugin-server
, and other executable plugins), instead of directly calling theMacro.Type
expansion method. Also, to separate the swift-syntax libraries, this introduces another set of shared swift-syntax libraries in the toolchain.