FreeBSD and Swift

So Landon Fullers swift-freebsd was active when Swift became open source in Version 2, but is now over 40000 commits behind master.
By now besides that version we have an active port of 3.1.1_5 FreshPorts -- lang/swift: Swift programing language and apparently simply installing Swift from source is still trivial simply following the same requirements as that port. Binary install of 3.1.1_5 is also possible via pkg.
While I cannot confirm how closely related this Port is to current Swift (commits were made up to April 2018) this seems to suggest there is an active interest on the FreeBSD side to make Swift compatible.
Could a dialogue be established to get FreeBSD on the list of target Platforms? After all macOS has FreeBSD among it's userland ancestors.

6 Likes

I don't have any expertise in that regard, but I think FreeBSD should simply go into Swift Community-Hosted CI Platforms. For that we'd need someone to setup a node for the CI that can be maintained by the community that care about FreeBSD. :)

So a corresponding description of who to contact, what platform to build for and what github branch to use (if need be fork one) I might just know who to contact on that.

This is essentially the next step, but if keeping FreeBSD support requires some care-and-feeding that might mean having someone familiar with FreeBSD help resolve portability issues. If the CI node finds issues specific to FreeBSD it may still require someone with FreeBSD expertise to diagnose the problem. Over time if it looks like the FreeBSD support has some lasting vitality I can see it graduating into a standard supported platform for Swift.

11 Likes

I cant wait to move my swift server side apps to FreeBSD :slightly_smiling_face: please, support it :innocent:

1 Like

Freebsd 12.1 has release, please port Swift to freebsd, since Darwin has most userlands from Freebsd

If someone from the community wants to help support FreeBSD we could look for a way for it to become a more officially supported platform (in a sustained way). Ultimately Swift support on various platforms need an active steward who can help keep that port working.

8 Likes

I think that having Swift on FreeBSD would be great for both sides. While I am not a coder (any more), I am happy to help in any other way I can.

1 Like

It would indeed be great to have Swift on FreeBSD. I too am all for it.

1 Like

@intini there are good news:
https://github.com/apple/swift-corelibs-libdispatch/pull/561
https://github.com/apple/swift-corelibs-libdispatch/pull/559
https://github.com/apple/swift/pull/38335

hope something swift on freebsd at least feature parity with Linux platform

3 Likes

I am over from the FreeBSD forums, a former Apple employee and an aspiring swift developer. Would very much appreciate it if we could arrange a port to FreeBSD of swift from this side. Iā€™d be happy to be part of it to the extent I can (mainly a devops/sysadmin type), but realize this is largely a lobbying effort over here. On the FreeBSD side, it is pretty easy to port something, but someone has to maintain it and when they move on it is good form to hand the keys off to another maintainer.

Using the project I worked on as a guide, it the BSDisms are usually not the stumbling block. Either the code compiles or it does not. If it does not, the answers are usually found in the documentation, recollections of earlier programmers, and their notes.

So, here is another vote for an official port of swift to FreeBSD.

8 Likes

totally agree. In fact, the BSDism actually a good thing, because lots of the parts of Swift runtime and compiler stack originated from macOS which has much in common with FreeBSD like kqueue, llvm and libc. I think FreeBSD could be not only a okay platform for Swift, But a best platform. Target Swift 6.0 would be great, because there will be a major ABI breakage because of the huge concurrency feature of Swift 5.5.

1 Like

I am curious what is preventing Drexin's patch from being merged? I would love to have Swift on FreeBSD, as it would mean I could run my Server Side Swift services on my server platform of choice. I there anything non-developers can do to help? I am happy to provide testing, or anything else I can do to help move this along.

2 Likes

Welcome to the Swift Forum. Nice to see some more FreeBSD people over here. I am sure you will find this is a very friendly place. By the way, if you have not already done so, check out the people over at Vapor.Codes, as they have a great server side Swift framework that would be perfect for FreeBSD when Swift is available there. :-)

3 Likes

Would also love to see Swift fully supported on FreeBSD.

3 Likes

I also prefer FreeBSD over Linux and would love to be able to use Swift on FreeBSD, especially the server-side swift frameworks.

1 Like

I would like to see Swift on NetBSD. With FreeBSD support in place,
NetBSD support would be just steps away.

Dave

1 Like

My suggestion to those who would like to see Swift on the BSDs is that you try to, or sponsor someone to, port it. Dario's pull linked above and @3405691582's OpenBSD port show you the way, and given the BSD lineage of already-supported platforms like Darwin and Android's Bionic libc, I don't think it will take much.

I and others are happy to answer any questions that come up in the porting effort, and I tried to help out by reviewing Dario's FreeBSD pull and pinging reviewers on some of the previously-merged OpenBSD pulls.

Swift is an open source effort and I now have a full Swift 5.5 toolchain running on my Android phone, with most of the patches required merged into the main repo. I'm sure most of you could contribute in some way to get Swift on your favorite BSD too.

7 Likes

Seconding this: feel free to cc myself on *BSD related bugs for advice or reviews as well. Most of the complex issues have been solved (but maybe not merged yet), and maybe all that's needed are the right #ifdefs, but if you want to bring a port online, having you actually run and test on the platform itself is the most important part.

1 Like

I am thinking about testing a possible resurrection of Swift for TensorFlow on Android devices (see Swift for TensorFlow Resurrection: Differentiation running on iOS). I don't have an Android device myself, but I just realized a Chromebook might do the job. @Finagolfin thanks for the comment in Cross-compilation SDKs for Android.

@Gminfly it would be interesting to see S4TF brought to BSD. I recall that at one time, S4TF maintained a macOS High Sierra port of Swift, so it's within the realm of possibility. Furthermore, it would indirectly bring attention to your effort to bring Swift support to that platform.

3 Likes