Reference darwin.builder and historical context

This commit is contained in:
Brian McKenna 2022-12-31 18:16:00 +10:00 committed by GitHub
parent 2e25fc8b05
commit 83c17d6afe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,35 @@
You should look at the
[darwin.builder](https://nixos.org/manual/nixpkgs/unstable/#sec-darwin-builder),
which is now part of nixpkgs.
linuxkit-nix was started in 2017 when QEMU did not support macOS'
Hypervisor.framework API. This meant that QEMU had to use full
emulation with no hardware acceleration. Not ideal for building large
software.
QEMU also had some issues on macOS with userspace networking.
At the time, LinuxKit was the easiest way to spin up a VM for builds,
because it spun up HyperKit for hardware accelerated virtualisation
and VPNKit for userspace networking - both used in Docker for Mac.
Theoretically the underlying technology was stable but it was bit
tricky to get everything working well together. There were
bootstrapping issues. For example, we had to be careful when
referencing `linux-x86_64` packages because we were on `darwin-x86_64`
and it could only fetch from Hydra - it couldn't even build a custom
shell script for the Linux VM until we got that initial VM running.
This project also had issues with daemons, permissions and race
conditions.
In 2018, QEMU got experimental support for Hypervisor.framework and
that got promoted to stable in 2019. QEMU is now fast and since
nixpkgs has great support for building and running QEMU virtual
machines, there's little need for this project.
---
# LinuxKit Nix - Linux on Mac Nix builder
[hydra jobset](https://hydra.nixos.org/jobset/linux-on-mac-builder/master)