I think Nix could make building Swift easier

I was having some trouble building the compiler, so I put this one in:

https://github.com/apple/swift/issues/60490

Any thoughts?

cheers

2 Likes

As a NixOS user, I agree!

If only swift was easier to build with nix...

1 Like

Yeah, it ain't easy. I mentioned the existing nix package in the GitHub issue.

It would require work and modifications to the build scripts. That nix derivation seems to do rather brittle patching. So doing it right would probably require some buy-in from those who do a lot of work on the compiler, and they may be used to the status quo and not have a strong desire to improve the process for newcomers.

1 Like

Curious question: Any problems with a flake-based approach? Might be a pipe-dream, but it would be soo cool to simply run nix develop github:apple/swift to pull down a working development environment for master.

1 Like

Yeah how cool would that be? One line and you're ready to rock.

1 Like

Maybe off-topic, but do you happen to know why swift is marked as broken on nixpkgs? It could be as simple as the build timing out on their cache (hydra). Point being it might be "broken" for reasons the swift side of things doesn't necessarily need to be concerned about.

I haven't looked into it yet. In fact I'm barely qualified to be evangelizing for Nix haha!

1 Like

Been tinkering with nix recently. Would be great to see more support for it with Swift. Anyone else looking at nix in 2023... 2024?