Swift on FreeBSD Preview

We have been hard at work to bring the Swift toolchain to FreeBSD. A preview Swift bundle for FreeBSD 14.3+ is available at https://download.swift.org/tmp-ci-nightly/development/freebsd-14_ci_latest.tar.gz. The bundle contains a Swift development compiler and Swift runtimes needed for compiling Swift programs on, and for, FreeBSD 14 on x86_64 machines.

Dependencies

The Swift compiler and runtimes have a few dependencies. Please install the following dependencies:

  • zlib-ng
  • python3
  • sqlite3
  • libuuid
  • curl

Known Issues

The compiler in the bundle is still under development and isn't part of a release yet and we're not quite done porting everything to FreeBSD.

Here is a list of known issues that you may run into while trying things out.

We are investigating adding aarch64 support and making the bundle available for all minor versions of FreeBSD 14.

As you find more bugs, please file issues at https://github.com/swiftlang/swift/issues.

We look forward to hearing your feedback. If you're interested in helping add the finishing polish, please feel free to reach out here on the forums.

22 Likes

On FreeBSD 15, the following error occurs when executing swift.

ld-elf.so.1: Shared object "libutil.so.9" not found, required by "swift"

As a temporary workaround, doas pkg install compat14x-amd64 will solve the issue.

1 Like

Great news, thank you. Registered to this forum just to say that.

1 Like

On FreeBSD 15, the following error occurs when executing swift .

Yes, the FreeBSD stability policy appears to be within a major version. The bundle is built for FreeBSD 14. I'm glad to see that you were able to find a workaround though.

For -STABLE branches, it's important to make sure that ABI is compatible across dot releases (in other words, user can expect applications that is compiled for X.0 would run without modification on any X.y releases). We also try to maintain ABI compatibility across .0 releases, but they are not strictly enforced except for libraries that already implements versioned symbols.

https://wiki.freebsd.org/Releng/ABI

2 Likes

Generally speaking, I would expect the Swift compatibility policy for FreeBSD to be similar to that of Linux. We distribute toolchains for e.g. Ubuntu 22 and Ubuntu 24 that are distinct. @etcwilde that sounds right, I hope?