-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftFormat on Windows should redistribute swift runtimes that it has been tested with #1775
Comments
@vinocher-bc since I don't use Windows it's difficult for me to know the right solution here. For Linux we ship the runtime, but it bloats the download to 20MB (zipped). @compnerd was kind enough to set up the Windows pipeline for me, so I'd guess I'd defer to him about whether it makes sense to ship the runtime there too? |
I think that for any platform (basically anything non-Darwin), packaging the runtime is needed as there's no ABI stability. The breakages are not really announced or tracked so you can't guarantee that the tool will work. So while it may bloat the distribution, it's the safest thing. |
This has now been completed @nicklockwood . However it has a problematic side-effect: Installing SwiftFormat will put the SwiftFormat directory in the system %Path%, and that directory now includes Swift runtime dlls. This interferes with an installed Swift toolchain, which whose apps like the swiftc compiler depend on the system %Path% to find a matching Swift runtime. Hence the compiler might now load the runtime that SwiftFormat distributes and crash on launch. I believe this is a problem that the Swift on Windows installer needs to fix, not SwiftFormat, as it would have happened with any other app distributing the runtime and registering itself in %Path%. However I suggest that SwiftFormat include a visible warning about this situation to not be accusing of breaking the Swift toolchain. |
@tristanlabelle this pattern of installing the swift runtime in a shared location which can then affect other apps seems problematic. Is there no way to statically include the runtime libraries in the binary like we do on Linux? |
@nicklockwood , I agree it's problematic! We don't support statically linking the Swift runtime, and if we did I believe it would prevent an Swift exe from using a Swift dll. I filed this bug on the Swift for Windows installer so we can move the conversation there: swiftlang/swift-installer-scripts#339 . We'll need to solve this problem for all Swift apps on Windows. |
SwiftFormat on Windows currently doesn't redistribute swift runtimes that it has been tested with. This can cause it to break with other versions of swift runtimes installed on a machine. Are there plans to redistribute swift runtimes in the installer?
The text was updated successfully, but these errors were encountered: