Nix šŸ–¤ macOS Monthly

July 2023

The stdenv LLVM bump is progressing. Shout-outs to @reckenrode and everyone chipping in!

Iā€™ve continued splitting the SDK bump into smaller branches. One snag has been bumping the SDK itself, which dtrace depends on (in later versions we might be able to drop that dependency again), leading to a bit of a circular dependency situation because the SDK requires the stdenv and part of the stdenv requires the SDK.

12 Likes

September 2023

The stdenv LLVM bump is still in need of more reviews. @reckenrode is also working on fixing cross-compilation from aarch64-darwin to x86_64-darwin.

All the dependencies of the bootstrap-tools are split into branches. The other source releases should be buildable against the new bootstrap-tools and avoid a needless rebuild later. I have a patch for issue #150655, however, it makes the binutils build fail and thatā€™s pretty low down in the dependency chain and Iā€™ve been focusing on the prerequisite PRs for the LLVM bump instead. Iā€™m also trying to add the Compression framework to the SDKs, which is needed for newer system_cmds, but running into needing newer darwin-stubs. Either those need a new release or we can switch to fetching the repo instead.

9 Likes

A bit of extra context for the system_cmds update: what Iā€™m trying to do is see just how new we can go since the _cmds packages arenā€™t actually shipped with a particular SDK release. Iā€™ve got most of system_cmds 970.0.4 building, which is the release corresponding to macOS 14 (but using the default SDKs in nixpkgs). After that, I want to look at the other releases.

Iā€™m also replacing the build systems with Meson. Some of the packages try to use Appleā€™s Xcode projects while others have a custom build phase. Apple keeps changing the structure of things, and xcbuild is no longer maintained anyway, so I gave up on trying to make it work.

3 Likes

October 2023

The stdenv LLVM bump was merged. It introduced some issues but theyā€™re being addressed. The cross-compilation PR is still open, but, currently fixes required due to the bump are prioritized.

The patch for issue #150655 broke the binutils build because of unused argument warnings, which cause its configure script to misdetect the presence of standard library headers. Iā€™m still looking into the linker-side of things, the current patch only addresses the compiler-side. I will also continue with the Compression framework, to unblock newer system_cmds and then the stdenv work.

11 Likes

I would also like to mention two things: #265103 and overrideSDK.

The first PR will make CoreFoundation the default over the open-source CF on x86_64-darwin. It is planned for the next staging cycle. The change is being made due to compatibility issues on macOS 14 (possibly due to CorrFoundation hardening).

overrideSDK is a replacement for the apple_sdk_11_0.callPackage pattern. It takes a stdenv and an SDK version string, and it provides an adapted stdenv that uses frameworks from the requested SDK including propagated ones. It also ensures that a compatible xcbuild is used. overrideSDK can also be used to change the deployment target (in addition to the SDK version or just that).

overrideSDK is currently in staging-next and gaining features as needed. Once additional SDKs are introduced and the SDK hierarchy is standardized, it will be updated to support using SDK-specific libraries (such as simd).

10 Likes

The CoreFoundation PR was merged today as part of the merge of stage into staging-next (and the restart of builds). Most of the existing CF-centric stuff (hooks, etc) was left in place (in case the PR needs to be reverted but also to keep the change small), but I expect it will be cleaned up and removed for 24.05.

10 Likes

November 2023

Progress on the cc-wrapper fixes is slow, the large rebuilds make it hard to iterate. The Compression framework bump is currently stuck on a problem with the OpenDirectory framework.

Iā€™ve opened an overview issue for the first source release bumps. The intent is to introduce the new source releases alongside the old ones to enable review in small units and then switch over when everythingā€™s merged. Iā€™ve left the PRs in draft for now in case we can come up with a better way than the nested attribute set in the source releases expression.

5 Likes

Have you considered using ccache?

Is it possible to open a draft PR to start getting feedback and enable others to be able to help build and test?

Also, FYI, thereā€™s also another attempt at fixing it at: cc-wrapper: Enter C++ mode when -lc++ is passed by judofyr Ā· Pull Request #269694 Ā· NixOS/nixpkgs Ā· GitHub.

Once the checks pass, Iā€™ll be merging #296231 into staging. This PR updates system_cmds to 970.0.4 on both aarch64-darwin and x86_64-darwin. This version corresponds to the system_cmds in macOS 14, but they are built with the default SDKs and should work on older systems. Five binaries were lost in the update:

  • makekey - removed upstream
  • login - requires entitlements and non-public headers
  • sadc - removed upstream
  • sar - removed upstream
  • zprint - requires IOKitUser framework that isnā€™t packaged

Several more were added:

  • arch (aarch64-darwin only)
  • chpass
  • cpuctl
  • dynamic_pager
  • iosim
  • kpgo
  • ltop
  • memory_pressure
  • mslutil (aarch64-darwin only)
  • pagesize
  • passwd
  • proc_uuid_policy
  • purge
  • stackshot (aarch64-darwin only)
  • taskpolicy (aarch64-darwin only)
  • vm_purgeable_stat (aarch64-darwin only)
  • wait4path
  • wordexp-helper
  • zlog (aarch64-darwin only)

The aarch64-darwin only ones are due to the default SDK. If you override the SDK, they should build and work on x86_64-darwin. The following will also be available with the 12.0 SDK (once available):

  • lskq
  • lsmp
  • reboot - if/when IOKitUser framework is added
  • shutdown - if/when IOKitUser framework is added

Assuming no further issues are found, this should provide a template for other updates (particularly, using Meson with a vendored meson.build instead of xcbuild).

Edit: Itā€™s been merged into staging.

12 Likes