Building¶
RCL is written in Rust and builds with Cargo:
cargo build --release
target/release/rcl --help
The repository includes a rust-toolchain.toml
file that specifies a compatible Rust version. When Cargo is managed by Rustup, Rustup will automatically fetch the right toolchain.
To build a static binary rather than a dynamically linked one:
cargo build --release --target x86_64-unknown-linux-musl
target/x86_64-unknown-linux-musl/release/rcl --help
Cross-compiling¶
With cargo-zigbuild, we can cross-compile for other targets:
cargo zigbuild --release --target aarch64-unknown-linux-gnu
This process is automated with Nix for supported targets:
nix build .#binaries
sha256sum result/*
The resulting binaries are independent of the Nix store. This is how we build release artifacts for the supported platforms.
Reproducibility¶
As of v0.10.0, builds for the following targets are confirmed to be bitwise reproducible when building using Nix:
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
Unfortunately, the following targets are not reproducible, help to diagnose and fix the discrepancies is welcome:
- aarch64-apple-darwin