Home

Awesome

cargo-guppy: track and query dependency graphs

Build Status License License

This repository contains the source code for:

Use cases

guppy and cargo-guppy can be used to solve many practical problems related to dependency graphs in large Rust codebases. Some examples -- all of these are available through the guppy library, and will eventually be supported in the cargo-guppy CLI as well:

Still to come:

Development status

The core guppy code in this repository is considered mostly complete and the API is mostly stable.

We're building a number of tools on top of guppy, and those are still are under active development. Tool requirements may cause further changes in the API, but the goal will be to avoid extensive overhauls.

guppy's simulation of Cargo builds is extensively tested against upstream Cargo, and there are no known differences. Comparison testing has found a number of bugs in upstream Cargo, for example:

Production users

cargo-guppy is extensively used by the Diem Core project.

guppy is used for several lint checks. This includes basic rules that look at every workspace package separately:

to more complex rules about the overall dependency graph, such as:

In addition, guppy-summaries is used to generate build summaries of packages and features (particularly for high-security subsets of the codebase), and changes to these sets are flagged by Diem's CI (example).

Design

guppy is written on top of the excellent petgraph library. It is a separate codebase from cargo, depending only on the stable cargo metadata format. (Some other tools in this space like cargo-tree use cargo internals directly.)

Minimum supported Rust version

The minimum supported Rust version (MSRV) is 1.56.

While a crate is pre-release status (0.x.x) it may have its MSRV bumped in a patch release. Once a crate has reached 1.x, any MSRV bump will be accompanied with a new minor version.

Contributing

See the CONTRIBUTING file for how to help out.

License

This project is available under the terms of either the Apache 2.0 license or the MIT license.