// cargo install forge-release
Cross-platform Rust release builds from a single machine. FreeBSD, Linux, Windows, ARM64 -- no VMs, no containers, no root required.
// The core capability
cargo-forge uses zig as a universal cross-linker via cargo-zigbuild. Write Rust once, ship binaries everywhere -- from whichever machine you happen to be sitting at.
Zig ships its own libc and linker toolchain for every target. No Docker images,
no system cross-toolchains, no root access. If zig is not installed,
cargo forge fix downloads it using pure Rust HTTP --
proxy-aware, no external dependencies.
The linux-aarch64 target covers Pi 4, Pi 5, and any
64-bit ARM Linux board. Add it in one command and your next
cargo forge build produces a Pi-ready binary
alongside all your other platforms -- no cross-toolchain setup,
no Docker, no separate build machine required.
$ cargo forge target add linux-aarch64
// Origin
You have written the code. The tests pass. The CI is green. And then you need to ship -- and shipping means binaries for every platform your users run.
The old ways were brutal. Docker containers. Virtual machines. Cross-toolchains that took a day to set up and broke silently. Getting a Windows binary from Linux -- or a Linux binary from Windows -- meant hours of work before a single release could go out.
The breakthrough was zig as a universal cross-linker -- but zig is a compiler, not a release pipeline. You still need the right cargo-zigbuild flags, rustup targets per platform, archive packaging, checksums, and graceful handling of host/target combos that don't work. cargo-forge was built to wrap all of that -- born during the development of Anvil, an Arduino scaffolding tool that needed to ship on three platforms without a build farm.
"Two commands. One config file. Ship everywhere." -- Eric Ratliff, Wavelet Solutions LLC
// Philosophy
The typical cross-platform build setup is a Rube Goldberg machine. A Python script that calls a shell script that invokes a Makefile that spins up a Docker container running a Linux image just to cross-compile a Rust binary for Windows. Three languages. Two runtimes. One container daemon. And somewhere in the middle, someone's bash script is quietly breaking on a machine that has a slightly different version of zip installed.
Wait -- what were we doing again? Oh right. Making a build.
cargo-forge handles all of that -- one tool, one config file, zero
containers. It uses cargo-zigbuild and zig under the hood,
and if zig is not installed, cargo forge fix fetches it
automatically. Proxy-aware. No curl. No root. No Docker.
Just a build.
Zig is a compiler and linker -- not a release pipeline. It doesn't know what a Rust project is, which targets to build, how to package a binary into a tarball or zip, or how to generate SHA256SUMS. It doesn't install rustup targets, detect unsupported host/target combos, or know that Windows needs PowerShell instead of zip. cargo-forge wraps all of that. Zig is the engine. cargo-forge is the car.
// Under the hood
Reads your Cargo.toml for binary name and version. Generates
a forge.toml with your chosen targets. Zero manual config.
Installs zig, cargo-zigbuild, and the rustup cross-compile targets for every platform you have configured. Run once per machine.
Native binary built with plain cargo. Cross-compile targets via
cargo-zigbuild. Archives and SHA256SUMS land in
release-artifacts/ ready to upload.
// Compatibility
| Host / Target | freebsd-x86_64 | linux-x86_64 | linux-aarch64 | windows-x86_64 |
|---|---|---|---|---|
| FreeBSD | ● native | ◆ zigbuild | ◆ zigbuild | ◆ zigbuild |
| Linux / WSL | -- skipped | ● native | ◆ zigbuild | ◆ zigbuild |
| Windows | ◆ zigbuild | ◆ zigbuild | ◆ zigbuild | ● native |
FreeBSD cross-compilation from Linux requires FreeBSD system libraries that zig cannot provide on Linux. Build your FreeBSD binary natively on FreeBSD or cross-compile from Windows.
// Quick reference
cargo install forge-releaseinstall the toolcargo forge initcreate forge.tomlcargo forge fixinstall zig and targetscargo forge buildbuild all platformscargo forge build --suffix rc1pre-releasecargo forge --versioncheck versioncargo forge target listshow all platformscargo forge target add linux-aarch64add ARM64cargo forge target remove freebsd-x86_64remove targetcargo forge checkverify depscargo forge cleanwipe artifactscargo forge --helpfull help[forge] binary = "myapp" version_from = "Cargo.toml" # manage targets with: cargo forge target add <platform> [[forge.target]] platform = "freebsd-x86_64" [[forge.target]] platform = "linux-x86_64" [[forge.target]] platform = "linux-aarch64" [[forge.target]] platform = "windows-x86_64" archive = "zip"
// What is next
cargo-forge is designed to handle the entire release pipeline -- not just binaries. The road ahead includes native installers, so you can hand a client something they can double-click. The last mile, fully forged.
FreeBSD, Linux x86_64, Linux ARM64, Windows -- all from one machine via cargo-zigbuild + zig as a universal cross-linker.
cargo forge target add/remove/list -- manage platforms
without touching forge.toml directly.
Pure Rust HTTP download -- proxy-aware, no curl, no root. Installs to user directory and injects into PATH automatically.
Generate a proper Windows installer via cargo-wix. Hand clients a .msi they can just run -- no PATH config required.
Package your binary as a proper system package for Debian and Red Hat based distributions.
Native macOS disk image generation. Requires building on macOS -- actively exploring options.
// Built by
Creator and maintainer
Wavelet Solutions is an engineering consulting firm specializing in embedded systems, RF/signal processing, SCADA modernization, and industrial controls. cargo-forge was created out of a real need: shipping multi-platform Rust tools to clients without the toolchain pain.
waveletsolutions.com →Also uses cargo-forge
Nexus Workshops builds open-source educational tooling for FTC robotics teams and embedded systems students. Both Anvil (Arduino scaffolding) and Weevil (FTC project generator) use cargo-forge to ship release binaries across all platforms.
nxlearn.net →