AphrodyBun GitHub

Runtime docs · Runtime · Contributing

One-command setup

Clone and build the Aphrody runtime (aphrody-labs/bun), toolchains and dependencies included, with one command

One command clones aphrody-labs/bun, installs everything the build needs and ends with a debug build that prints its version (bun bd --version).

Linux & macOS
curl -fsSL https://bun.aphrody.com/bun/setup.sh | bash
Windows
irm https://bun.aphrody.com/bun/setup.ps1 | iex

The same launchers live in the repository and can be fetched from GitHub directly:

curl -fsSL https://raw.githubusercontent.com/aphrody-labs/bun/main/scripts/aphrody/install-dev.sh | bash
irm https://raw.githubusercontent.com/aphrody-labs/bun/main/scripts/aphrody/install-dev.ps1 | iex

Plan for about 30 GB of free disk space. The first run takes 30 minutes on 10 cores (a fresh Ubuntu 26.04 container), longer on smaller machines; most of it is the first build.

What it does

install-dev.sh (Ubuntu/Debian, Alpine, macOS) and install-dev.ps1 (Windows) install the Aphrody runtime's bun when the machine has none or has an upstream one (scripts/aphrody/install.sh / install.ps1, verified against the release's SHA256SUMS.txt). They then run scripts/aphrody/setup.ts, which takes these steps in order:

StepLinuxmacOSWindows
Clonegit clone --filter=blob:none into ~/bun~/bunC:\bun
System packagesapt or apk: compiler, CMake, NASM, ccache, gitXcode Command Line Tools, Homebrew: CMake, NASM, ccachewinget: Git, CMake, NASM, PowerShell 7
LLVM, at the series of pins.llvmapt.llvm.org (Debian/Ubuntu), edge/main (Alpine)brew install llvm@23release tarball, verified against the sha256 digest GitHub publishes for it, in %LOCALAPPDATA%\bun\toolchain, with BUN_TOOLCHAIN_LLVM set
Rustrustup-init, verified against its .sha256, then rustup toolchain install for rust-toolchain.tomlsamesame
MSVC and the Windows SDKbun msvc setup --toolset 14.44
JS dependenciesbun installsamesame
Native dependenciesevery clone-* target of the build: vendor/* at their pinned commits, the WebKit prebuilt, Node.js headerssamesame
First buildbun bd --versionsamesame

Every step checks its own result first. A second run, or a run after a failure, only does what is missing. Downloads are cached in ~/.bun/setup-cache under their sha256.

Options

Options go after bash -s -- on Linux and macOS, or in APHRODY_BUN_SETUP_ARGS on Windows. In a checkout, pass them to the script itself:

curl -fsSL https://bun.aphrody.com/bun/setup.sh | bash -s -- --dry-run
bun scripts/aphrody/setup.ts --no-build
$env:APHRODY_BUN_SETUP_ARGS = "--dry-run"; irm https://bun.aphrody.com/bun/setup.ps1 | iex
OptionEffect
--dry-runPrint each step with its state and the commands it would run. Nothing is changed. Add --json to get the plan as JSON.
--dir <path>Checkout to use or create. APHRODY_BUN_CHECKOUT sets the default.
--ref <ref>Branch or tag to clone. Defaults to main.
--no-buildStop before bun bd --version.
--no-systemSkip the system packages, for machines where you manage them yourself.
--no-updateLeave an existing checkout as it is. By default, a clean checkout on a branch is fast-forwarded.
--packagesAlso fetch the Cargo git dependencies of packages/* (the aphrody-labs forks of Oxc, PyO3 and wry).

APHRODY_BUN_REPO points the launchers and the clone at another repository. GITHUB_TOKEN or GH_TOKEN, when set, is sent with the GitHub API requests.

Dependencies

scripts/aphrody/deps.json lists every dependency of the build: the vendored C/C++ libraries and their commits, the WebKit prebuilt, the Cargo git dependencies of packages/*, our forks (aphrody-labs/*) and the toolchains, each with its pinned ref and GitHub visibility. It is generated from the sources, and a test fails when they pin something else:

bun scripts/aphrody/setup.ts deps --write   # regenerate, visibility from `gh repo view`
bun scripts/aphrody/setup.ts deps --check   # what test/internal/aphrody-setup.test.ts checks

The repository has no git submodules. The build fetches the native dependencies itself as GitHub archives at pinned commits. vendor/uv, vendor/find-msvc-tools and vendor/windows-rs are committed. npm dependencies, including tailwindcss, come from the registry through bun.lock.

Manual setup

To install the toolchains yourself, see Contributing and Building Windows, then run bun scripts/aphrody/setup.ts --no-system to check what is still missing.