Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write unused crate detection tool #5236

Closed
brson opened this issue Aug 8, 2019 · 2 comments · Fixed by #6470
Closed

Write unused crate detection tool #5236

brson opened this issue Aug 8, 2019 · 2 comments · Fixed by #6470
Labels
component/build-time Component: Compilation time

Comments

@brson
Copy link
Contributor

brson commented Aug 8, 2019

There doesn't seem to be a way to automatically detect when a crate listed in the manifest is unused. Removing unused crates from the build could help compile times, and is just good housekeeping.

After some investigation it looks like the new -Z binary-dep-depinfo flag, which adds binary dependencies to the makefile rules it outputs as part of the build, can be parsed and compared to the manifest to accomplish this.

It might also be worth adding such logging at the info! level to rustc itself, using the existing bookkeeping for binary-dep-depinfo - this would probably be an easier approach.

@brson brson added the component/build-time Component: Compilation time label Aug 8, 2019
@brson
Copy link
Contributor Author

brson commented Sep 9, 2019

This has since been solved by est31 https://github.com/est31/cargo-udeps

@overvenus
Copy link
Member

How about changing the title to "Remove unused crates" and label help wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/build-time Component: Compilation time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants