Is anyone doing development with Swift?
When are we going to have Swift 6?
Is anyone doing development with Swift?
When are we going to have Swift 6?
Swift needs serious cleanāup, potentially a full rewrite, and solving the mysterious Hydra build issues. There are a couple of people who have expressed interest in doing so for 25.05 in the Nix on macOS Matrix room and Iād like to assist such efforts, which should be easier now that Randyās macOS SDK rework is in.
The plan would ideally be to update to 5.10, the last version that can be bootstrapped without an existing Swift compiler, and then use that to build Swift 6. If youāre interested in helping out then come say hi on Matrix!
What qualifications would be needed to be helpful in this mission?
Knowing things about the Swift build system would be a big help! Experience with Nix packaging would also of course be necessary, and weād want to make modifications to the existing LLVM package infrastructure to accommodate Swiftās fork. However we already have lots of people with extensive experience with Nixpkgs and LLVM and relatively few with interest and knowledge of the Swift compiler and its build system and bootstrap process, so thatās the skill that would help the effort most on the margin.
I guess I am not there yet.
Another way one could help is by having a body of Swift code that can be tested with the packaged compiler. If Swift support is going to be reworked, itās an opportunity to improve things for Swift users.
I did a quick search and it seems there arenāt much swift project available in nixpkgs
.
If my pull request got merged then then mas
package can be tested on:
I have never worked with nixpkgs
before though so I canāt guarantee it.
Iāve started work on cleaning up Swift, so I can update it to Swift 6.1. I am targeting it for 25.11, though I expect it to land sooner rather than later.
Thanks for that PR! It helped me find an issue with my changes. When Swift imports a module, it sometimes needs help with headers because it bypasses the Clang wrapper.
Anyway, this is ab example of mas after the update. fetchSwiftPMDdeps
is new. Itās similar to fetchCargoVendor
. The hook functionality of swiftpm
has been split into a separate hook.
My current status is I have Swift 5.10.1 building, which is needed to bootstrap Swift 6.1. Iām currently doing some testing and working on updating the rest of the packages in swiftPackages
.
Status update: I have swiftPackages_5
building with all the tools. Swift provides swift-driver. Nothing is wrapped. I have run into a few complications with Swift 6.1.
clang
binary.I spent the last few days working on a patch to Swift to make it read libcxx-cxxflags
from the clang
wrapper. It works and can build Swift 5.10.1 with C++ interop. I expect Swift 6.1 should also work with the patch, but I need to update the default version of LLVM to LLVM 20 (which was planned for 25.11 anyway).
Is there a possibility of getting swift-sdk
in there as well? It looks like thatās necessary for playing around with the new Containerization
package thatās part of macOS 26.
The macOS 26 SDK will be added to nixpkgs once macOS 26 is released, and the SDK is publicly available.
My current status is I got blocked building on Linux, had a move in July, and have been out of the country without access to a computer for the last two weeks. After I get back, I want to focus on a number of Darwin things that need to land for 25.11, then I can resume working on Swift 6.
The version of Swift will be whatever the public release is, which is currently 6.1.1 but could be 6.2.
Just to be clear, Iām talking about this, which I donāt think is the same thing as the typical macOS SDKs: Getting Started with the Static Linux SDK | Swift.org
(Not an expert though, just wanted to poke around at it)
Sorry, I misunderstood. Iād forgotten that Apple actually released the source to Containerization.
To answer your question: in the short term, no. My goal for the update is to improve the maintenance situation and start laying the foundation for better Swift support. After that, it should be possible to build on that with better SDK support.
I think there is an opportunity to use Nix to declaratively manage Swift environments and handle cross-compilation, but we canāt even build applications that require Swift 6 right now. That needs fixed first.
Swift 6.2 is out, which restores the C++ bootstrap path. That should simplify the update, but it is likely to slip past 25.11 due to my limited availability over the last few months. My focus will still be getting the necessary Darwin updates over the finish line before the freeze.