In Swift 5.3.1 we introduced static linking on Linux. With this feature, one can pass the
--static-swift-stdlib flag to SwiftPM's
swift build command (or long form
-Xswiftc -static-stdlib) in order to create a statically linked program, with some caveats pointed out in the original post and which are less important to this pitch.
On Linux, this is often the preferred way to build, since the statically linked program is easier to deploy to the target server or otherwise share. Members of the Swift on Server community brought up the idea to change SwiftPM use this mode by default when building executables on Linux, with an opt-out option when it is not needed.
This post is to collect feedback on this idea, and we would love to hear your opinion!