Kakehashi runs macOS ARM64 CLI binaries on Linux aarch64 natively

Kakehashi runs macOS ARM64 CLI binaries on Linux aarch64 natively

A developer posted a Show HN for Kakehashi, an experimental, open-source userspace translation layer that loads Darwin Mach-O binaries and runs macOS ARM64 command-line programs natively on Linux aarch64. Rather than emulating instructions, Kakehashi maps a freestanding libSystem and translates BSD syscalls, so guest code executes directly on the host CPU; the project describes the overhead as coming from the syscall boundary itself (TLS switch, alt stack, NEON save/restore, Rust dispatch) scaled by how often the guest calls into the system, not from instruction-level emulation or JIT.

The project has been verified running real guest binaries: clang probes, 7-Zip's 7zz, curl, and multi-threaded workloads, tested on Docker, Colima, and UTM under Linux aarch64. Installation is a single command, cargo install kakehashi (or a local build from a checkout), followed by kh bottle ensure to set up the runtime bottle and kh install 7zip or kh install curl to pull in specific Darwin tools, which then run through commands like kh run 7zz -- a demo.7z README.md or kh run curl -- -sS http://example.com/. The bottle bridges the Linux filesystem to guests as /Volumes/linux/, and the guest libSystem dylib ships embedded inside the kh-runtime binary itself, so end users need no separate download. The project requires Rust 1.88 or newer and Linux aarch64 to run.

The stated product goal is cost, not raw speed: running Darwin CLI tools on cheap Linux aarch64 CI runners instead of scarce, expensive macOS capacity. On GitHub Actions, the project notes that a standard macOS runner minute costs roughly 10 to 12 times a Linux arm64 minute before any wall-time difference, and gives an illustrative example: even if a job runs 5 times slower under Kakehashi on Linux arm64 than the same job on native macOS, the total can still be cheaper, about 5 minutes at $0.005 per minute (roughly $0.025) versus 1 minute at $0.062 for the macOS runner. On compression-heavy test runs with few files, the actual overhead measured against native execution is much smaller, about 1.1 to 1.2 times. A larger 7zz multi-thread compression benchmark, run bare metal on Ubuntu aarch64 under UTM against roughly 8,000 files and about 240 MiB of data, is described as dominated by filesystem path walks and the per-syscall boundary rather than incorrect compression, though the project does not state a resulting speed ratio for that specific run.

The project is explicit about what it does not yet do: the full curl feature set (POST bodies, proxies, end-to-end HTTP/3, every scheme), the real Apple Security framework, git and other command-line developer tools, GUI applications, and code signing are all unsupported so far, with git support (via kh install xcode-tools) named as the next planned feature. Kakehashi is released under the Apache License 2.0, and the project states explicitly that it is not derived from Darling and does not vendor proprietary Apple SDKs or binary blobs.

Key facts

  • Kakehashi loads Darwin Mach-O binaries, maps a freestanding libSystem, and translates BSD syscalls to run real macOS ARM64 CLI guests (clang probes, 7-Zip's 7zz, curl, threads) natively on Linux aarch64, without an instruction emulator or JIT.
  • Verified on Docker, Colima, and UTM running Linux aarch64; installed with cargo install kakehashi, then kh bottle ensure and kh install 7zip or kh install curl.
  • On a GitHub Actions cost example, macOS standard runner minutes cost roughly 10 to 12 times more than Linux arm64 minutes, so a job that runs 5 times slower under Kakehashi (about $0.025 for 5 minutes at $0.005 a minute) can still be cheaper than 1 native macOS minute at $0.062.
  • On compression-heavy test runs with few files the overhead versus native execution is about 1.1 to 1.2 times; on a larger 7zz multi-thread compression benchmark (about 8,000 files, roughly 240 MiB) the project says the gap is dominated by filesystem path walks and per-syscall boundary crossings rather than incorrect compression, without stating a ratio.
  • Full curl features (POST bodies, proxies, HTTP/3, every scheme), the real Apple Security framework, git and other command-line tools, GUI apps, and code signing are not yet supported; the project is released under the Apache License 2.0 and states it is not derived from Darling and vendors no proprietary Apple SDKs.

Why it matters

Kakehashi targets a real cost problem for teams that build or test macOS command-line software in CI: GitHub Actions macOS runners cost roughly 10 to 12 times as much per minute as Linux arm64 runners, and macOS hosted capacity also tends to queue longer and sits behind higher subscription tiers on some platforms. By running the actual Darwin CLI binary on ordinary Linux aarch64 hardware instead of emulating a full macOS system, the project's own worked example shows that a job running five times slower on Linux arm64 can still come out cheaper overall than running it natively on a macOS runner.

Who it affects

The tool is aimed at developers and teams whose CI pipelines need to build, test, or package software with Darwin-specific command-line tools, such as clang-based checks, 7-Zip's 7zz, or curl, and who currently pay for scarce macOS runner capacity to do it. It is not a fit for anyone who needs GUI applications, code signing, notarization, or Xcode UI tests in CI, since Kakehashi does not support those workloads.

How to use it

Kakehashi is free and open source under the Apache License 2.0. Installation is cargo install kakehashi (or a local checkout build), followed by kh bottle ensure to prepare the runtime bottle, then kh install 7zip or kh install curl to bring in specific Darwin binaries. Guests then run as, for example, kh run 7zz -- a demo.7z README.md or kh run curl -- -sS http://example.com/, with the Linux filesystem exposed to guests at /Volumes/linux/. It requires Rust 1.88 or later and Linux aarch64; Docker helper scripts and a default data directory under ~/.local/share/kakehashi/bottle/ are also provided.

How solid is it

The project has been verified running clang probes, 7-Zip's 7zz, and curl, including multi-threaded compression and HTTP/HTTPS transfers, tested on Docker, Colima, and UTM under Linux aarch64, with a documented test suite (cargo test, clippy, and smoke scripts) rather than only wall-clock benchmarks. Measured overhead varies by workload: about 1.1 to 1.2 times slower than native on compression-heavy runs with few files, while a larger multi-file 7zz benchmark (roughly 8,000 files, about 240 MiB) is described as dominated by filesystem path walks and per-syscall crossings rather than incorrect compression, without a stated overall ratio for that run. The project frames its own correctness bar as passing specific test gates, not matching native wall-clock speed.

Risks and caveats

This is explicitly experimental software: the full curl feature set (POST bodies, proxies, end-to-end HTTP/3, every scheme), the real Apple Security framework, git and other command-line developer tools, GUI applications, and code signing are all unsupported so far, with git support planned as the next feature. The project states it is not derived from Darling and vendors no proprietary Apple SDKs or blobs, but as syscall-translation software running unmodified Darwin binaries it inherits the general risk of any compatibility layer: edge cases in less common syscalls or guest behavior may not be covered yet, and the maintainers themselves frame current results as gates passed rather than a finished, production-grade emulator.

“The product goal for CI is not "as fast as native macOS," but run Darwin CLI/tools on cheap Linux aarch64 runners instead of scarce, expensive macOS capacity.”

— Kakehashi project README