Why can't I `sudo apt-get install swift`?

I created and maintain the "official" Swift on Linux package for Fedora. If you're on a Fedora flavor of Linux, 5.0.1 is available via sudo dnf install swift-lang. I try very hard to have the latest released version of Swift available on Fedora as soon as it's available.

As far as the technical situation, Fedora adheres very much to the Linux Filesystem Standard so packages may not install anything is /usr/local, and because a Fedora user may install separately clang and lldb, which are not compatible with Swift (as Swift brings its own version), I have to patch the Swift source to relocate where the swift binary looks for lldb (normally in the same directory (i.e. bin), but in Fedora's case it's /usr/libexec/swift-lldb).

There was a thread here awhile back tossing around the idea of renaming the binaries to be prefixed with "swift" (e.g. swift-lldb) which would make packaging a lot easier, but as of 5.1 that hasn't happened.

As an aside, because the Swift toolchain is so big, it takes a long time to build from scratch, only to discover a packaging problem, or something fails to compile due to glibc version issues, kernel changes, whatever. Every version of Swift has had its own issues with Fedora requiring patches. Fedora, being a rapid-release flavor, definitely doesn't help here; I've had many issues that were simply because suddenly Fedora was using a new version of some core library where functionality had changed and Swift's C++ code wasn't expecting. Frankly I kinda enjoy the technical challenge and getting Swift compiled and running on Fedora has been a lot of fun.

As of right now, I have the latest Swift 5.1 beta packaged on Fedora, but the REPL isn't working and I'm still trying to figure out why. That is something I'd love some help with.

Ron

19 Likes