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.
cargo install cargo-forgecd my-rust-project
cargo forge init # creates forge.toml
cargo forge fix # installs zig, zip, rustup targets
cargo forge build # builds all platform binariesThat's it. Release artifacts land in release-artifacts/ with a SHA256SUMS
file ready to upload.
cargo forge init generates this for you. Edit to taste:
[forge]
binary = "myapp"
version_from = "Cargo.toml"
# Minimum cargo-forge version required (optional)
# min_version = "1.0.0"
[[forge.target]]
platform = "freebsd-x86_64"
[[forge.target]]
platform = "linux-x86_64"
[[forge.target]]
platform = "windows-x86_64"
archive = "zip"
[forge.deps]
zig = true
zip = true| 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 |
cargo forge init # create forge.toml in current project
cargo forge fix # install missing dependencies
cargo forge check # verify all dependencies are installed
cargo forge build # build all configured platforms
cargo forge build --suffix rc1 # pre-release (e.g. 1.0.0-rc1)
cargo forge clean # remove cross-compile artifacts- 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 | FreeBSD | Linux | Windows | macOS |
|---|---|---|---|---|
| FreeBSD | native | zigbuild | zigbuild | - |
| Linux | zigbuild | native | zigbuild | - |
| Windows | zigbuild | zigbuild | native | - |
| macOS | - | zigbuild | zigbuild | native |
If you want version-pinned builds via Cargo.lock, add forge-core as
a dependency in your project's xtask:
# xtask/Cargo.toml
[dependencies]
forge-core = "0.1"// xtask/src/main.rs
fn main() {
forge_core::run();
}Add .cargo/config.toml to your project root:
[alias]
xtask = "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.
Licensed under either of
at your option.
Copyright 2026 Wavelet Solutions LLC / Artisan Technologies R&D division.