depsaw
A tool to analyze dependencies for bazel projects.
What is depsaw?
note: this project is experimental. The API is subject to change. Feel free to contribute or file an issue!
Depsaw helps you find unused dependencies in your bazel project.
Installation
See the releases page to grab the precompiled binary.
To build from source, clone the repository, install Cargo, and run:
User Guide
In the future, depsaw will include commands that will be able to automatically reduce building.
Currently, it provides various utilities to help analyze dependencies and rebuild statistics, and provide insights to optimize them.
Figure out what bazel targets are causing the most issues
Run the following:
TARGET=YOUR_TARGET_HERE
Or you can apply other strategies:
Run depsaw analyze --help for a list of all commands.
Pre-cache git and bazel analysis
Sometimes, git and bazel repositories can take a long time to analyze, such that you may want to re-use those results.
- Build the dependency graph for your large repository, and store that relationship:
TARGET="//..."
DEPS_FILE=/tmp/deps.rkyv
1b. Optional, but if you'd like, you can pre-calculate the modified files as well:
You can pass that in via the --git-analysis-file argument in analyze:
TARGET=YOUR_TARGET_HERE