Seg Fault when installing the static Linux SDK

Hello,

I'm following instructions to download and install the static Linux SDK and receive a segmentation fault.

➜  Toolchains swift sdk install https://download.swift.org/swift-6.0-branch/static-sdk/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a_static-linux-0.0.1.artifactbundle.tar.gz
Downloading a Swift SDK bundle archive from `https://download.swift.org/swift-6.0-branch/static-sdk/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a_static-linux-0.0.1.artifactbundle.tar.gz`...
[1]    11471 segmentation fault  swift sdk install 

The URL is correct

➜  Toolchains curl -I https://download.swift.org/swift-6.0-branch/static-sdk/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a_static-linux-0.0.1.artifactbundle.tar.gz
HTTP/1.1 200 OK
Server: dlb/1.0.2
...

I'm using driver from the 6.0-dev toolchain

➜  Toolchains swift --version 
Apple Swift version 6.0-dev (LLVM 6e13b8be259f20f, Swift 372de4670b9cd55)
Target: arm64-apple-macosx14.0

@al45tair any idea what I'm doing wrong ?

You aren't doing anything wrong. Sadly there is an issue with the Swift libraries on macOS 14 that is causing this behaviour when you try to use the OSS toolchain. See Distributing binaries for linuxes (static linking?) - #24 by al45tair for a workaround.

Thank you Alastair. The proposed workaround works. It's now downloading. Next step: test the compilation !

Here is the command I used (after replacing the signature on the binaries)

DYLD_LIBRARY_PATH=$PATH_TO_TOOLCHAIN/usr/lib/swift/macosx 
$PATH_TO_TOOLCHAIN/usr/bin/swift sdk install \
https://download.swift.org/swift-6.0-branch/static-sdk/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-13-a_static-linux-0.0.1.artifactbundle.tar.gz

1 Like

Thank you @al45tair for having patched Swift Log and Swift NIO !
I was feeling I opened the rabbit hole, until I realised recent versions of these libs compile with musl !

2 Likes

:-) No worries. There's definitely more work to be done out in the package ecosystem, but I wanted to make sure that at least some of the things people were most likely to be building on worked out of the box.

1 Like