Is anyone doing development with Swift?
When are we going to have Swift 6?
emily
November 3, 2024, 8:27pm
3
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!
3 Likes
What qualifications would be needed to be helpful in this mission?
emily
November 4, 2024, 6:33am
5
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.
3 Likes
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:
NixOS:master
â ed9w2in6:mas-2.1.0
opened 06:01AM - 22 Apr 25 UTC
<!--
^ Please summarise the changes you have done and explain why they are nece⌠ssary here ^
For package updates please link to a changelog or describe changes, this helps your fellow maintainers discover breaking updates.
For new packages please briefly describe the package or provide a link to its homepage.
-->
## Default
When build by default, the previous and this new version would yield identical `mas` binaries.
## New features
Created two new version to allow **optionally to build from source**:
- mas-from-src.nix
- mas-from-release.nix
Both version additionally installs **shell completions from official repository**.
Both provides additional **option to fix up the swift dylib**.
This is because Apple stop distributing them natively to old
version macOS that they drop support. This option simplifies it.
https://github.com/mas-cli/mas/issues/777
version, repoRev, repoSrc, releaseSrc are made overridable too.
### Source build method
In order to build from source, I add included a patch `create_source_mas_package_dot_swift.patch`
into `nixpkgs` because source build logic relies on a code generation script on build time.
By mimic that script with a patch, it is easier to detect overwrites than a manual `patchPhase`, easier to maintain
in the long run.
## Conflicts
Conflicts with pull request https://github.com/NixOS/nixpkgs/pull/398976
## Things done
- Built on platform(s)
- [ ] x86_64-linux
- [ ] aarch64-linux
- [x] x86_64-darwin
- [ ] aarch64-darwin
- For non-Linux: Is sandboxing enabled in `nix.conf`? (See [Nix manual](https://nixos.org/manual/nix/stable/command-ref/conf-file.html))
- [ ] `sandbox = relaxed`
- [ ] `sandbox = true`
- [x] Tested, as applicable:
- ~[NixOS test(s)](https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests) (look inside [nixos/tests]~(https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))
- and/or [package tests](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests)
- ~or, for functions and "core" functionality, tests in [lib/tests](https://github.com/NixOS/nixpkgs/blob/master/lib/tests) or [pkgs/test](https://github.com/NixOS/nixpkgs/blob/master/pkgs/test)~
- ~made sure NixOS tests are [linked](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#linking-nixos-module-tests-to-a-package) to the relevant packages~
- [x] Tested compilation of all packages that depend on this change using `nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"`. Note: all changes have to be committed, also see [nixpkgs-review usage](https://github.com/Mic92/nixpkgs-review#usage)
- [x] Tested basic functionality of all binary files (usually in `./result/bin/`)
- [25.05 Release Notes](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2505.section.md) (or backporting [24.11](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2411.section.md) and [25.05](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2505.section.md) Release notes)
- [ ] (Package updates) Added a release notes entry if the change is major or breaking
- [ ] ~(Module updates) Added a release notes entry if the change is significant~
- [ ] ~(Module addition) Added a release notes entry if adding a new NixOS module~
- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
<!--
To help with the large amounts of pull requests, we would appreciate your
reviews of other pull requests, especially simple package updates. Just leave a
comment describing what you have tested in the relevant package/service.
Reviewing helps to reduce the average time-to-merge for everyone.
Thanks a lot if you do!
List of open PRs: https://github.com/NixOS/nixpkgs/pulls
Reviewing guidelines: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#reviewing-contributions
-->
---
Add a :+1: [reaction] to [pull requests you find important].
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc
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.
4 Likes