This document contains some common commands that I need to remember for package maintenance.
- Check for outdated dependencies:
cargo outdated
- Update dependencies:
cargo update
cargo deny check
To check all supported targets for compilation/lint errors, run:
cargo clippy --target x86_64-pc-windows-msvc --target x86_64-apple-darwin --target aarch64-apple-darwin --all-features --all-targets
cargo test
- Install cargo-bloat
- Run
cargo +nightly bloat -Z build-std=std --target x86_64-pc-windows-msvc --profile=release-optimized-debug -n 50 --crates
Run benchmarks with
cargo bench --features "benchmark"
- Install flamegraph
- elevate to administrator privileges
cargo flamegraph --profile=release-optimized-debug
- Install cargo-udeps
- Be able to compile for the target you want to test
- This MUST be run under the nightly toolchain
cargo +nightly udeps
This is how I actually build the project for releases:
cargo +nightly build -Z build-std=std --release
This saves some binary filesize by allowing us to link-time-optimize against the standard lib. See min-sized-rust for a full explanation.