RC RANDOM CHAOS

Kakehashi runs macOS ARM binaries on Linux natively to dodge pricey CI

· via Hacker News

Original source

Show HN: Kakehashi – Experimental userspace to run macOS binaries on Linux ARM

Hacker News →

Kakehashi is an experimental userspace translation layer that executes Darwin Mach-O binaries built for Apple Silicon on Linux aarch64. Rather than emulating instructions, it runs guest code directly on the ARM CPU: it loads the Mach-O, maps a freestanding reimplementation of libSystem, and translates BSD syscalls into their Linux equivalents. The overhead therefore lives entirely at the syscall boundary — TLS switches, alt-stack juggling, NEON save/restore — scaled by how chatty the guest is, not by any interpreter loop. So far it runs real CLI tools including clang probes, 7-Zip’s 7zz (with multithreaded LZMA2 as a correctness gate), and curl over HTTP and HTTPS, verified under Docker/Colima and UTM. A ‘bottle’ provides the guest filesystem and bridges the host root in at /Volumes/linux, and the guest libSystem is vendored and compiled into the runtime so end users install everything with a single cargo command.

The pitch is economic rather than performance-driven. macOS-hosted GitHub Actions minutes cost roughly 10–12x the Linux arm64 rate and tend to queue longer, so even when a pure-CLI Darwin job runs several times slower under Kakehashi on a cheap Linux runner, the billable total can still come out lower. The project is explicit that CI success is measured by passing gates — cargo test, smoke runs, 7zz -mmt=4 — not by matching native wall-clock time.

The scope is deliberately narrow and the limitations are stated plainly: no JIT, no GUI, no codesign or notarization, no real Apple Security.framework, and only a partial curl feature set today, with git via Xcode command-line tools flagged as the next slice. Apple frameworks are covered by soft stubs, producing benign warnings on many runs. Licensed under Apache 2.0, the authors stress it is not derived from Darling and vendors no proprietary Apple SDKs or blobs — a positioning that matters given the legal sensitivity around running Apple’s stack off Apple hardware.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.