Remove runtime stdlib dependency from pre-built binary targeting Linux

Currently, the pre-built binary targeting Linux links Swift stdlib and
core libraries dynamically. Unlike darwin platforms, Swift does not
guarantee ABI stability on Linux, so the pre-built binary must be run
with exactly the same version of Swift stdlib and core libraries that
it was built with on GitHub Actions. And also the shared libraries can
be installed in various locations, so users usually need to set
`LD_LIBRARY_PATH`.

However, asking users to do the above works only for power users.
Reducing the runtime dependencies makes it usable for more users.
This commit is contained in:
Yuta Saito
2024-01-08 12:16:57 +00:00
committed by Nick Lockwood
parent ad7707bd34
commit 52c2135353
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
ref: ${{ github.event.inputs.ref }}
- name: Build it
run: |
swift build --configuration release
swift build --configuration release --static-swift-stdlib --enable-dead-strip
SWIFTFORMAT_BIN_PATH=`swift build --configuration release --show-bin-path`
mv $SWIFTFORMAT_BIN_PATH/swiftformat "${HOME}/swiftformat_linux"
- name: 'Upload Artifact'