Software Consulting & Engineering Requirements to Production

cargo-dragons: dependency-aware Rust releases

2022-present

← Back to portfolio

  • Open source
  • Rust
  • Cargo
  • petgraph

Developing cargo-dragons to automate releases across Rust workspaces and monorepos. My contributions began with diamond-pattern recognition and maintenance releases for its predecessor, cargo-unleash, followed by forking the tool as cargo-dragons and extending it.

Releasing interdependent crates requires staged publishing and coordinated dependency updates. Development dependencies add complications as a workspace grows. The tool determines which crates need releasing, orders them by dependency, and checks packages and feature combinations before publishing to public or private registries.

Graph analysis and transformation drive the release planner. It models crate dependencies as a directed graph, reports cycles using strongly connected components, and schedules dependencies before the crates that use them. Shared dependencies in diamond-shaped graphs remain valid, and development dependencies are excluded from release ordering.

The toolbox combines features inherited from cargo-unleash with later additions to handle recurring release tasks:

  • Update dependency versions across the repository
  • Add crate owners
  • Handle partially published dependency trees
  • Check all feature combinations with cargo check or cargo build
  • Rename packages across the monorepo
  • Set TOML keys to specified values across workspace members
  • Unify dependency versions across the monorepo

My later work included restoring development dependencies temporarily removed for the release process and preserving whitespace when doing so, ensuring a zero git-delta post release vs the pre-state. Recent work focuses on code quality, private-registry workflows, and cargo feature-combination checks.