Windows apps packaging their Swift runtime can make the toolchain unusable
We recently [modified](https://github.com/nicklockwood/SwiftFormat/pull/1830) the installer for Nick Lockwood's SwiftFormat project to include the Swift runtime dlls, since the one installed on the machine might not be ABI-compatible. The installer will add its target folder to the system `%Path%`, which will then win when resolving `swiftCore.dll` and other Swift runtime dlls, breaking the toolchain programs like `swift.exe`.
Repro steps:
- Install a Swift toolchain different from SwiftFormat's (not 5.10.1)
- In a new command prompt, run `swift.exe --version`. It should work as expected.
- Install SwiftFormat from [this release](https://github.com/nicklockwood/SwiftFormat/releases/tag/0.54.5)
- In a new command prompt, run `swift.exe --version`. It will now crash because it's picking up the Swift runtime binaries from the SwiftFormat installation.
5 条评论