This document describes how to build the bill CLI across supported platforms.
- Rust (latest stable)
- Cargo
- Docker (recommended for cross-platform builds)
cargo build --releaseOutput:
target/release/bill
cargo build --releaseVerify:
file target/release/billdocker run --rm -it \
--platform linux/amd64 \
-v "$PWD":/app \
-w /app \
rust:latest \
bashInside container:
cargo build --releaseOutput:
target/release/bill
Verify:
file target/release/bill
# Expected: ELF 64-bit LSB executable, x86-64Build on an ARM machine or ARM container:
cargo build --releasedocker run --rm -it \
--platform linux/amd64 \
-v "$PWD":/app \
-w /app \
rust:latest \
bashInside container:
apt update
apt install -y mingw-w64
rustup target add x86_64-pc-windows-gnu
cargo build --release --target x86_64-pc-windows-gnuOutput:
target/x86_64-pc-windows-gnu/release/bill.exe
Verify:
file target/x86_64-pc-windows-gnu/release/bill.exe
# Expected: PE32+ executable (console) x86-64This project uses:
rusqlite = { version = "...", features = ["bundled"] }
This ensures:
- SQLite is compiled and bundled
- No system dependency is required
- Cross-platform builds succeed
zip bill-macos.zip target/release/billzip bill-linux-x86_64.zip target/release/billzip bill-windows.zip target/x86_64-pc-windows-gnu/release/bill.exe- Build macOS binary
- Build Linux x86_64 binary
- Build Windows binary
- Verify binaries using
file - Package binaries (zip)
- Upload to GitHub Releases
Fix:
- Ensure
rusqliteuses thebundledfeature
Cause:
- Architecture mismatch (ARM vs x86)
Fix:
- Use Docker with
--platform linux/amd64
Ensure:
apt install -y mingw-w64| Platform | Method |
|---|---|
| macOS | native build |
| Linux x86_64 | Docker (linux/amd64) |
| Windows | Docker + mingw |
This setup ensures consistent, reproducible builds across platforms.