cargo-forge
Turn-key cross-platform release builds for Rust projects.
Build release binaries for Linux, Windows, FreeBSD, and macOS from a single machine. No VMs, no containers, no Docker. Uses zig as a universal cross-linker via cargo-zigbuild.
Install
Quick start
That's it. Release artifacts land in release-artifacts/ with a SHA256SUMS
file ready to upload.
forge.toml
cargo forge init generates this for you. Edit to taste:
[]
= "myapp"
= "Cargo.toml"
# Minimum cargo-forge version required (optional)
# min_version = "1.0.0"
[[]]
= "freebsd-x86_64"
[[]]
= "linux-x86_64"
[[]]
= "windows-x86_64"
= "zip"
[]
= true
= true
Supported platforms
| Platform | Triple |
|---|---|
freebsd-x86_64 |
x86_64-unknown-freebsd |
linux-x86_64 |
x86_64-unknown-linux-gnu |
linux-aarch64 |
aarch64-unknown-linux-gnu |
windows-x86_64 |
x86_64-pc-windows-gnu |
macos-x86_64 |
x86_64-apple-darwin |
macos-aarch64 |
aarch64-apple-darwin |
Commands
How it works
- Native target is built with plain
cargo build --release - Cross targets are built with
cargo zigbuild --release --target <triple> - Zig acts as a universal linker -- no system cross-toolchains needed
- Windows archives use PowerShell
Compress-Archive(no zip required) - SHA256SUMS is generated automatically
Host support matrix
| Host | FreeBSD | Linux | Windows | macOS |
|---|---|---|---|---|
| FreeBSD | native | zigbuild | zigbuild | - |
| Linux | zigbuild | native | zigbuild | - |
| Windows | zigbuild | zigbuild | native | - |
| macOS | - | zigbuild | zigbuild | native |
Using forge-core as a library (optional)
If you want version-pinned builds via Cargo.lock, add forge-core as
a dependency in your project's xtask:
# xtask/Cargo.toml
[]
= "0.1"
// xtask/src/main.rs
Add .cargo/config.toml to your project root:
[]
= "run --package xtask --"
Then cargo xtask build and cargo forge build both work, reading the same
forge.toml. The xtask version is pinned in Cargo.lock; the global
cargo-forge binary uses whatever version you have installed.
License
Licensed under either of
at your option.
Copyright 2026 Wavelet Solutions LLC / Artisan Technologies R&D division.