Two paths: host-native (Linux with zig installed) or Docker (any OS).
# Arch Linux
sudo pacman -S zig dpkg python
cargo install cargo-zigbuild
# Debian/Ubuntu
sudo apt install zig dpkg-dev python3
cargo install cargo-zigbuild
# Rust target
rustup target add aarch64-unknown-linux-gnucargo make cross-sysroot-aarch64Downloads aarch64 .deb packages from Debian Bookworm and extracts headers
and libraries into cross/sysroot-aarch64/. Uses dpkg-deb only, no
sudo needed. Takes 1-2 minutes on a decent connection.
# irl CLI (release)
cargo make cross-build-aarch64 -- -p iroh-live-cli --release
# Pi Zero demos
cargo make cross-build-aarch64 -- -p pi-zero-demo --release
cargo make cross-build-aarch64 -- -p iroh-live --example publish-pi --features rpicam --release
# Check the whole workspace
cargo make cross-build-aarch64 -- --workspace
# Arbitrary example
cargo make cross-build-aarch64 -- --release --example publishEverything after -- is forwarded to cargo zigbuild.
No zig, no sysroot, no host packages needed. Just Docker.
# irl CLI (release)
cargo make cross-build-aarch64-docker -- -p iroh-live-cli --release
# Pi Zero demo
cargo make cross-build-aarch64-docker -- -p pi-zero-demo --releaseThe Docker image is built on first use (~5 minutes) and cached. It includes zig, cargo-zigbuild, and a pre-built aarch64 sysroot.
Both paths can also be used without cargo-make:
# Host-native
./cross/create-sysroot.sh # one-time
./cross/zigbuild.sh -p iroh-live-cli --release
# Docker
./cross/docker-zigbuild.sh -p iroh-live-cli --release
# Custom sysroot location
SYSROOT=/path/to/sysroot ./cross/zigbuild.sh -p pi-zero-demo --release-
create-sysroot.shdownloads aarch64.debpackages from the Debian archive and extracts them withdpkg-deb. No chroot, no root, no mmdebstrap needed. -
zigbuild.shsetsPKG_CONFIG_SYSROOT_DIR,PKG_CONFIG_PATH, CC/CXX (using zig as a cross-compiler), and linker flags so that-syscrates find the aarch64 headers and libraries. -
cargo-zigbuilduses Zig as the linker, targetingaarch64-unknown-linux-gnu.2.36(glibc 2.36 = Debian Bookworm = Raspberry Pi OS Bookworm). -
docker-zigbuild.shwraps the above in a Docker container with everything pre-installed, mounting the source tree and cargo registry.
The Bookworm sysroot includes:
libcamera-dev-- Raspberry Pi camera stack (unused today: the Pi demos driverpicam-vidinstead)libpipewire-0.3-dev-- PipeWire screen/camera capturelibva-dev,libdrm-dev,libgbm-dev-- GPU/displaylibasound2-dev,libopus-dev-- audiolibv4l-dev-- V4L2 camera capturelibssl-dev-- TLSlibx11-dev,libxkbcommon-dev,libwayland-dev-- windowing
The resulting binaries target aarch64 glibc (not musl) and are compatible with Raspberry Pi OS Bookworm (Debian 12, glibc 2.36).