#cargo-subcommand #cycle #dependencies

app cargo-ensure-no-cyclic-deps

A cargo subcommand to detect cyclic dependencies in workspace crates

2 unstable releases

Uses new Rust 2024

0.2.0 Dec 3, 2025
0.1.0 Nov 28, 2025

#279 in Cargo plugins

Download history 9/week @ 2025-11-22 103/week @ 2025-11-29 262/week @ 2025-12-06 323/week @ 2025-12-13 35/week @ 2025-12-20 86/week @ 2025-12-27 149/week @ 2026-01-03 186/week @ 2026-01-10 257/week @ 2026-01-17 138/week @ 2026-01-24

752 downloads per month

Custom license

13KB
103 lines

cargo-ensure-no-cyclic-deps

A cargo subcommand that detects cyclic dependencies between crates in a workspace. This is useful if you want to prevent dev-dependencies from creating dependency cycles as that can cause issues, e.g. for cargo-release.

Usage

Run this command in a cargo workspace:

cargo ensure-no-cyclic-deps

The command will:

  • Analyze all workspace crates
  • Check for cyclic dependencies (including dev-dependencies)
  • Report any cycles found
  • Exit with code 1 if cycles are detected, 0 otherwise

Installation

cargo install --path .

Or from within the workspace:

cargo install cargo-ensure-no-cyclic-deps

Example Output

When cycles are detected:

Error: Cyclic dependencies detected!

Cycle 1:
  crate_a -> crate_b -> crate_c -> crate_a

Cycle 2:
  crate_x -> crate_y -> crate_x

When no cycles are found:

No cyclic dependencies found.

License

MIT

Dependencies

~4–5.5MB
~89K SLoC